/* ================================================
   PIONEER - Military Fitness & Rehabilitation
   Professional CSS Theme
   Built by Veterans. For Everyone.
   ================================================ */

/* CSS Variables */
:root {
    /* Dynamic Branding Colors (can be overridden per organization) */
    --brand-primary: #c8a03c;
    --brand-secondary: #1a1f3a;

    /* Dark-theme text + surface tokens used across phase2/native styles.
       Defined here too (loads first) as a safety net for the dark theme. */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --card-bg: #142238;
    --border: rgba(255, 255, 255, 0.1);

    /* Previously-undefined tokens referenced across the CSS — map to the PIONEER
       palette so cards, accents and headings render correctly on the dark theme. */
    --accent-red: #c8a03c;
    --red: #c8a03c;
    --navy-dark: #0a1628;
    --pioneer-navy: #0a1628;
    --pioneer-gold: #c8a03c;
    --radius-md: 10px;
    --input-bg: #142238;
    --gray-light: rgba(255, 255, 255, 0.6);

    /* Core Colors - PIONEER Theme */
    --navy: #0a1628;
    --navy-light: #142238;
    --navy-medium: #1e3a5f;
    /* THEME: the app's primary/action colour is GOLD (blue + gold + white theme,
       matching the login portal). The --crimson* tokens are repointed to gold so
       every existing var(--crimson) usage (~150 buttons/accents) becomes gold in one
       place. True semantic red lives in --danger below (errors / destructive only). */
    --crimson: #c8a03c;
    --crimson-dark: #b8972e;
    --crimson-light: #d4af37;
    --gold: #d4af37;
    --gold-light: #f0d77c;
    --gold-dark: #b8972e;
    /* Semantic red — only for errors / destructive actions, never branding */
    --danger: #d9433f;
    --danger-dark: #b8332f;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Semantic Colors */
    --success: #28a745;
    --success-light: #48c774;
    --warning: #f39c12;
    --danger: #d9433f;
    --info: #17a2b8;

    /* Shadows — restrained, no glows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.18);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 2px 12px rgba(184, 151, 46, 0.2);

    /* Transitions */
    --transition-fast: all 0.1s ease;
    --transition: all 0.2s ease;
    --transition-slow: all 0.35s ease;

    /* Border Radius — tighter, enterprise */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;

    /* 8pt spacing scale — mobile-first; px maps cleanly to iOS pt / Android dp.
       Single source of truth for the mobile spacing system (see mobile-spacing.css). */
    --sp-1: 4px;    /* tight micro-adjustments only */
    --sp-2: 8px;    /* related items (label/field), min gap between tappables */
    --sp-3: 12px;
    --sp-4: 16px;   /* screen edge margin + gap between distinct cards/blocks */
    --sp-6: 24px;   /* section separation (min) */
    --sp-8: 32px;   /* section separation (max) */
    --sp-12: 48px;  /* touch-target working floor */
    --edge-mobile: 8px;   /* slight mobile body inset — page content comes in a touch from the edge (header keeps its own fixed padding) */
    --touch-min: 48px;     /* touch-target floor (Android / Material) */
    --touch-min-ios: 44px; /* iOS HIG floor — for dense inline controls */
    /* Safe scroll-bottom so content always clears the fixed FAB (.log-fab is
       50px tall at bottom:20px). 50 + 20 + 16 gap = 86px + home-indicator. */
    --fab-clearance: calc(86px + env(safe-area-inset-bottom, 0px));
    /* Type scale (mobile) — page title / section header / card title / body / caption */
    --fs-title: 1.5rem;    /* 24px page titles */
    --fs-header: 1.125rem; /* 18px section headers */
    --fs-card: 1rem;       /* 16px card titles */
    --fs-body: 0.9375rem;  /* 15px body */
    --fs-caption: 0.75rem; /* 12px captions/labels */

    /* Safe Areas for Mobile */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Macro Nutrition Colors */
    --macro-protein: #e8a87c;        /* Orange for protein */
    --macro-carbs: #7cb8e8;          /* Blue for carbs */
    --macro-fat: #e8c87c;            /* Yellow for fat */

    /* Meal Performance Colors */
    --perf-pre: #34C759;             /* Pre-workout (green) */
    --perf-post: #7cb8e8;            /* Post-workout (blue) */
    --perf-recovery: #f0a8b0;        /* Recovery (pink) */

    /* Achievement Medal Colors */
    --medal-gold: #ffd700;
    --medal-silver: #c0c0c0;
    --medal-bronze: #cd7f32;

    /* Class/Session Status Colors */
    --status-available: #34C759;     /* Green - spots available */
    --status-waitlist: #FF9500;      /* Orange - waitlist */
    --status-full: #ef4444;          /* Red - full */
    --status-booked: #34C759;        /* Green - user booked */

    /* Special Highlight */
    --special-badge-bg: #fbbf24;     /* Yellow background */
    --special-badge-text: #78350f;   /* Dark brown text */
}

/* ================================================
   Reset & Base Styles
   ================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--navy);
    color: var(--white);
    line-height: 1.45;
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 0.9375rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ================================================
   Loading Screen
   ================================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-icon {
    margin-bottom: 1.5rem;
    /* Centre the logo + loading bar reliably. margin:auto on .loader-bar was
       leaving it flush-left (13px off-centre, gap on the right); flex centres it. */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pioneer-mark {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 5rem;
    color: var(--crimson);
    display: block;
    text-shadow: 0 0 20px rgba(184, 151, 46, 0.25);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.loader-bar {
    width: 120px;
    height: 4px;
    background: var(--navy-light);
    border-radius: 2px;
    margin: 1rem auto 0;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--crimson), var(--gold));
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.loader p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    letter-spacing: 8px;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.loader-wordmark {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.34em;
    color: #fff;
    margin: 0.3rem 0 0.15rem;
    padding-left: 0.34em; /* offset the trailing letter-spacing so it reads centred */
}
.loader-tagline {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    color: var(--gold, #c8a03c);
    text-transform: uppercase;
    margin: 0 0 1.1rem;
}
.loader-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ================================================
   App Shell
   ================================================ */
#app {
    height: 100%;
}

.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-top);
    overflow: hidden;
}

/* ================================================
   App Header with Logo
   ================================================ */
.app-header {
    background: var(--navy-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 62px;
}

.app-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #b8972e, #6b1122);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.65rem;
    color: var(--white);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(122, 19, 37, 0.4);
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--white);
}

.logo-tagline {
    font-size: 0.45rem;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.9;
}

.app-nav {
    display: flex;
    gap: 0.15rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-nav::-webkit-scrollbar { display: none; }

.app-nav-item {
    background: transparent;
    border: none;
    color: var(--gray-400);
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.app-nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.app-nav-item.active {
    color: var(--white);
    background: transparent;
    box-shadow: inset 0 -2px 0 #b8972e;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.profile-nav {
    padding: 0.25rem;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;
    color: var(--navy);
    font-weight: bold;
}

/* Force header avatar to be small (override any other styles) */
.app-header .profile-avatar,
.profile-nav .profile-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
}

.header-profile-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--gold);
}

.header-org-logo {
    max-width: 200px;
    max-height: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

/* ================================================
   App Footer
   ================================================ */
.app-footer {
    background: var(--navy-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 1rem 0.25rem 1rem;
    position: relative;
    text-align: center;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.app-footer-copyright {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.app-footer p {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.header-copyright {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.22);
    letter-spacing: 0.04em;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    margin-right: 0.5rem;
    line-height: 1;
}

/* Main content area */
#page-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

/* Mobile adjustments for header */
@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0.75rem;
    }

    .app-nav {
        gap: 0;
    }

    .app-nav-item {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-mark {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    /* No bottom nav is rendered (navigation is the top hamburger), so only the
       home-indicator safe area needs clearing - not a phantom 70px nav strip. */
    .app-container {
        padding-bottom: var(--safe-bottom);
    }
}

/* Show nav on larger screens, hide bottom nav */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}

/* ================================================
   Navigation - Bottom Nav (Mobile Only)
   ================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.45rem 0.25rem;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item.active {
    color: var(--crimson);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--crimson);
    border-radius: 2px;
}

.nav-label {
    font-size: 0.58rem;
    line-height: 1;
    white-space: nowrap;
}

/* ================================================
   Authentication Pages
   ================================================ */
.auth-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    padding-top: calc(1rem + var(--safe-top));
    padding-bottom: calc(1rem + var(--safe-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Back-to-marketing button on the auth pages. Top-left, safe-area aware, 44px tap target. */
.auth-back-btn {
    position: absolute;
    top: calc(0.5rem + var(--safe-top));
    left: 0.75rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.4rem 0.4rem;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--gold, #c8a03c);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}
.auth-back-btn:hover { background: none; color: var(--gold-light, #f0d77c); }
.auth-back-btn:active { transform: scale(0.97); }
.auth-back-btn svg { display: block; }

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.auth-logo {
    margin-bottom: 0.5rem;
}

.auth-logo .pioneer-mark {
    font-size: 3rem;
}

.auth-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.75rem;
    letter-spacing: 3px;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.auth-tagline {
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.85;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    flex-shrink: 0;
}

.auth-form h2 {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--gray-300);
    letter-spacing: 0.01em;
}

.form-group {
    margin-bottom: 0.4rem;
}

.form-group label {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.4rem 0.65rem;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(200, 160, 60, 0.6);
    box-shadow: 0 0 0 2px rgba(184, 151, 46, 0.15);
}

.form-group input::placeholder {
    color: var(--gray-600);
}

/* Force readable text + keep the dark field background even when the browser
   autofills credentials (Chrome/Edge otherwise paint a white box with white text). */
.form-group input,
.auth-form input {
    color: var(--white) !important;
    -webkit-text-fill-color: var(--white);
    caret-color: var(--white);
}
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #142238 inset !important;
    box-shadow: 0 0 0px 1000px #142238 inset !important;
    caret-color: #ffffff;
    transition: background-color 9999s ease-in-out 0s;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.15rem;
    color: var(--gray-500);
}

.form-hint.success {
    color: #34C759;
}

.form-hint.error {
    color: #FF3B30;
}

.checkbox-group {
    margin-bottom: 0.15rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.15rem;
    font-size: 0.365rem;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    line-height: 1.15;
    font-weight: 300;
    opacity: 0.7;
    transition: opacity 0.15s ease-in-out;
}

.checkbox-label:hover {
    opacity: 0.9;
}

.checkbox-label input[type="checkbox"] {
    width: 8px;
    height: 8px;
    margin-top: 0.05rem;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.75;
    transition: all 0.1s ease-in-out;
}

.checkbox-label input[type="checkbox"]:hover {
    opacity: 1;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: #c8a03c;
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: #b8972e;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.125rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
    color: var(--white);
    width: auto;
    box-shadow: 0 2px 8px rgba(200, 160, 60, 0.3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, #b8972e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 160, 60, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(200, 160, 60, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--gray-400);
    border: 1px solid var(--gray-600);
}

.btn-secondary:hover {
    background: var(--navy-light);
    color: var(--white);
    border-color: var(--gray-400);
}

.btn-centered {
    display: block;
    margin: 0 auto;
    width: 100%;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.auth-switch {
    text-align: center;
    margin-top: 1.75rem;
    color: var(--gray-500);
    font-size: 0.72rem;
}

.auth-switch a {
    color: var(--crimson);
    font-weight: 600;
    margin-left: 0.25rem;
}

.auth-footer {
    margin-top: auto;
    text-align: center;
    padding-top: 1rem;
    flex-shrink: 0;
}

.auth-tagline-footer {
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Auth form submit button — refined, centered, glass style */
.auth-form .btn-primary {
    width: auto;
    min-width: 200px;
    display: block;
    margin: 0.6rem auto 0;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    background: rgba(200, 160, 60, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.95rem;
    letter-spacing: 2.5px;
    box-shadow: 0 2px 12px rgba(200, 160, 60, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(200, 160, 60, 0.5);
    color: var(--white);
    transition: all 0.25s ease;
}

.auth-form .btn-primary:hover {
    background: rgba(200, 160, 60, 0.45);
    box-shadow: 0 4px 20px rgba(200, 160, 60, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(200, 160, 60, 0.8);
    transform: translateY(-2px);
}

.pioneer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--gold);
}

/* ================================================
   Organization Signup
   ================================================ */
.org-signup-form {
    max-width: 700px;
}

.org-signup-form h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.org-signup-subtitle {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group small {
    display: block;
    color: var(--gray-500);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.subdomain-input {
    display: flex;
    align-items: center;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
}

.subdomain-input:focus-within {
    border-color: rgba(200, 160, 60, 0.6);
    box-shadow: 0 0 0 2px rgba(184, 151, 46, 0.15);
}

.subdomain-input input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.subdomain-input input:focus {
    box-shadow: none;
    border: none;
}

.subdomain-suffix {
    padding: 0.55rem 0.875rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
}

.plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.plan-option {
    cursor: pointer;
}

.plan-option input[type="radio"] {
    display: none;
}

.plan-card {
    padding: 1.5rem;
    background: var(--navy-light);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.plan-option input[type="radio"]:checked + .plan-card {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
    box-shadow: 0 0 20px rgba(200, 160, 60, 0.3);
}

.plan-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.plan-features li {
    padding: 0.4rem 0;
    color: var(--gray-300);
    font-size: 0.8rem;
}

.plan-features li:before {
    content: '✓ ';
    color: var(--gold);
    font-weight: 700;
    margin-right: 0.5rem;
}

.plan-popular {
    border-color: var(--gold);
}

.plan-badge-popular {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

.trial-notice {
    text-align: center;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.org-signup-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.org-signup-divider span {
    background: var(--navy);
    padding: 0 1rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.org-signup-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

/* Native app Google button (mirrors the web GIS button; opens the system-browser flow). */
.native-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.native-google-btn:active { background: #f1f3f4; }
.native-google-btn .ngb-g { width: 18px; height: 18px; flex-shrink: 0; }

/* Tiny "Don't have an account? Register" link at the very bottom of the auth form. */
.auth-switch-small { font-size: 0.72rem; margin-top: 1.1rem; opacity: 0.75; }
.auth-switch-small a { font-size: 0.72rem; font-weight: 600; }
.auth-create-small { font-size: 0.8rem; padding: 0.5rem 1rem; margin-top: 1rem; }

/* Dedicated exercise-video modal (training programmes + sessions). */
.ex-video-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ex-video-modal { width: 100%; max-width: 640px; background: #0a1628; border-radius: 12px; padding: 1rem; position: relative; }
.ex-video-title { color: #fff; font-weight: 600; font-size: 1rem; margin: 0 2rem 0.75rem 0; text-transform: capitalize; }
.ex-video-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.ex-video-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ex-video-close { position: absolute; top: 0.5rem; right: 0.7rem; background: transparent; border: none; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; z-index: 1; }

/* ================================================
   Onboarding Wizard
   ================================================ */
/* ================================================
   Awaiting Approval
   ================================================ */

.awaiting-approval-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--navy-dark);
}

.awaiting-approval-container {
    max-width: 500px;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
}

.awaiting-approval-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.awaiting-approval-container h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.awaiting-approval-container p {
    color: var(--gray-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.awaiting-approval-message {
    color: var(--gold);
    font-style: italic;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.awaiting-approval-container .btn-primary {
    margin-top: 1rem;
}

/* ================================================
   Onboarding
   ================================================ */

.onboarding-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    display: flex;
    flex-direction: column;
    align-items: center;
}

.onboarding-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.onboarding-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.progress-step.active {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--white);
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.progress-line {
    width: 30px;
    height: 2px;
    background: var(--navy-medium);
}

.progress-line.active {
    background: var(--crimson);
}

.onboarding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wizard-step {
    display: none;
    flex-direction: column;
    flex: 1;
}

.wizard-step.active {
    display: flex;
}

.wizard-step h2 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.wizard-step > p {
    text-align: center;
    color: var(--gray-400);
    margin-bottom: 2rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-grid.single-col {
    grid-template-columns: 1fr;
}

.option-card {
    cursor: pointer;
}

.option-card input {
    display: none;
}

.option-content {
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.option-card input:checked + .option-content,
.option-card input:checked + .option-content-row {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
}

.option-content:hover {
    border-color: var(--gray-500);
}

.option-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.option-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.option-desc {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Goal options - uniform sizing */
.goal-option {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 90px;
    padding: 1rem;
}

.goal-option .option-title {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.goal-option .option-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--gray-400);
}

/* Activity options - clean style */
.activity-option {
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.option-card input:checked + .activity-option {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
}

.activity-option:hover {
    border-color: var(--gray-500);
}

.activity-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.15rem;
    color: var(--white);
}

.activity-desc {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-align: right;
}

/* Injury Selection - New UI */
.body-area-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.body-area-btn {
    padding: 0.75rem 0.5rem;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    color: var(--gray-300);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.body-area-btn:hover {
    border-color: var(--gray-500);
    color: var(--white);
}

.body-area-btn.has-selection {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
}

.selected-injuries {
    min-height: 60px;
    max-height: 180px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--navy-light);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.no-injuries {
    color: var(--gray-500);
    font-size: 0.875rem;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
}

.injury-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(200, 160, 60, 0.2);
    border: 1px solid var(--crimson);
    border-radius: 20px;
    color: var(--white);
    font-size: 0.8rem;
}

.remove-injury {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.remove-injury:hover {
    color: var(--white);
}

/* Injury Modal */
.injury-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.injury-modal.open {
    opacity: 1;
    visibility: visible;
}

.injury-modal-content {
    background: var(--navy);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: var(--transition);
}

.injury-modal.open .injury-modal-content {
    transform: translateY(0);
}

.injury-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--navy-medium);
}

.injury-modal-header h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--white);
}

/* =======================================================================
   APP-WIDE CLOSE "X" — the SINGLE, consistent close affordance for every
   modal and sub-page. This is the one source of truth: to change how close
   buttons look, edit HERE — do not add per-page close styles. Grouped +
   !important so it wins over legacy per-page rules regardless of stylesheet
   load order. (Platform: the Android APK never overlays the status bar, so
   these are always reachable; iOS panels add the safe-area inset in their
   own header padding. Conditional-display closes like .dc-right-close are
   handled in their own rule so this can't force them visible.)
   ======================================================================= */
.modal-close,
.igal-close-btn,
.igal-add-btn,
.ddp-close-btn,
.lightbox-close,
.media-modal-close,
.cdp-close,
.igal-detail-x,
.dc-chat-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: var(--gold) !important;
    font-size: 1.7rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: color 0.15s, opacity 0.15s;
}
.modal-close:hover,
.igal-close-btn:hover,
.igal-add-btn:hover,
.ddp-close-btn:hover,
.lightbox-close:hover,
.media-modal-close:hover,
.cdp-close:hover,
.igal-detail-x:hover,
.dc-chat-close:hover {
    background: transparent !important;
    color: #e6c45e !important;
    opacity: 0.85 !important;
}

.injury-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.injury-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--navy-light);
    cursor: pointer;
}

.injury-checkbox:last-child {
    border-bottom: none;
}

.injury-checkbox input {
    display: none;
}

.injury-check-box {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.injury-checkbox input:checked + .injury-check-box {
    background: var(--crimson);
    border-color: var(--crimson);
}

.injury-check-box::after {
    content: '✓';
    color: var(--white);
    font-size: 0.75rem;
    opacity: 0;
}

.injury-checkbox input:checked + .injury-check-box::after {
    opacity: 1;
}

.injury-label {
    color: var(--gray-300);
    font-size: 0.9rem;
}

.injury-checkbox:hover .injury-label {
    color: var(--white);
}

.injury-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--navy-medium);
}

.injury-modal-footer .btn {
    width: 100%;
}

/* Profile Summary Card */
.profile-summary-card {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
}

.summary-row .summary-label {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.summary-row .summary-value {
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
}

.summary-row .summary-value.highlight {
    color: var(--crimson);
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: var(--navy-medium);
    margin: 0.5rem 0;
}

/* Waiver Section */
.waiver-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--navy-light);
    border-radius: var(--radius);
    border: 1px solid var(--navy-medium);
}

.waiver-checkbox {
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    align-items: flex-start;
}

.waiver-checkbox input {
    display: none;
}

.waiver-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--gray-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: var(--transition);
}

.waiver-checkbox input:checked + .waiver-check {
    background: var(--crimson);
    border-color: var(--crimson);
}

.waiver-check::after {
    content: '✓';
    color: var(--white);
    font-size: 0.7rem;
    opacity: 0;
}

.waiver-checkbox input:checked + .waiver-check::after {
    opacity: 1;
}

.waiver-text {
    font-size: 0.7rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.option-content-row {
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.option-content-row .option-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.option-text {
    flex: 1;
    text-align: left;
}

.checkbox-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.option-card input:checked + .option-content-row .checkbox-indicator {
    background: var(--crimson);
    border-color: var(--crimson);
}

.checkbox-indicator::after {
    content: '✓';
    color: var(--white);
    font-size: 0.875rem;
    opacity: 0;
    transition: var(--transition-fast);
}

.option-card input:checked + .option-content-row .checkbox-indicator::after {
    opacity: 1;
}

.wizard-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.wizard-actions .btn {
    flex: 1;
}

/* Input Groups in Wizard */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* DOB Inputs */
.dob-inputs {
    display: grid;
    grid-template-columns: 1fr 2fr 1.2fr;
    gap: 0.75rem;
}

.dob-inputs select {
    width: 100%;
    padding: 0.875rem 0.75rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    color: var(--white);
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.dob-inputs select:focus {
    border-color: var(--crimson);
    outline: none;
}

/* Gender Options */
.gender-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.gender-option {
    cursor: pointer;
}

.gender-option input {
    display: none;
}

.gender-btn {
    display: block;
    padding: 0.875rem;
    text-align: center;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-weight: 500;
    transition: var(--transition);
}

.gender-option input:checked + .gender-btn {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
    color: var(--white);
}

.gender-btn:hover {
    border-color: var(--gray-500);
}

/* Military Background Options */
.military-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.military-option {
    cursor: pointer;
    flex: 1;
    min-width: calc(33% - 0.5rem);
}

.military-option input {
    display: none;
}

.military-btn {
    display: block;
    padding: 0.75rem 0.5rem;
    text-align: center;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.military-option input:checked + .military-btn {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
    color: var(--white);
}

.military-btn:hover {
    border-color: var(--gray-500);
}

/* Unit Toggle */
.unit-toggle-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.unit-label {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.unit-toggle {
    display: flex;
    background: var(--navy-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--navy-medium);
}

.unit-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.unit-btn.active {
    background: var(--crimson);
    color: var(--white);
}

.unit-btn:hover:not(.active) {
    background: var(--navy-medium);
}

/* Imperial Height Inputs */
.imperial-height {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.imperial-height input {
    flex: 1;
    min-width: 70px;
    text-align: center;
}

.imperial-height span {
    color: var(--gray-400);
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Legacy styles removed - using earlier app-header definitions */

.app-footer span {
    color: rgba(255, 255, 255, 0.3);
}

/* ================================================
   Dashboard - Comprehensive Layout
   ================================================ */
.dashboard-page {
    padding: 0 1.5rem 2rem 1.5rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--navy-medium);
}

.dash-greeting {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-avatar {
    width: 50px;
    height: 50px;
    background: var(--crimson);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.75rem;
    color: var(--white);
}

.dash-greeting h1 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.dash-greeting p {
    font-size: 0.85rem;
    color: var(--gray-400);
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.header-btn:hover {
    border-color: var(--crimson);
}

.header-btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--crimson);
    border-radius: 50%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
}

.header-btn-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.dash-content {
    padding: 2rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

.dash-main,
.dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dash-card {
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--navy-medium);
}

.dash-card h2,
.dash-card h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--white);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.dash-card h2 {
    font-size: 1.25rem;
}

.dash-card h3 {
    font-size: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-date {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Calorie Ring */
.calorie-summary {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.calorie-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.calorie-ring svg {
    width: 100%;
    height: 100%;
}

.calorie-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cal-consumed {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.75rem;
    color: var(--white);
}

.calorie-details {
    flex: 1;
}

.cal-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--navy-medium);
}

.cal-row:last-child {
    border-bottom: none;
}

.cal-row .cal-label {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.cal-row .cal-value {
    color: var(--white);
    font-weight: 500;
}

.cal-row.remaining .cal-value {
    color: var(--success);
}

/* Macro Bars */
.macro-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.macro-bar .macro-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.macro-bar .macro-label span:last-child {
    color: var(--white);
    font-weight: 500;
}

.macro-progress {
    height: 12px;
    background: var(--navy-medium);
    border-radius: 6px;
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.macro-fill.protein { background: var(--crimson); }
.macro-fill.carbs { background: var(--gold); }
.macro-fill.fat { background: var(--success); }

.card-action-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--crimson);
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.card-action-btn:hover {
    background: var(--crimson-dark);
}

/* Stats Grid */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--navy-dark);
    border-radius: var(--radius);
}

.stat-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Quick Actions */
.quick-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--navy-dark);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    border-color: var(--crimson);
}

.qa-icon {
    width: 32px;
    height: 32px;
    background: var(--crimson);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--white);
    font-size: 0.9rem;
}

.qa-text {
    flex: 1;
    color: var(--white);
    font-size: 0.85rem;
    text-align: left;
}

.qa-value {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* Week Summary */
.week-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.week-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--navy-medium);
}

.week-item:last-child {
    border-bottom: none;
}

.week-label {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.week-value {
    color: var(--white);
    font-weight: 500;
}

/* Main Calorie Card */
.dash-main-card {
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.dash-calories {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cal-circle {
    width: 100px;
    height: 100px;
    position: relative;
    flex-shrink: 0;
}

.cal-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cal-circle .cal-bg {
    fill: none;
    stroke: var(--navy-medium);
    stroke-width: 8;
}

.cal-circle .cal-progress {
    fill: none;
    stroke: var(--crimson);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.cal-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cal-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
    line-height: 1;
}

.cal-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.cal-stats {
    flex: 1;
}

.cal-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--navy-medium);
}

.cal-stat:last-child {
    border-bottom: none;
}

.cal-stat-label {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.cal-stat-value {
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Macros */
.dash-macros {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.macro-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
}

.macro-bar {
    height: 6px;
    background: var(--navy-medium);
    border-radius: 3px;
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.macro-fill.protein { background: #3b82f6; }
.macro-fill.carbs { background: #f59e0b; }
.macro-fill.fat { background: #ef4444; }

.macro-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    min-width: 50px;
}

.macro-value {
    font-size: 0.85rem;
    color: var(--white);
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* Action Buttons */
.dash-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dash-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.dash-action:hover {
    border-color: var(--crimson);
}

.dash-action-title {
    color: var(--white);
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.dash-action-sub {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.dash-action-arrow {
    color: var(--gray-500);
    font-size: 1.25rem;
    font-weight: 300;
}

/* Stats Row */
.dash-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.dash-stat-box {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.dash-stat-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--white);
    display: block;
}

.dash-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Dashboard Header Actions */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.header-btn:hover {
    border-color: var(--crimson);
}

.header-btn-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--white);
}

.header-btn-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================================================
   Modern Dashboard - Hero Section
   ================================================ */
.hero-section {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--navy-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-content {
    flex: 1;
    min-width: 200px;
}

.hero-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.hero-subtitle strong {
    color: var(--gold);
}

.hero-stats {
    display: flex;
    gap: 1rem;
}

.hero-stat {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--navy-medium);
}

.hero-stat-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--crimson);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   Modern Dashboard - Feature Cards
   ================================================ */
.features-section {
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .feature-cards {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--navy-medium);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-card:hover {
    border-color: var(--crimson);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.nutrition-card .feature-icon {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.training-card .feature-icon {
    background: rgba(200, 160, 60, 0.15);
    color: var(--crimson);
}

.rehab-card .feature-icon {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.diary-card .feature-icon {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.75rem;
    color: var(--gray-400);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feature-stats {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.feature-stats .has-injury {
    color: var(--warning);
}

.feature-action {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--crimson);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: auto;
}

.feature-action svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.feature-card:hover .feature-action svg {
    transform: translateX(4px);
}

/* ================================================
   Modern Dashboard - Summary Section
   ================================================ */
.summary-section {
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--navy-medium);
}

.summary-card h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

/* Calorie Display */
.calorie-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.calorie-info {
    flex: 1;
}

.calorie-info .cal-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--navy-medium);
}

.calorie-info .cal-row:last-child {
    border-bottom: none;
}

.calorie-info .cal-row span {
    color: var(--gray-400);
}

.calorie-info .cal-row strong {
    color: var(--white);
    font-size: 1.1rem;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-btn {
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--white);
}

.quick-btn:hover {
    background: var(--navy-medium);
    border-color: var(--crimson);
}

.quick-btn svg {
    width: 24px;
    height: 24px;
    color: var(--crimson);
}

.quick-btn span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weekly Stats */
.weekly-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.weekly-stat {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.weekly-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.weekly-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive hero */
@media (max-width: 768px) {
    .hero-section {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-stats {
        width: 100%;
        justify-content: center;
    }

    .hero-stat {
        padding: 0.5rem 0.75rem;
    }

    .hero-stat-value {
        font-size: 1.1rem;
    }

    .dashboard-page {
        padding: 0 1rem 2rem 1rem;
    }
}

/* ================================================
   Track Page (Calendar)
   ================================================ */
.track-page {
    padding-bottom: calc(80px + var(--safe-bottom));
    width: 100%;
}

.track-header {
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    text-align: center;
}

.track-header h1 {
    font-size: 1.75rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.track-header p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.track-content {
    padding: 0 1.5rem;
}

/* Week Calendar */
.week-calendar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.week-nav {
    width: 32px;
    height: 32px;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.week-nav:hover {
    border-color: var(--crimson);
    color: var(--white);
}

.week-days {
    display: flex;
    flex: 1;
    gap: 0.25rem;
}

.day-btn {
    flex: 1;
    padding: 0.5rem 0.25rem;
    background: var(--navy-light);
    border: 2px solid var(--navy-medium);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.day-btn:hover {
    border-color: var(--gray-500);
}

.day-btn.active {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
}

.day-btn.today .day-num {
    color: var(--crimson);
}

.day-name {
    display: block;
    font-size: 0.6rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.day-num {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem;
    color: var(--white);
}

.track-date-label {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* Track Categories */
.track-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.track-cat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.track-cat:hover {
    border-color: var(--crimson);
}

.track-cat-title {
    color: var(--white);
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.track-cat-value {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.track-cat-add {
    width: 28px;
    height: 28px;
    background: var(--crimson);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 300;
}

/* Keep old styles for compatibility */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--white);
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.activity-info {
    flex: 1;
}

.activity-info strong {
    display: block;
    color: var(--white);
    font-size: 0.9rem;
    margin-bottom: 0.125rem;
}

.activity-info span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.activity-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    color: var(--gold);
}

/* ================================================
   Workout Page
   ================================================ */
.page-header {
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header-title {
    text-align: left;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

.page-header-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.page-header-btn:hover {
    background: var(--navy-medium);
    color: var(--white);
}

.page-header-btn.ai-suggest-btn {
    background: linear-gradient(135deg, var(--crimson) 0%, #b8972e 100%);
    border-color: transparent;
    color: var(--white);
}

.page-header-btn.ai-suggest-btn:hover {
    transform: scale(1.05);
}

.page-header-btn svg {
    width: 18px;
    height: 18px;
}

/* Preferences Modal */
.prefs-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.prefs-section {
    margin-bottom: 1.5rem;
}

.prefs-section h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--white);
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.prefs-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.prefs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prefs-chip {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    color: var(--gray-400);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.prefs-chip:hover {
    border-color: var(--gray-500);
    color: var(--white);
}

.prefs-chip.selected {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--white);
}

.prefs-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    color: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.prefs-select:focus {
    outline: none;
    border-color: var(--crimson);
}

.prefs-select option {
    background: var(--navy-light);
    color: var(--white);
}

.workout-page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.workout-content {
    padding: 1.5rem;
    padding-bottom: calc(80px + var(--safe-bottom));
}

.workout-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    padding: 0.625rem 1.25rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-full);
    color: var(--gray-400);
    font-size: 0.8rem;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.category-btn.active,
.category-btn:hover {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--white);
}

.workout-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.workout-card {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
    cursor: pointer;
}

.workout-card:hover {
    border-color: var(--crimson);
}

.workout-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.workout-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background: var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.workout-card-info h3 {
    font-size: 1.125rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.workout-card-info p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.workout-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-tag {
    padding: 0.375rem 0.75rem;
    background: var(--navy-medium);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    color: var(--gray-400);
}

.meta-tag.difficulty {
    background: rgba(200, 160, 60, 0.2);
    color: var(--crimson);
}

/* ================================================
   Nutrition Page
   ================================================ */
.nutrition-content {
    padding: 1.5rem;
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* Calorie Ring */
.calorie-summary {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.calorie-ring {
    width: 100px;
    height: 100px;
    position: relative;
}

.calorie-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.calorie-ring circle {
    fill: none;
    stroke-width: 8;
}

.calorie-ring .bg {
    stroke: var(--navy-medium);
}

.calorie-ring .progress {
    stroke: var(--crimson);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.calorie-ring .ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
}

.ring-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.calorie-details {
    flex: 1;
}

.calorie-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--navy-medium);
}

.calorie-row:last-child {
    border-bottom: none;
}

.calorie-row span:first-child {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.calorie-row span:last-child {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    color: var(--white);
}

/* Macro Cards */
.macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.macro-card {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.macro-card.protein { border-top: 3px solid #ef4444; }
.macro-card.carbs { border-top: 3px solid #3b82f6; }
.macro-card.fat { border-top: 3px solid #f59e0b; }

.macro-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
}

.macro-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.macro-target {
    font-size: 0.7rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Meal Timeline */
.meal-section {
    margin-bottom: 2rem;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.meal-header h3 {
    font-size: 1rem;
    color: var(--white);
}

.add-food-btn {
    padding: 0.5rem 1rem;
    background: var(--crimson);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.add-food-btn:hover {
    background: var(--crimson-dark);
}

.meal-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meal-item {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meal-item-icon {
    font-size: 1.5rem;
}

.meal-item-info {
    flex: 1;
}

.meal-item-info strong {
    display: block;
    color: var(--white);
    font-size: 0.9rem;
}

.meal-item-info span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.meal-item-calories {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--crimson);
}

.meal-item-delete {
    color: var(--gray-600);
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.meal-item-delete:hover {
    color: var(--danger);
}

.empty-meal {
    background: var(--navy-light);
    border: 2px dashed var(--navy-medium);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.empty-meal:hover {
    border-color: var(--crimson);
    color: var(--gray-300);
}

/* ================================================
   Food Search Modal
   ================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--white);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--crimson);
    color: var(--white);
}

.modal-body {
    padding: 1.25rem;
    max-height: calc(90vh - 150px);
    overflow-y: auto;
}

/* Edit Profile Modal - ensure button is always visible */
#edit-profile-modal .modal-body {
    padding-bottom: 2rem;
}

#edit-profile-modal form button[type="submit"] {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ── Context Menu (Right-click menu) ────────────────────────────── */
.chip-context-menu {
    position: absolute;
    background: rgba(30, 30, 45, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.context-menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.context-menu-item:hover svg {
    opacity: 1;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem;
    padding-left: 3rem;
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--crimson);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 1.25rem;
}

.food-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.food-category-btn {
    padding: 0.5rem 1rem;
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-full);
    color: var(--gray-400);
    font-size: 0.75rem;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.food-category-btn.active {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--white);
}

.food-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.food-result-item {
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.food-result-item:hover {
    border-color: var(--crimson);
    background: rgba(200, 160, 60, 0.1);
}

.food-emoji {
    font-size: 1.5rem;
}

.food-details {
    flex: 1;
}

.food-details strong {
    display: block;
    color: var(--white);
    font-size: 0.9rem;
    margin-bottom: 0.125rem;
}

.food-details span {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.food-cals {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--crimson);
}

.food-cals span {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Serving Size Selector */
.serving-selector {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.selected-food {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--navy-medium);
}

.selected-food .food-emoji {
    font-size: 2rem;
}

.selected-food .food-name {
    flex: 1;
}

.selected-food .food-name strong {
    display: block;
    color: var(--white);
    font-size: 1rem;
}

.selected-food .food-name span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.serving-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.serving-row label {
    color: var(--gray-400);
    font-size: 0.875rem;
    min-width: 80px;
}

.serving-input {
    flex: 1;
    display: flex;
    align-items: center;
}

.serving-input input {
    width: 80px;
    padding: 0.75rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    color: var(--white);
    text-align: center;
    font-size: 1rem;
}

.serving-unit {
    padding: 0.75rem 1rem;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.serving-input input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.nutrition-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.nutrition-preview div {
    background: var(--navy-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.nutrition-preview strong {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    color: var(--white);
}

.nutrition-preview span {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* ================================================
   Rehab Page
   ================================================ */
.rehab-content {
    padding: 1.5rem;
    padding-bottom: calc(80px + var(--safe-bottom));
}

.body-map {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.body-map h3 {
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 1rem;
    text-align: center;
}

.body-regions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.body-region {
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.body-region:hover {
    border-color: var(--crimson);
}

.body-region.active {
    background: rgba(200, 160, 60, 0.2);
    border-color: var(--crimson);
}

.body-region.has-injury {
    border-color: var(--warning);
    background: rgba(243, 156, 18, 0.1);
}

.region-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.region-name {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.injury-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.injury-card {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem;
}

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

.injury-header h3 {
    font-size: 1rem;
    color: var(--white);
}

.injury-severity {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.injury-severity.mild {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

.injury-severity.moderate {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning);
}

.injury-severity.severe {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

.injury-info {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.injury-progress {
    margin-bottom: 1rem;
}

.injury-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.injury-progress-bar {
    height: 6px;
    background: var(--navy-medium);
    border-radius: 3px;
    overflow: hidden;
}

.injury-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--crimson), var(--success));
    border-radius: 3px;
    transition: width 0.5s ease;
}

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

.injury-actions .btn {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

/* ================================================
   Profile Page
   ================================================ */
.profile-page {
    padding-bottom: calc(80px + var(--safe-bottom));
    width: 100%;
}

.profile-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .profile-content {
        padding: 0 0.75rem 1.5rem 0.75rem;
    }
}

/* Profile Header Card */
.profile-header-card {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem 0 2rem 0;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .profile-header-card {
        padding: 1rem 0 1.5rem 0;
        margin-bottom: 1rem;
    }
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .profile-avatar-section {
        gap: 1rem;
    }
    .profile-info h2 {
        font-size: 1.25rem;
    }
    .profile-info p {
        font-size: 0.85rem;
    }
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(184, 151, 46,0.3), rgba(184, 151, 46,0.2));
    border: 2px solid rgba(184, 151, 46,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar.has-image {
    background: none;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .avatar-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.75rem;
    color: var(--white);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--crimson);
    border: 2px solid var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.avatar-edit-btn:hover {
    background: var(--crimson-light);
    transform: scale(1.1);
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    margin-bottom: 0.25rem;
}

.profile-info p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}

/* Profile: bigger user photo + a compact density pass across the whole page. Scoped to
   .profile-page so it wins the cascade over the base/mobile rules. */
.profile-page .profile-avatar,
.profile-page #change-avatar-btn { width: 112px !important; height: 112px !important; border-width: 2.5px !important; }
.profile-page .profile-avatar .avatar-text { font-size: 2.4rem; }
.profile-page .profile-info h2 { font-size: 1.3rem; margin-bottom: 0.1rem; }
.profile-page .profile-header-card { padding: 0.85rem 0 1rem; margin-bottom: 0.85rem; }
.profile-page .profile-stats-grid { gap: 0.55rem; margin-bottom: 0.9rem; }
.profile-page .stat-card { padding: 0.7rem 0.85rem !important; min-height: auto !important; }
.profile-page .settings-section { margin-bottom: 0.9rem; }
.profile-page .settings-section h3 { margin-bottom: 0.45rem; font-size: 0.78rem; }
.profile-page .section-desc { margin: 0 0 0.5rem; font-size: 0.78rem; line-height: 1.35; }
.profile-page .settings-item { padding: 0.7rem 0.85rem; }
.settings-tile { width: 100%; text-align: left; background: transparent; border: none; color: inherit; }
.settings-item-sub { display: block; font-size: 0.76rem; color: rgba(255,255,255,0.45); margin-top: 2px; }
.settings-tile-chev { color: var(--gold, #c8a03c); font-size: 1.3rem; line-height: 1; }

/* Stats Grid - Modern Card Layout */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 480px) {
    .stat-card {
        padding: 0.9rem;
        min-height: auto;
    }
    .stat-label {
        font-size: 0.72rem;
        margin-bottom: 0.35rem;
    }
    .stat-value {
        font-size: 1.5rem;
    }
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.1);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    line-height: 1.2;
}

.stat-value.stat-text {
    font-size: 1rem;
    font-weight: 500;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

.stat-unit {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    margin-left: 0.25rem;
}

.profile-stat.clickable {
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-stat.clickable:hover {
    background: var(--navy-medium);
}

.profile-stat-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
}

.profile-stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.profile-stat-edit {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    opacity: 0.5;
}

.profile-stat.clickable:hover .profile-stat-edit {
    opacity: 1;
}

/* Connected Apps */
.section-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.connected-apps-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loading-apps {
    text-align: center;
    color: var(--gray-500);
    padding: 1rem;
}

.connected-app-item {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    transition: all 0.2s ease;
}

.connected-app-item:hover {
    border-color: rgba(255,255,255,0.1);
}

.connected-app-item.connected {
    border-left: 2px solid rgba(52,199,89,0.5);
}

.app-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-icon {
    font-size: 1.5rem;
}

.app-details {
    display: flex;
    flex-direction: column;
}

.app-details strong {
    color: var(--white);
    font-size: 0.9rem;
}

.app-status {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.app-actions {
    display: flex;
    gap: 0.9rem;
    flex-shrink: 0;
    align-items: center;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

/* Profile Page Responsive */
@media (max-width: 768px) {
    .profile-header-card {
        padding: 1.5rem;
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    /* Keep the stat cards 2-up even on narrow phones; 1-per-row left a long, sparse column. */
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Weight History Modal */
.weight-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    gap: 0.5rem;
}

.weight-bar {
    flex: 1;
    max-width: 40px;
    background: linear-gradient(to top, var(--crimson), var(--crimson-light));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
    transition: var(--transition-fast);
}

.weight-bar:hover {
    background: linear-gradient(to top, var(--gold), var(--gold-light));
}

.weight-bar-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    color: var(--white);
}

.weight-bar-date {
    font-size: 0.6rem;
    color: var(--white);
    opacity: 0.8;
    position: absolute;
    bottom: -20px;
    white-space: nowrap;
}

.weight-list {
    max-height: 200px;
    overflow-y: auto;
}

.weight-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--navy-medium);
}

.weight-list-item:last-child {
    border-bottom: none;
}

.weight-date {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.weight-value {
    color: var(--white);
    font-weight: 600;
}

.error-text {
    color: var(--danger);
    text-align: center;
    padding: 1rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 0.875rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.settings-list {
    background: var(--navy-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--navy-medium);
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover:not(.settings-toggle-item) {
    background: var(--navy);
}

.settings-toggle-item {
    cursor: default;
}

.settings-toggle-item:hover {
    background: transparent;
}

.settings-item-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
/* Profile: smaller stat values (Weight/Height/Streak/Goal were oversized). */
.profile-stats-grid .stat-value { font-size: 1.15rem !important; }
.profile-stats-grid .stat-value.stat-text { font-size: 0.92rem !important; line-height: 1.2; }
.profile-stats-grid .stat-unit { font-size: 0.68rem !important; }
/* Connected apps: Connect = clean gold text, not a filled button. */
/* Connected-apps actions: flat, small, thin text — no bubbles. Connect/Sync = gold, Disconnect = red.
   (Flat text also stops the Sync/Disconnect buttons overlapping in the tight row.) */
.connect-app-btn, .connect-app-btn.btn-primary, .connect-app-btn.btn-small,
.sync-app-btn, .sync-app-btn.btn-secondary, .sync-app-btn.btn-small,
.disconnect-app-btn, .disconnect-app-btn.btn-danger, .disconnect-app-btn.btn-small {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
    padding: 0.25rem 0.3rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}
.connect-app-btn, .sync-app-btn { color: var(--gold, #c8a03c) !important; }
.disconnect-app-btn { color: var(--pi-red, #e2243f) !important; }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--red, #b8972e);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.settings-item-icon {
    font-size: 1.25rem;
}

.settings-item-text {
    color: var(--white);
    font-size: 0.9rem;
}

.settings-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.settings-item-right .chevron {
    font-size: 1rem;
}

.logout-btn {
    width: 100%;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: var(--white);
}

/* ================================================
   Toast Notifications
   ================================================ */
.toast-container {
    position: fixed;
    top: calc(var(--safe-top) + 64px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: calc(100% - 2rem);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
    pointer-events: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    background: var(--danger);
    border: none;
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    color: var(--white);
    font-size: 0.875rem;
}

.toast-close {
    color: var(--gray-500);
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
}

/* ================================================
   Install Prompt
   ================================================ */
.install-prompt {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: 1rem;
    right: 1rem;
    z-index: 1500;
}

.install-prompt.hidden {
    display: none;
}

.install-content {
    background: var(--navy-light);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.install-icon {
    font-size: 2rem;
}

.install-text {
    flex: 1;
}

.install-text strong {
    display: block;
    color: var(--white);
    font-size: 0.9rem;
}

.install-text span {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.install-btn {
    padding: 0.625rem 1.25rem;
    background: var(--gold);
    border-radius: var(--radius-sm);
    color: var(--navy);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.install-dismiss {
    color: var(--gray-500);
    font-size: 1.5rem;
    padding: 0.25rem;
}

/* ================================================
   Empty States
   ================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* ================================================
   Weight Log Modal
   ================================================ */
.weight-chart {
    background: var(--navy);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weight-chart-placeholder {
    text-align: center;
    color: var(--gray-500);
}

.weight-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.weight-form input {
    flex: 1;
    padding: 1rem;
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 1.25rem;
    text-align: center;
}

.weight-history {
    max-height: 200px;
    overflow-y: auto;
}

.weight-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--navy);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.weight-entry-date {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.weight-entry-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    color: var(--white);
}

.weight-entry-change {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

.weight-entry-change.up {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

.weight-entry-change.down {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

/* ================================================
   Utilities
   ================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-crimson {
    color: var(--crimson);
}

.text-gold {
    color: var(--gold);
}

.text-success {
    color: var(--success);
}

.text-muted {
    color: var(--gray-500);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-auto { margin-top: auto; }

.w-full { width: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ================================================
   Scrollbar Styling
   ================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--navy);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* ================================================
   Desktop/Tablet Enhancements
   ================================================ */
@media (min-width: 768px) {
    .app-container {
        max-width: 100%;
    }

    .modal-content {
        border-radius: var(--radius-lg);
        max-height: 80vh;
        margin: auto;
    }

    .modal-overlay {
        align-items: center;
        padding: 2rem;
    }

    .quick-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .body-regions {
        grid-template-columns: repeat(4, 1fr);
    }

    .bottom-nav {
        display: none;
    }

    /* Show top nav on desktop */
    .top-nav {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 100%;
    }

    .app-header {
        padding: 0.75rem 2.5rem;
    }

    #page-content {
        padding: 1.5rem 2.5rem;
    }

    .action-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ================================================
   Print Styles
   ================================================ */
@media print {
    .bottom-nav,
    .modal-overlay,
    .toast-container,
    .install-prompt {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ================================================
   Reduced Motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   23 Pioneer Regiment Nods
   ================================================ */
.pioneer-crest {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.pioneer-crest span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--white);
}

.regiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
}

.ubique-motto {
    font-style: italic;
    color: var(--gold);
    font-size: 0.875rem;
    letter-spacing: 2px;
}

/* ================================================
   Dashboard Pillar Cards
   ================================================ */
.pillar-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pillar-card {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pillar-card:hover {
    border-color: var(--crimson);
    transform: translateY(-2px);
}

.pillar-card.rehab {
    border-left: 3px solid var(--success);
}

.pillar-card.training {
    border-left: 3px solid var(--crimson);
}

.pillar-card.nutrition {
    border-left: 3px solid var(--gold);
}

.pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pillar-header h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--white);
    letter-spacing: 1px;
}

.pillar-badge {
    background: var(--crimson);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
}

.pillar-desc {
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 1.4;
}

.pillar-stats {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.pillar-action {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crimson);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.pillar-card.rehab .pillar-action { color: var(--success); }
.pillar-card.nutrition .pillar-action { color: var(--gold); }

/* Overview Section */
.overview-section {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.overview-section h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--gray-400);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.overview-stats {
    display: flex;
    justify-content: space-between;
}

.overview-stat {
    text-align: center;
    flex: 1;
}

.overview-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
}

.overview-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.quick-btn {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.quick-btn:hover {
    border-color: var(--crimson);
}

.quick-btn span:first-child {
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
}

.quick-val {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ================================================
   Consistent Page Containers
   ================================================ */
.nutrition-page,
.rehab-page {
    padding-bottom: calc(80px + var(--safe-bottom));
    width: 100%;
}

.nutrition-page .page-header,
.rehab-page .page-header {
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
}

.nutrition-content,
.rehab-content {
    padding: 0 1.5rem;
}

/* ================================================
   Compact Dashboard - New Layout
   ================================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--navy-light);
    border-bottom: 1px solid var(--navy-medium);
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-greeting h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--white);
    margin: 0;
    letter-spacing: 1px;
}

.goal-badge {
    display: inline-block;
    background: var(--crimson);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.header-stat {
    text-align: center;
}

.header-stat .stat-val {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: var(--crimson);
    line-height: 1;
}

.header-stat .stat-lbl {
    font-size: 0.65rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Access Tiles */
.quick-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.5rem;
}

.quick-tile {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.quick-tile:hover {
    border-color: var(--crimson);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-icon svg {
    width: 20px;
    height: 20px;
}

.nutrition-tile .tile-icon { background: rgba(40, 167, 69, 0.15); color: var(--success); }
.training-tile .tile-icon { background: rgba(200, 160, 60, 0.15); color: var(--crimson); }
.rehab-tile .tile-icon { background: rgba(23, 162, 184, 0.15); color: var(--info); }
.community-tile .tile-icon { background: rgba(212, 175, 55, 0.15); color: var(--gold); }

.tile-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--white);
    letter-spacing: 0.5px;
}

.tile-stat {
    font-size: 0.7rem;
    color: var(--gray-400);
}

@media (max-width: 768px) {
    .quick-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .quick-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }
    .quick-tile {
        padding: 0.75rem;
    }
}

/* Monthly Calendar Section */
.calendar-section {
    padding: 1rem 1.5rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.calendar-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    color: var(--white);
    margin: 0;
    letter-spacing: 1px;
    flex: 1;
    text-align: center;
}

.cal-nav-btn {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
}

.cal-nav-btn:hover {
    background: var(--navy-medium);
    color: var(--white);
}

.cal-today-btn {
    background: var(--crimson);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.cal-today-btn:hover {
    background: var(--crimson-dark);
}

.calendar-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--gray-400);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.nutrition { background: #2ea043; }
.legend-dot.training { background: #b8972e; }
.legend-dot.rehab { background: #d28700; }
.legend-dot.community { background: #3882dc; }
.legend-dot.events { background: #3882dc; }
.legend-dot.water { background: #19c3e6; }
.legend-dot.photo { background: #9b6dff; }
.legend-dot.note { background: #9b6dff; }
.legend-dot.weight { background: #f5a800; }

.monthly-calendar {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--navy-medium);
}

.cal-weekday {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day {
    aspect-ratio: 1;
    min-height: 50px;
    padding: 0.25rem;
    border: 1px solid var(--navy-medium);
    border-top: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    touch-action: manipulation;
    transition: var(--transition);
}

.cal-day:hover:not(.other-month) {
    background: var(--navy-medium);
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day.other-month {
    opacity: 0.3;
    cursor: default;
}

.cal-day.today {
    background: rgba(200, 160, 60, 0.15);
}

.cal-day.today .day-num {
    background: var(--crimson);
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-num {
    font-size: 0.8rem;
    color: var(--white);
    font-weight: 500;
}

.day-dots {
    display: flex;
    gap: 2px;
    margin-top: auto;
    flex-wrap: wrap;
    justify-content: center;
}

.day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.day-dot.nutrition { background: var(--success); }
.day-dot.training { background: var(--crimson); }
.day-dot.rehab { background: var(--info); }
.day-dot.community { background: var(--gold); }

@media (max-width: 600px) {
    .cal-day {
        min-height: 40px;
    }
    .day-num {
        font-size: 0.7rem;
    }
    .cal-weekday {
        font-size: 0.6rem;
        padding: 0.35rem;
    }
    .day-dot {
        width: 4px;
        height: 4px;
    }
}

/* Compact Daily Summary */
.daily-summary {
    padding: 0 1.5rem 1.5rem;
}

.summary-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 1rem;
}

.mini-card {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mini-ring {
    width: 40px;
    height: 40px;
    position: relative;
    flex-shrink: 0;
}

.mini-ring svg {
    width: 100%;
    height: 100%;
}

.mini-ring-val {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--white);
}

.mini-info .mini-title {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-info .mini-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--white);
    font-weight: 500;
}

.macros-mini {
    flex: 1;
}

.macro-mini-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.macro-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.macro-mini-lbl {
    width: 14px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gray-400);
}

.macro-mini-bar {
    flex: 1;
    height: 6px;
    background: var(--navy-medium);
    border-radius: 3px;
    overflow: hidden;
}

.macro-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.macro-mini-fill.protein { background: var(--success); }
.macro-mini-fill.carbs { background: var(--warning); }
.macro-mini-fill.fat { background: var(--info); }

.actions-mini {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--navy-medium);
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--navy-medium);
    color: var(--crimson);
    border-color: var(--crimson);
}

@media (max-width: 768px) {
    .summary-row {
        grid-template-columns: 1fr 1fr;
    }
    .actions-mini {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .summary-row {
        grid-template-columns: 1fr;
    }
    .daily-summary {
        padding: 0 0.75rem 1rem;
    }
}

/* Day Log Modal - Clean Design */
.day-log {
    width: 340px;
    max-width: 90vw;
    max-height: 65vh;
    background: var(--navy-dark);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
}

.log-date {
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
}

.log-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}

.log-close:hover {
    color: var(--white);
}

.log-actions {
    display: flex;
    gap: 6px;
    padding: 0 1rem 1rem;
}

.log-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--navy-light);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s;
}

.log-btn:hover {
    color: var(--white);
    border-color: var(--navy-medium);
}

.log-btn.active {
    background: var(--navy-medium);
    color: var(--white);
    border-color: var(--crimson);
}

.log-btn svg {
    opacity: 0.7;
}

.log-btn span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.water-btn:hover svg {
    color: #5dade2;
}

/* Log Form */
.log-form:empty {
    display: none;
}

.log-input-group {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-input-group input,
.log-input-group select,
.log-input-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.9rem;
}

.log-input-group input::placeholder,
.log-input-group textarea::placeholder {
    color: var(--gray-500);
}

.log-input-group input:focus,
.log-input-group select:focus,
.log-input-group textarea:focus {
    outline: none;
    border-color: var(--gray-400);
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row > * {
    flex: 1;
}

.log-save {
    padding: 10px;
    background: var(--crimson);
    border: none;
    border-radius: 6px;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.log-save:hover {
    background: #b8972e;
}

/* Log Feed */
.log-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    min-height: 80px;
}

.feed-empty {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 1.5rem 0;
    margin: 0;
}

.feed-loading {
    height: 40px;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-500);
    margin-top: 6px;
    flex-shrink: 0;
}

.feed-item.food .feed-dot { background: #27ae60; }
.feed-item.activity .feed-dot { background: var(--crimson); }
.feed-item.water .feed-dot { background: #5dade2; }
.feed-item.note .feed-dot { background: var(--gold); }

.feed-text {
    flex: 1;
    min-width: 0;
}

.feed-main {
    display: block;
    font-size: 0.85rem;
    color: var(--white);
    line-height: 1.3;
}

.feed-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ================================================
   Community Page
   ================================================ */
.community-page {
    padding: 0 1.5rem 2rem 1.5rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.community-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .community-layout {
        grid-template-columns: 1fr;
    }
    .community-sidebar {
        order: -1;
    }
}

.community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.community-header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    letter-spacing: 2px;
}

/* Challenges Section */
.challenges-section {
    margin-bottom: 2rem;
}

.challenges-section h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--gold);
}

.challenges-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.challenge-card {
    min-width: 280px;
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--navy-medium);
    transition: var(--transition);
}

.challenge-card:hover {
    border-color: var(--gold);
}

.challenge-card.joined {
    border-color: var(--success);
}

.challenge-reward {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.challenge-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.challenge-card p {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.challenge-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Posts Feed */
.posts-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--navy-medium);
    cursor: context-menu;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: var(--white);
    object-fit: cover;
}

.post-user-info {
    display: flex;
    flex-direction: column;
}

.post-username {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.post-content {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    gap: 1.5rem;
    border-top: 1px solid var(--navy-medium);
    padding-top: 1rem;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.post-action:hover {
    color: var(--white);
}

.post-action.liked {
    color: var(--crimson);
}

/* Selected calendar day highlight — fills the whole square cleanly. Uses an INSET
   box-shadow as the border (stays inside the cell, no bleed into neighbours) instead
   of an outline/border-radius which sat outside the grid lines. */
.gc-cal .cal-day.cal-day-selected {
    background: rgba(184, 151, 46, 0.14);
    border-radius: 0;
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(200, 160, 60, 0.55);
}

/* ── Compact chat-row post format (.pc) ─────────────────────────────── */
.post-card.pc {
    padding: 3px 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.post-card.pc + .post-card.pc { border-top: 1px solid rgba(255,255,255,0.04); }
.post-card.pc .pc-media-reactions-row:empty { display: none; }
.post-card.pc:hover {
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}
.pc-left {
    flex-shrink: 0;
    padding-top: 1px;
}
.pc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    color: var(--white);
    object-fit: cover;
    flex-shrink: 0;
}
.pc-body {
    flex: 1;
    min-width: 0;
}
.pc-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1;
    margin-bottom: 2px;
}
/* Groups name+time so they stay inline even when .pc-header is dissolved
   (display:contents) on mobile to move the actions below the media. Desktop: this is
   a single flex item in the header, identical to the old inline name+time. */
.pc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.pc-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}
.pc-time {
    font-size: 0.68rem;
    color: var(--gray-500);
    white-space: nowrap;
}
/* Military rank tag in the feed (Veteran / Serving / Reservist). Was unstyled, so it
   rendered at the default 1rem — bigger than the name + the sidebar. Small gold chip. */
.pc-mil-tag {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-button, #c8a03c);
    background: rgba(200,160,60,0.12);
    border: 1px solid rgba(200,160,60,0.3);
    border-radius: 4px;
    padding: 0.04rem 0.34rem;
    line-height: 1.5;
    white-space: nowrap;
}
/* Visible "More" button — opens the post menu (report / block / reply / delete).
   Apple 1.2 needs report+block discoverable, not hidden behind long-press. */
.pc-more-btn {
    margin-left: 4px;
    padding: 1px 4px;
    font-size: 0.54rem;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.25;
    white-space: nowrap;
}
.pc-more-btn:hover,
.pc-more-btn:focus-visible {
    color: var(--brand-primary, #c8a03c);
    border-color: var(--brand-primary, #c8a03c);
}
.pc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.pc-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s;
}
.pc-action:hover { color: var(--white); }

/* Like (heart) prominence — applies to the feed post card AND the photo-detail
   media modal, since openMediaModal relocates this same .like-btn into it. */
.like-btn { gap: 5px; padding: 3px 6px; }
.like-btn svg {
    width: 17px !important;
    height: 17px !important;
    transition: transform 0.18s ease, fill 0.15s ease, stroke 0.15s ease;
}
.like-btn span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-300);
    min-width: 10px;
    text-align: left;
}
.like-btn:hover { color: #ff5277; }
.like-btn:hover svg { transform: scale(1.12); }
.like-btn:hover span { color: var(--white); }
.pc-action.liked,
.like-btn.liked { color: #e0245e; }
.like-btn.liked span { color: #e0245e; }
.like-btn.liked svg {
    fill: #e0245e !important;
    stroke: #e0245e;
    animation: likePop 0.32s ease;
}
/* Kudos (praise/medal) — distinct from Like. Always visible. */
.kudos-btn {
    gap: 5px;
    padding: 3px 6px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.15s, transform 0.1s;
}
.kudos-btn svg {
    width: 16px !important;
    height: 16px !important;
}
.kudos-btn:hover {
    color: var(--gold, #c8a03c);
    transform: scale(1.08);
}
.kudos-btn.kudos-on {
    color: var(--gold, #c8a03c);
}
.kudos-btn.kudos-on svg {
    fill: var(--gold, #c8a03c);
}
.kudos-count {
    font-size: 0.75rem;
    font-weight: 700;
}
@keyframes likePop {
    0%   { transform: scale(0.8); }
    45%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.pc-text {
    font-size: 0.83rem;
    line-height: 1.4;
    color: var(--gray-200);
    margin: 0;
    word-break: break-word;
}
/* Quoted reply reference — indented muted block above the reply text. */
.pc-quote-block {
    border-left: 3px solid rgba(200,160,60,0.55);
    padding: 2px 0 2px 10px;
    margin: 0 0 5px;
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}
/* Media thumbnail — small pill */
.pc-media-thumb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    padding: 2px 8px 2px 3px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.72rem;
    font-weight: 600;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 768px) {
    .pc-media-thumb {
        min-height: 44px;
        align-items: center;
        padding: 6px 10px;
    }
}
.pc-media-thumb:hover { background: rgba(255,255,255,0.1); }
.pc-media-thumb img {
    width: 36px;
    height: 28px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}
.pc-media-label { letter-spacing: 0.03em; }
/* Expanded image */
.pc-media-full { margin-top: 4px; }
.pc-media-full-img {
    max-width: min(320px, 100%);
    max-height: 220px;
    border-radius: 6px;
    display: block;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.15s;
}
.pc-media-full-img:hover {
    opacity: 0.85;
}
@media (max-width: 768px) {
    .pc-media-full-img {
        max-width: 100%;
        max-height: 100%;
    }
}
/* Divider between consecutive posts — subtle */
.post-card.pc + .post-card.pc {
    border-top: none;
}

/* Inline Comments Section */
.pc-inline-comments {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.pc-comments-list {
    margin-bottom: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.pc-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.pc-comment:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pc-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    object-fit: cover;
}

.pc-comment-body {
    flex: 1;
    min-width: 0;
}

.pc-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.pc-comment-user {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.pc-comment-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.pc-comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.pc-comment-delete:hover {
    color: var(--crimson);
}

.pc-comment-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    word-wrap: break-word;
}

.pc-empty-comments,
.pc-comments-loading,
.pc-comments-error {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.pc-comments-error {
    color: var(--crimson);
}

.pc-add-comment-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pc-comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.pc-comment-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.pc-comment-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pc-comment-submit {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pc-comment-submit:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pc-comment-submit:active {
    transform: scale(0.95);
}

/* Online Users Sidebar */
.community-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.online-users-panel {
    background: var(--navy-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--navy-medium);
}

.online-users-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.online-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    object-fit: cover;
}

.online-user-name {
    flex: 1;
    font-size: 0.9rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-indicator.away {
    background: var(--warning);
}

.no-users {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-align: center;
    padding: 1rem;
}

/* Comments */
.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    object-fit: cover;
}

.comment-body {
    flex: 1;
}

.comment-user {
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.comment-body p {
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.add-comment {
    display: flex;
    gap: 0.5rem;
}

.add-comment input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.87rem;
}
.add-comment input::placeholder { color: rgba(255,255,255,0.3); }
.add-comment input:focus { border-color: var(--gold, #d4af37); outline: none; }

.empty-comments {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

/* ================================================
   AI Meal Suggestions
   ================================================ */
.modal-lg {
    max-width: 800px;
}

.ai-meal-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--navy-medium);
}

.ai-meal-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

.ai-meals-results {
    max-height: 500px;
    overflow-y: auto;
}

.ai-meals-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.ai-meals-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ai-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--navy-medium);
    border-top-color: var(--crimson);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.ai-meal-card {
    background: var(--navy);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

.ai-meal-header h3 {
    font-size: 1.25rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 1px;
}

.ai-meal-desc {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ai-meal-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.macro-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.macro-tag.calories {
    background: var(--crimson);
    color: var(--white);
}

.macro-tag.protein {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.macro-tag.carbs {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.macro-tag.fat {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.ai-meal-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .ai-meal-details {
        grid-template-columns: 1fr;
    }
}

.ai-meal-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.ai-meal-section ul,
.ai-meal-section ol {
    font-size: 0.85rem;
    color: var(--gray-300);
    padding-left: 1.25rem;
}

.ai-meal-section li {
    margin-bottom: 0.25rem;
}

.ai-meal-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding-top: 1rem;
    border-top: 1px solid var(--navy-medium);
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 2rem;
}

/* AI Suggestions Banner */
.ai-suggestions-banner {
    background: linear-gradient(135deg, var(--navy-medium) 0%, var(--navy-light) 100%);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0;
}

.ai-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ai-banner-content svg {
    color: var(--gold);
    flex-shrink: 0;
}

.ai-banner-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.ai-banner-content p {
    font-size: 0.8rem;
    color: var(--gray-400);
}

@media (max-width: 600px) {
    .ai-suggestions-banner {
        flex-direction: column;
        text-align: center;
    }
    .ai-banner-content {
        flex-direction: column;
    }
}

/* ================================================
   Admin Panel
   ================================================ */
.admin-page {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.admin-header p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.admin-stat-card .stat-number {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--crimson);
    line-height: 1;
}

.admin-stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--navy-medium);
    margin-bottom: 1rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.admin-tab:hover {
    color: var(--white);
}

.admin-tab.active {
    color: var(--crimson);
    border-bottom-color: var(--crimson);
}

.admin-panel {
    background: var(--navy-light);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius);
    padding: 1rem;
}

.admin-panel.hidden {
    display: none;
}

.admin-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.admin-search {
    flex: 1;
    max-width: 300px;
    padding: 0.5rem 1rem;
    background: var(--navy-dark);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.85rem;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--navy-medium);
}

.admin-table th {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.admin-table td {
    font-size: 0.85rem;
    color: var(--white);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(255, 87, 51, 0.2);
    color: var(--danger);
}

.status-badge.admin {
    background: rgba(200, 160, 60, 0.2);
    color: var(--crimson);
    margin-left: 0.25rem;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-action-btn {
    padding: 0.35rem 0.75rem;
    background: var(--navy-dark);
    border: 1px solid var(--navy-medium);
    border-radius: var(--radius-sm);
    color: var(--gray-300);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.admin-action-btn:hover {
    background: var(--navy-medium);
    border-color: var(--crimson);
    color: var(--white);
}

.admin-action-btn.danger {
    color: var(--danger);
}

.admin-action-btn.danger:hover {
    background: rgba(255, 87, 51, 0.2);
    border-color: var(--danger);
}

/* Admin Posts */
.admin-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-post-item {
    background: var(--navy-dark);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.admin-post-item .post-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.admin-post-item .post-author {
    color: var(--white);
    font-weight: 500;
}

.admin-post-item .post-date {
    color: var(--gray-400);
}

.admin-post-item .post-content {
    color: var(--gray-300);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.admin-post-item .has-image {
    color: var(--info);
    font-size: 0.75rem;
}

.admin-post-item .post-actions {
    margin-top: 0.75rem;
}

/* Admin Challenges */
.admin-challenges-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-challenge-item {
    background: var(--navy-dark);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.admin-challenge-item .challenge-info h4 {
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.admin-challenge-item .challenge-info p {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.admin-challenge-item .challenge-dates {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: block;
}

.admin-challenge-item .challenge-reward {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.admin-challenge-item .challenge-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Admin Nav Button */
.admin-nav {
    color: var(--crimson) !important;
}

.admin-nav.active {
    background: rgba(200, 160, 60, 0.2);
}

@media (max-width: 1024px) {
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-challenge-item {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }
    .admin-tabs {
        flex-wrap: wrap;
    }
    .admin-tab {
        flex: 1;
        min-width: 80px;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   DAY VIEW — Full-screen tabbed day detail overlay
   ============================================================ */

.day-view-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.day-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

/* Day view header */
.dv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.dv-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dv-back {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius);
    color: var(--white);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.dv-back:hover {
    background: rgba(255,255,255,0.12);
}

.dv-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

.dv-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.05rem;
}

/* Tabs */
.dv-header-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.dv-tab {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.45);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.dv-tab:hover {
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.04);
}

.dv-tab.active {
    color: var(--white);
    background: rgba(184, 151, 46,0.2);
    border-color: rgba(184, 151, 46,0.4);
}

/* Body */
.dv-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dv-loading, .dv-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255,255,255,0.35);
    font-size: 0.85rem;
}

/* Empty state */
.dv-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(255,255,255,0.4);
}

.dv-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.dv-empty p { margin: 0.25rem 0; font-size: 0.875rem; }

.dv-empty-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.25);
    margin-top: 0.5rem;
}

.dv-no-items {
    padding: 1.5rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    text-align: center;
}

/* ---- Timeline tab ---- */
.dv-timeline {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 700px;
    margin: 0 auto;
}

.dv-tl-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.dv-tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.dot-training  { background: #b8972e; }
.dot-nutrition { background: #2ea043; }
.dot-rehab     { background: #d28700; }
.dot-community { background: #3882dc; }

.dv-tl-card {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    overflow: hidden;
}

.dv-tl-img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dv-tl-text {
    padding: 0.55rem 0.75rem;
}

.dv-tl-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.15rem;
}

.dv-tl-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}

/* ---- Food tab ---- */
.dv-food-panel {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dv-food-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
}

.dv-food-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
}

.dv-food-total span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    margin-left: 0.25rem;
}

.dv-macro-pills {
    display: flex;
    gap: 0.4rem;
}

.dv-macro-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.dv-macro-p { background: rgba(184, 151, 46,0.25); color: #e8a0aa; }
.dv-macro-c { background: rgba(46,160,67,0.2);  color: #7dd98e; }
.dv-macro-f { background: rgba(210,135,0,0.2);  color: #f0c060; }

.dv-meal-group {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
}

.dv-meal-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0.5rem 0.75rem 0.35rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dv-food-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.83rem;
}

.dv-food-item:last-child { border-bottom: none; }

.dv-food-name { color: rgba(255,255,255,0.85); }
.dv-food-cals { color: rgba(255,255,255,0.4); font-size: 0.75rem; }

/* ---- Exercise tab ---- */
.dv-exercise-panel {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dv-workout-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dv-workout-card {
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-left: 3px solid #b8972e;
    border-radius: var(--radius);
}

.dv-workout-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.35rem;
}

.dv-workout-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
}

.dv-workout-type-tag {
    background: rgba(184, 151, 46,0.2);
    color: #e8a0aa;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    text-transform: capitalize;
    font-weight: 600;
}

.dv-workout-notes {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

/* ---- Journal tab ---- */
.dv-journal-panel {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dv-journal-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dv-input-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
}

.dv-journal-textarea {
    min-height: 220px;
    resize: vertical;
    font-size: 0.875rem;
    line-height: 1.7;
}

.dv-journal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dv-journal-saved {
    font-size: 0.75rem;
    color: #2ea043;
}

.dv-journal-preview {
    padding: 1.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
}

.dv-journal-preview-date {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.5rem;
}

.dv-journal-preview-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 0.75rem;
}

.dv-journal-preview-body {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
}

.dv-journal-preview-img {
    margin-top: 1rem;
    width: 100%;
    border-radius: var(--radius);
    max-height: 300px;
    object-fit: cover;
}

/* ---- Photos tab ---- */
.dv-photos-panel {
    padding: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dv-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.dv-photo-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
}

.dv-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dv-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
}

.dv-photo-card:hover .dv-photo-overlay { opacity: 1; }

.dv-photo-caption {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dv-photo-delete {
    background: rgba(200,30,50,0.7);
    border: none;
    color: #fff;
    font-size: 1rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.dv-photo-drop {
    position: relative;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dv-photo-drop:hover {
    border-color: rgba(184, 151, 46,0.5);
    color: rgba(255,255,255,0.6);
}

.dv-photo-previews {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.dv-preview-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ---- Shared form elements ---- */
.dv-add-section {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1rem;
}

.dv-add-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.75rem;
}

.dv-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dv-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.dv-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
    transition: border-color 0.15s ease;
}

.dv-input:focus {
    outline: none;
    border-color: rgba(184, 151, 46,0.6);
    box-shadow: 0 0 0 2px rgba(184, 151, 46,0.12);
}

.dv-input-sm {
    width: auto;
    flex: 1;
    min-width: 0;
}

.dv-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--white);
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    flex: 1;
}

.dv-select option { background: #1a2a4a; }

.dv-textarea {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--white);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
    resize: vertical;
    transition: border-color 0.15s ease;
}

.dv-textarea:focus {
    outline: none;
    border-color: rgba(184, 151, 46,0.6);
    box-shadow: 0 0 0 2px rgba(184, 151, 46,0.12);
}

.dv-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.dv-field-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dv-save-btn {
    background: #b8972e;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
}

.dv-save-btn:hover { background: #b8203a; }
.dv-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dv-photo-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    transition: var(--transition);
}

.dv-photo-label:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}

.dv-photo-filename {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    align-self: center;
}

.dv-water-row {
    margin-top: 0.25rem;
}

.dv-water-quick {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #80aee8;
    background: rgba(56,130,220,0.1);
    border: 1px solid rgba(56,130,220,0.2);
    border-radius: var(--radius);
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.dv-water-quick:hover { background: rgba(56,130,220,0.2); }

/* Mobile adjustments */
@media (max-width: 600px) {
    .dv-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.6rem 0.85rem;
    }

    .dv-header-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .dv-header-tabs::-webkit-scrollbar { display: none; }

    .dv-tab {
        padding: 0.3rem 0.65rem;
        font-size: 0.72rem;
    }

    .dv-timeline, .dv-food-panel, .dv-exercise-panel, .dv-journal-panel, .dv-photos-panel {
        padding: 0.85rem;
    }

    .dv-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .dv-form-row {
        flex-wrap: wrap;
    }
}

/* ============================================================
   DASHBOARD — Google Calendar-style redesign
   ============================================================ */

.db-new {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: calc(100vh - 52px);
}

/* Top bar */
.db-topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap;
    background: var(--navy-dark);
}

.db-identity {
    flex: 1;
    min-width: 180px;
}

.db-greeting-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.db-dayname {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b8972e;
}

.db-datestr {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.02em;
}

.db-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.db-goal-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    background: rgba(200,160,60,0.18);
    border: 1px solid rgba(200,160,60,0.4);
    border-radius: 20px;
    color: rgba(255,255,255,0.75);
    vertical-align: middle;
}

/* KPI row */
.db-kpi-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    overflow: hidden;
}

.db-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1.1rem;
    gap: 0.05rem;
}

.db-kpi strong {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--white);
}

.db-kpi span {
    font-size: 0.63rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.db-kpi-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.08);
}

/* Log action buttons */
.db-log-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.db-log-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: #b8972e;
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
}

.db-log-btn:hover {
    background: #b8203a;
    transform: translateY(-1px);
}

.db-log-btn--ghost {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}

.db-log-btn--ghost:hover {
    background: rgba(255,255,255,0.1);
}

/* Body: calendar + sidebar */
.db-body {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 0;
}

/* Calendar panel */
.db-cal-panel {
    flex: 1;
    min-width: 0;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
}

.db-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.db-cal-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-cal-month {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--white);
    min-width: 160px;
    text-align: center;
}

.db-cal-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.85rem;
    flex-wrap: wrap;
}

.db-cal-legend .legend-item {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .db-cal-legend {
        gap: 0.4rem 0.7rem;
        justify-content: flex-start;
        width: 100%;
    }
    .db-cal-legend .legend-item {
        font-size: 0.72rem;
    }
    .db-cal-legend .legend-dot {
        width: 9px;
        height: 9px;
    }
}

@media (max-width: 480px) {
    .db-topbar {
        padding: 0.6rem 0.75rem;
        gap: 0.6rem;
    }
    .db-identity {
        min-width: auto;
    }
    .db-name {
        font-size: 1.15rem;
        gap: 0.4rem;
    }
    .db-goal-pill {
        font-size: 0.58rem;
        padding: 0.15rem 0.45rem;
    }
    .db-kpi-row {
        width: 100%;
        font-size: 0.85rem;
    }
    .db-kpi {
        padding: 0.4rem 0.75rem;
        gap: 0.02rem;
    }
    .db-kpi strong {
        font-size: 1.1rem;
    }
    .db-kpi span {
        font-size: 0.58rem;
    }
    .db-log-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.6rem;
    }
    .db-log-btn {
        width: 100%;
        min-height: 44px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    .gc-cal .cal-day {
        height: 52px;
        max-height: 52px;
        min-height: 52px;
        padding: 0.2rem 0.2rem;
        gap: 0.1rem;
    }
    .gc-cal .cal-day .day-num {
        font-size: 0.7rem;
    }
}

/* Google Calendar-style calendar grid */
.gc-cal {
    flex: 1;
}

.gc-cal .cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gc-cal .cal-weekday {
    padding: 0.5rem 0.5rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    text-align: center;
}

.gc-cal .cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.gc-cal .cal-day {
    height: 115px;
    max-height: 115px;
    min-height: 115px;
    border-right: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 0.3rem 0.35rem 0.35rem;
    cursor: pointer;
    transition: background 0.1s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.gc-cal .cal-day:nth-child(7n) {
    border-right: none;
}

.gc-cal .cal-day:hover {
    background: rgba(255,255,255,0.03);
}

.gc-cal .cal-day.past {
    opacity: 0.6;
}

.gc-cal .cal-day.other-month {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.gc-cal .cal-day.today {
    background: rgba(184, 151, 46,0.06);
}

.gc-cal .day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gc-cal .cal-day.today .day-num {
    background: #b8972e;
    color: #fff;
    font-weight: 700;
}

/* Desktop: day cells stretch to fill their grid row so the today/selected
   highlight covers the WHOLE square (was only filling a partial section when
   rows were taller than the fixed 115px cell). Mobile keeps its compact cells. */
@media (min-width: 769px) {
    .gc-cal .cal-days { grid-auto-rows: minmax(115px, 1fr); }
    .gc-cal .cal-day {
        height: auto;
        min-height: 115px;
        max-height: none;
        align-self: stretch;
    }
}

/* Event chips inside calendar cells - Desktop view */
.cal-chips {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Hide dots on desktop */
.cal-dots {
    display: none;
}

.cal-chip {
    font-size: 0.65rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    touch-action: manipulation;
    cursor: pointer;
    flex-shrink: 1;
    letter-spacing: 0;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cal-chip-extra {
    display: none;
}

.cal-day-expanded .cal-chip-extra {
    display: flex;
}

.gc-cal .cal-day-expanded {
    height: auto;
    max-height: none;
    min-height: 115px;
    overflow: visible;
    z-index: 10;
    background: var(--navy-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Allow chips container to expand and show all chips when day is expanded */
.gc-cal .cal-day-expanded .cal-chips {
    overflow: visible;
    max-height: none;
}

.cal-chip-training {
    background: rgba(184, 151, 46,0.3);
    color: #f0a8b0;
    border-left: 2.5px solid #b8972e;
}

.cal-chip-nutrition {
    background: rgba(46,160,67,0.25);
    color: #85e995;
    border-left: 2.5px solid #2ea043;
}

.cal-chip-rehab {
    background: transparent;
    color: #f0a8b0;
    border: 1px solid rgba(184, 151, 46,0.5);
    font-weight: 600;
    font-style: italic;
}

.cal-chip-rehab.cal-chip-completed {
    background: #b8972e;
    color: #fff;
    border: 1px solid #b8972e;
    font-weight: 700;
}

.cal-chip-strava {
    background: linear-gradient(135deg, rgba(252, 76, 2, 0.2), rgba(252, 76, 2, 0.1));
    color: #FC4C02;
    border-left: 2.5px solid #FC4C02;
    font-weight: 600;
}

.cal-chip-community {
    background: rgba(56,130,220,0.25);
    color: #90b8f0;
    border-left: 2.5px solid #3882dc;
}

.cal-chip-class {
    background: rgba(56,130,220,0.25);
    color: #6fb0ff;
    border-left: 2.5px solid #3882dc;
}

.cal-chip-more {
    background: transparent;
    color: rgba(255,255,255,0.35);
    font-size: 0.6rem;
    padding: 0 0.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cal-chip-more:hover {
    color: rgba(255,255,255,0.6);
}

.cal-chip-water {
    background: rgba(25, 195, 230, 0.22);
    color: #7fe4f5;
    border-left: 2.5px solid #19c3e6;
}

/* Mobile view - use dots instead of chips */
@media (max-width: 768px) {
    /* Hide chips on mobile */
    .cal-chips {
        display: none;
    }

    /* Show dots on mobile */
    .cal-dots {
        display: flex;
        flex-direction: row;
        gap: 0.35rem;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        flex: 1;
        overflow: visible;
        min-height: 0;
        padding-top: 0.25rem;
    }

    .cal-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        cursor: pointer;
        flex-shrink: 0;
        position: relative;
        transition: transform 0.2s ease;
    }

    .cal-dot:active {
        transform: scale(1.3);
    }

    .cal-dot-training {
        background: #b8972e;
        box-shadow: 0 0 4px rgba(184, 151, 46,0.6);
    }

    .cal-dot-steps {
        background: #5aa9e6;
        box-shadow: 0 0 4px rgba(90,169,230,0.6);
    }

    .cal-dot-nutrition {
        background: #2ea043;
        box-shadow: 0 0 4px rgba(46,160,67,0.6);
    }

    .cal-dot-rehab {
        background: #d28700;
        box-shadow: 0 0 4px rgba(210,135,0,0.6);
    }

    .cal-dot-community {
        background: #3882dc;
        box-shadow: 0 0 4px rgba(56,130,220,0.6);
    }

    /* Booked classes are "Events" — blue, matching .cal-dot-community + the legend. */
    .cal-dot-class {
        background: #3882dc;
        box-shadow: 0 0 4px rgba(56,130,220,0.6);
    }

    .cal-dot-water {
        background: #19c3e6;
        box-shadow: 0 0 4px rgba(25,195,230,0.6);
    }

    .cal-dot-note {
        background: #9b6dff;
        box-shadow: 0 0 4px rgba(180,140,255,0.6);
    }

    .cal-dot-weight {
        background: #f5a800;
        box-shadow: 0 0 4px rgba(255,200,80,0.6);
    }
}

/* ================================================
   Water Section (Nutrition Page)
   ================================================ */
.water-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(56,168,220,0.2);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.water-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.water-section-title {
    color: #7ec8e8;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.water-log-btn {
    background: rgba(56,168,220,0.15);
    border: 1px solid rgba(56,168,220,0.3);
    color: #7ec8e8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
.water-log-btn:hover { background: rgba(56,168,220,0.28); }

.water-glasses {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.water-glass {
    color: rgba(255,255,255,0.15);
    width: 22px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.water-glass.filled { color: #38a8dc; }
.water-glass.partial { color: rgba(56,168,220,0.45); }

.water-total {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.5px;
}

/* ================================================
   Quick Add Modal (Calendar Single-Click)
   ================================================ */
.quick-add-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s;
    pointer-events: none;
    padding: 1rem;
}
.quick-add-overlay.active {
    background: rgba(0,0,0,0.7);
    pointer-events: all;
}

.quick-add-sheet {
    background: var(--navy-light);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 1.25rem 1.25rem 1.5rem;
    transform: scale(0.93) translateY(8px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.32,0.72,0,1), opacity 0.2s;
}
.quick-add-overlay.active .quick-add-sheet {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.quick-add-handle {
    display: none;
}

.quick-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.25rem;
}

.quick-add-date {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.3px;
}

.quick-add-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quick-add-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 1rem;
}

.quick-add-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: var(--white);
}
.qa-btn:hover { background: rgba(255,255,255,0.1); }
.qa-btn.selected {
    background: rgba(184, 151, 46,0.2);
    border-color: rgba(184, 151, 46,0.45);
}

.qa-label { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.5px; }

.qa-water-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0 0.75rem;
}

.qa-water-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.qa-field-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qa-water-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-water-step {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.qa-water-step:hover { background: rgba(255,255,255,0.14); }

.qa-input-center { text-align: center; flex: 1; }

.quick-add-extra {
    min-height: 0;
    transition: min-height 0.2s;
}

.qa-success {
    text-align: center;
    padding: 0.75rem;
    color: #2ea043;
    font-size: 0.9rem;
    font-weight: 600;
}

.qa-note-form, .qa-photo-upload {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 0 0.75rem;
}

.qa-textarea {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--white);
    padding: 0.65rem;
    font-size: 0.9rem;
    resize: none;
    width: 100%;
    box-sizing: border-box;
}

/* ── Journaling note textarea ── */
.qa-note-journal {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 0 0.5rem;
}
.qa-note-journal-date {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0 0 0.65rem;
}
.qa-note-big-textarea {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    color: var(--white);
    padding: 1rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.7;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 280px;
    max-height: 520px;
    overflow-y: auto;
    transition: border-color 0.2s, background 0.2s;
    caret-color: var(--gold);
}
.qa-note-big-textarea:focus {
    outline: none;
    border-color: rgba(212,175,55,0.3);
    background: rgba(255,255,255,0.06);
}
.qa-note-big-textarea::placeholder {
    color: rgba(255,255,255,0.22);
    font-style: italic;
}
.qa-note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0 0;
    gap: 0.5rem;
}
.qa-word-count {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.qa-word-count.qa-wc-warn { color: rgba(212,175,55,0.7); }
.qa-word-count.qa-wc-over { color: rgba(220,50,50,0.9); font-weight: 600; }
.qa-note-save-btn {
    flex-shrink: 0;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
}
.qa-note-loading {
    color: rgba(255,255,255,0.3);
    font-size: 0.82rem;
    padding: 0.75rem 0;
    text-align: center;
}

/* ── Chip edit journal sheet ── */
.ce-journal-sheet {
    max-width: 460px;
    padding: 0;
    overflow: hidden;
}
.ce-journal-header {
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0;
}
.ce-journal-title {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
}
.ce-journal-body {
    padding: 1rem 1.25rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ce-journal-ta {
    min-height: 200px;
    max-height: 400px;
    font-size: 1rem;
    line-height: 1.75;
    border-radius: 8px;
}

/* ================================================
   Modern Journal Editor - Rich Text Formatting
   ================================================ */

/* Overlay - Subtle, transparent to see page behind */
.ce-modern-overlay {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(2px);
}
.ce-modern-overlay.active {
    background: rgba(0, 0, 0, 0.4) !important;
}
/* Mobile: note editor as a centred CARD/sheet (was full-screen). */
@media (max-width: 768px) {
    .ce-modern-overlay {
        background: rgba(0, 0, 0, 0.55) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .ce-modern-journal {
        width: 100% !important;
        max-width: 480px !important;
        height: auto !important;
        max-height: 88vh !important;
        border-radius: 16px !important;
        margin: 0 !important;
        position: relative !important;
        inset: auto !important;
        z-index: 2100 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .ce-modern-header {
        flex: 0 0 auto !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 5 !important;
        background: #0d1424 !important;
    }
    .ce-modern-toolbar {
        flex: 0 0 auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .ce-modern-editor {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: none !important;
    }
    .ce-modern-footer {
        flex: 0 0 auto !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 5 !important;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
        background: #0d1424 !important;
    }
    .ce-media-row,
    .ce-media-attached {
        flex: 0 0 auto !important;
        max-height: 200px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Main container - centered, spacious, semi-transparent */
.ce-modern-journal {
    background: rgba(13, 17, 23, 0.92);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 90vw;
    max-width: 1000px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

/* Header - minimal with close button (top-LEFT, consistent with every other screen) */
.ce-modern-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ce-close-minimal {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.ce-close-minimal:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

/* Clear gold "Back" affordance for the journal editor (the faint X read as "no back button"). */
.ce-back-btn {
    width: auto;
    height: auto;
    gap: 0.25rem;
    padding: 0.35rem 0.7rem 0.35rem 0.45rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold, #c9a84c);
}
.ce-back-btn span { line-height: 1; }
.ce-back-btn:hover { background: rgba(201,168,76,0.12); color: var(--gold, #c9a84c); }

/* Toolbar - formatting options */
.ce-modern-toolbar {
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
}

.ce-format-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 0 0.55rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    box-sizing: border-box;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.ce-format-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}
.ce-format-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.96);
}

.ce-toolbar-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 0.25rem;
}

/* Color picker labels */
.ce-color-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.15s;
    flex: 0 0 auto;
}
.ce-color-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}
.ce-page-bg-label {
    font-size: 1rem;
    /* Square icon represents page background */
}
.ce-color-picker {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.ce-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
.ce-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Editor - THE STAR OF THE SHOW */
.ce-modern-editor {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    font-size: 1.15rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.95);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
    border: none;
    caret-color: #d4af37;
    min-height: 0;
    background: transparent;
    /* Bigger, more visible cursor */
    caret-width: 3px;
}
.ce-modern-editor:focus {
    outline: none;
    /* Flashing cursor animation */
    animation: cursor-flash 1s infinite;
}

@keyframes cursor-flash {
    0%, 49% { caret-color: #d4af37; }
    50%, 100% { caret-color: transparent; }
}

/* Placeholder styling */
.ce-modern-editor:empty:before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    pointer-events: none;
}

/* Rich text styling within editor */
.ce-modern-editor b, .ce-modern-editor strong {
    font-weight: 700;
    color: rgba(255, 255, 255, 1);
}
.ce-modern-editor i, .ce-modern-editor em {
    font-style: italic;
}
.ce-modern-editor u {
    text-decoration: underline;
}
.ce-modern-editor ul, .ce-modern-editor ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}
.ce-modern-editor li {
    margin: 0.25rem 0;
}

/* Footer - minimal actions */
.ce-modern-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ce-char-count-minimal {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.03em;
}

.ce-modern-actions {
    display: flex;
    gap: 0.6rem;
}

.ce-btn-minimal {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.ce-btn-minimal:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}

.ce-btn-save {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    color: #d4af37;
}
.ce-btn-save:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.5);
    color: #e5c158;
}

.ce-btn-delete {
    background: rgba(184, 151, 46, 0.15);
    border-color: rgba(184, 151, 46, 0.3);
    color: rgba(220, 50, 50, 0.9);
}
.ce-btn-delete:hover {
    background: rgba(184, 151, 46, 0.25);
    border-color: rgba(184, 151, 46, 0.5);
    color: rgb(220, 50, 50);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ce-modern-journal {
        width: 95vw;
        height: 92vh;
    }
    .ce-modern-editor {
        padding: 1.5rem;
        font-size: 1.05rem;
    }
    .ce-modern-toolbar {
        padding: 0.75rem;
    }
}

.qa-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--white);
    padding: 0.65rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.qa-save-btn {
    background: var(--crimson);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qa-upload-label {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    border: 1.5px dashed rgba(255,255,255,0.2);
    border-radius: var(--radius);
    background: transparent;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-size: 0.85rem;
    box-sizing: border-box;
    transition: border-color 0.15s, color 0.15s;
}
.qa-upload-label:hover { border-color: rgba(255,255,255,0.45); color: rgba(255,255,255,0.8); }

.qa-full-day {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    padding: 0.65rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}
.qa-full-day:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }

/* ================================================
   Calendar chip — note type
   ================================================ */
.cal-chip-note {
    background: rgba(180,140,255,0.25);
    color: #d0b8ff;
    border-left: 2.5px solid #9b6dff;
}

.cal-chip-weight {
    background: rgba(255,200,80,0.25);
    color: #ffd870;
    border-left: 2.5px solid #f5a800;
}
/* Daily-challenge log (e.g. press-ups) — distinct orange so it stands out from
   training gold + assessment pink. */
.cal-chip-challenge {
    background: rgba(255,120,73,0.22);
    color: #ffb199;
    border-left: 2.5px solid #ff7849;
}

/* ================================================
   MOBILE CALENDAR — dot mode (chips → coloured dots)
   ================================================ */
@media (max-width: 640px) {
    /* Tighter cells */
    .gc-cal .cal-day {
        height: 52px;
        max-height: 52px;
        padding: 0.2rem 0.2rem 0.3rem;
        gap: 0.15rem;
    }
    .gc-cal .day-num {
        font-size: 0.72rem;
        width: 20px;
        height: 20px;
    }
    /* Chips become a horizontal row of dots */
    .gc-cal .cal-chips {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
        align-content: flex-start;
        overflow: hidden;
    }
    .gc-cal .cal-chip {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        padding: 0;
        font-size: 0;
        text-indent: -9999px;
        border-left: none;
        flex-shrink: 0;
        overflow: hidden;
        white-space: nowrap;
    }
    /* Dot colours per type */
    .gc-cal .cal-chip-training  { background: #b8972e; }
    .gc-cal .cal-chip-nutrition { background: #2ea043; }
    .gc-cal .cal-chip-water     { background: #38a8dc; }
    .gc-cal .cal-chip-rehab     { background: #b8972e; }
    .gc-cal .cal-chip-community { background: #3882dc; }
    .gc-cal .cal-chip-class     { background: #3882dc; }
    .gc-cal .cal-chip-note      { background: #9b6dff; }
    .gc-cal .cal-chip-weight    { background: #f5a800; }
    .gc-cal .cal-chip-planned   { background: transparent; border: 2px solid rgba(201,168,76,0.8); }
    .gc-cal .cal-chip-strava    { background: #FC4C02; }
    .gc-cal .cal-chip-challenge { background: #ff7849; }
    /* Hide the "+N more" overflow chip */
    .gc-cal .cal-chip-more { display: none; }
}

.today-event-item.event-weight .today-event-dot { background: #f5a800; }
.today-event-item.event-note .today-event-dot { background: #9b6dff; }
.today-event-item.event-water .today-event-dot { background: #38a8dc; }

/* ================================================
   Calendar chip — hover tooltip
   ================================================ */
.cal-chip-tooltip {
    position: absolute;
    z-index: 9999;
    background: var(--navy-dark, #0d1117);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    min-width: 140px;
    max-width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
}
.cct-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--white, #fff);
    margin-bottom: 0.2rem;
}
.cct-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}
.cct-hint {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    margin-top: 0.35rem;
    font-style: italic;
}
.cct-photo {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    display: block;
}
.cal-chip-tooltip:has(.cct-photo) {
    max-width: 220px;
    padding: 0.5rem;
}

/* Note preview in tooltip */
.cct-note-preview {
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    max-height: 120px;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}
.cal-chip-tooltip:has(.cct-note-preview) {
    max-width: 280px;
}

/* ================================================
   Chip Edit Modal
   ================================================ */
.chip-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: background 0.2s;
    pointer-events: none;
}
.chip-edit-overlay.active {
    background: rgba(0,0,0,0.75);
    pointer-events: all;
}
.chip-edit-sheet {
    background: var(--navy-light);
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
    padding: 1.25rem;
    transform: scale(0.93);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
}
.chip-edit-overlay.active .chip-edit-sheet {
    transform: scale(1);
    opacity: 1;
}
.chip-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.chip-edit-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chip Detail Popup */
.cdp-sheet {
    max-width: 420px;
}
.cdp-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cdp-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.cdp-big-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
}
.cdp-date {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}
.cdp-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
    line-height: 1.5;
}
.cdp-note-content-rich {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin: 1rem 0;
    word-wrap: break-word;
}
.cdp-note-content-rich b, .cdp-note-content-rich strong {
    font-weight: 700;
    color: rgba(255, 255, 255, 1);
}
.cdp-note-content-rich i, .cdp-note-content-rich em {
    font-style: italic;
}
.cdp-note-content-rich u {
    text-decoration: underline;
}
.cdp-note-content-rich ul, .cdp-note-content-rich ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}
.cdp-note-content-rich li {
    margin: 0.25rem 0;
}
.cdp-reschedule-row {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cdp-reschedule-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cdp-date-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #e5e7eb;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-family: inherit;
    color-scheme: dark;
}
.cdp-photo {
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
}
/* Planned session card inside chip detail popup */
.cdp-planned-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 0.5rem;
}
.cdp-planned-prog {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold, #c9a84c);
}
.cdp-planned-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
.cdp-planned-type {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cdp-planned-date {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.4rem;
}
.cdp-begin-btn {
    margin-top: 0.25rem;
}
/* Planned chip styling */
.cal-chip-planned {
    background: transparent;
    border: 1px solid rgba(201,168,76,0.5);
    color: var(--gold, #c9a84c);
}

.cal-chip-planned.cal-chip-completed {
    background: var(--gold, #c9a84c);
    border: 1px solid var(--gold, #c9a84c);
    color: var(--navy-dark, #0b1120);
    font-weight: 600;
}

.cdp-note-text {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.5;
}
.cdp-note-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
    line-height: 1.6;
}

/* Sidebar */
.db-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid rgba(255,255,255,0.04);
}

.db-side-card {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.db-side-card-header {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Calorie ring */
.db-cal-ring-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.db-ring-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.db-ring-svg {
    width: 64px;
    height: 64px;
}

.db-ring-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-ring-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
}

.db-cal-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.db-cal-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--white);
}

.db-cal-num small {
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
    margin-left: 0.2rem;
}

.db-cal-of {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
}

/* Three energy rings: Eaten / Burned / Net */
.db-cal-tri { display: flex; justify-content: space-around; gap: 0.3rem; margin-bottom: 0.5rem; }
.db-tri-item { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.db-ring-sm { width: 58px; height: 58px; }
.db-ring-sm .db-ring-svg { width: 58px; height: 58px; }
.db-tri-num { font-size: 0.66rem; font-weight: 700; color: var(--white); }
.db-tri-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.45); }
.db-cal-target { text-align: center; font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-bottom: 0.9rem; }

/* Macro bars in sidebar */
.db-macro-bars {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.db-macro-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-macro-lbl {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    width: 38px;
    flex-shrink: 0;
}

.db-macro-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.db-macro-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.db-macro-protein { background: #b8972e; }
.db-macro-carbs   { background: #2ea043; }
.db-macro-fat     { background: #d28700; }

.db-macro-val {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

/* Today's activity list in sidebar */
.today-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    /* Keep the card a consistent thin height regardless of how many events a day has;
       extra items scroll inside instead of making the card grow tall. */
    max-height: 156px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.today-event-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.75);
}

.today-event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-training .today-event-dot  { background: #b8972e; }
.event-nutrition .today-event-dot { background: #2ea043; }
.event-rehab .today-event-dot     { background: #d28700; }
.event-community .today-event-dot { background: #3882dc; }
.event-class .today-event-dot     { background: #c8a03c; }
.event-planned .today-event-dot   { background: var(--gold, #c9a84c); }

/* Today's Activity: To-Do vs Activity grouping. Planned-but-not-done sessions sit under To-Do
   with a hollow dot + tag so they don't read as already-logged. */
.today-subhead {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin: 0.5rem 0 0.25rem;
}
.today-subhead-todo { color: var(--gold, #c9a84c); margin-top: 0; }
.today-event-todo { background: rgba(201,168,76,0.07); }
.today-event-todo .today-event-dot {
    background: transparent;
    border: 1.5px solid var(--gold, #c9a84c);
    width: 8px;
    height: 8px;
}
.today-event-todo .today-event-name { color: rgba(255,255,255,0.85); }
.today-todo-tag {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold, #c9a84c);
    background: rgba(201,168,76,0.14);
    padding: 0.05rem 0.32rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.today-event-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.today-event-delete {
    background: none;
    border: none;
    color: rgba(255,80,80,0.5);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    margin-left: auto;
}
.today-event-item:hover .today-event-delete { opacity: 1; }
.today-event-delete:hover { color: #ff5050; }
@media (max-width: 900px) {
    .today-event-delete { opacity: 0.6; }
}
@media (pointer: coarse) {
    .today-event-delete { opacity: 0.6; }
}

.today-empty {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 0.75rem 0;
    line-height: 1.6;
}

.today-empty span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.2);
}

/* Sidebar add button */
.db-add-btn {
    background: rgba(184, 151, 46,0.2);
    border: 1px solid rgba(184, 151, 46,0.3);
    color: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
}

.db-add-btn:hover {
    background: #b8972e;
    color: #fff;
}

/* Water card */
.db-water-card {
    border-bottom: none;
}

.db-water-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem;
    background: rgba(56,130,220,0.1);
    border: 1px solid rgba(56,130,220,0.2);
    border-radius: var(--radius);
    color: #80aee8;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

/* Strava Activity Detail Modal */
.strava-detail-modal {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.strava-detail-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.strava-type {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}

.strava-time {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

.strava-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.strava-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
}

.strava-stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #FC4C02;
    line-height: 1;
}

.strava-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strava-description {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.strava-desc-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strava-desc-text {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    border-left: 2px solid #FC4C02;
}

.strava-map-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.strava-map-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strava-map-img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
}

.strava-map-fallback {
    padding: 2rem;
    text-align: center;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    border: 1px dashed rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.strava-actions {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.strava-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, rgba(252, 76, 2, 0.2), rgba(252, 76, 2, 0.1));
    border: 1px solid rgba(252, 76, 2, 0.3);
    border-radius: var(--radius);
    color: #FC4C02;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.strava-view-btn:hover {
    background: linear-gradient(135deg, rgba(252, 76, 2, 0.3), rgba(252, 76, 2, 0.2));
    border-color: rgba(252, 76, 2, 0.5);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .strava-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .strava-stat {
        padding: 0.75rem;
    }

    .strava-stat-value {
        font-size: 1.1rem;
    }
}

.db-water-btn:hover {
    background: rgba(56,130,220,0.2);
    color: #aaccf5;
}

/* Mobile: stack sidebar below calendar */
@media (max-width: 900px) {
    .db-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        padding: 0.85rem 1rem;
    }

    .db-body {
        flex-direction: column;
    }

    .db-cal-panel {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .db-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    .db-water-card {
        grid-column: 1 / -1;
    }

    .gc-cal .cal-day {
        height: 72px;
        max-height: 72px;
        min-height: 72px;
    }

    .cal-chip {
        font-size: 0.58rem;
    }
}

/* Additional responsive breakpoints for calendar */
@media (max-width: 1100px) and (min-width: 901px) {
    .gc-cal .cal-day {
        height: 95px;
        max-height: 95px;
        min-height: 95px;
    }
}

@media (max-width: 1400px) and (min-width: 1101px) {
    .gc-cal .cal-day {
        height: 105px;
        max-height: 105px;
        min-height: 105px;
    }
}

@media (max-width: 480px) {
    .db-sidebar {
        grid-template-columns: 1fr;
    }

    .db-kpi-row {
        width: 100%;
        justify-content: stretch;
    }

    .db-kpi {
        flex: 1;
    }
}

/* =====================================================
   DAY DETAIL PANEL — Visual DB
   ===================================================== */
/* ── Full-Page Day Log ─────────────────────────────── */
.day-detail-overlay {
    position: fixed;
    inset: 0;
    background: #090e1a;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    flex-direction: column;
}
.day-detail-overlay.active {
    opacity: 1;
}
.day-detail-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
    transform: translateY(18px);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.day-detail-overlay.active .day-detail-panel {
    transform: translateY(0);
}

/* Top bar */
.ddp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Clear the phone status bar / clock. env() reads ~0 for this overlay, so floor it with max(). */
    padding: max(2.9rem, calc(env(safe-area-inset-top, 30px) + 0.5rem)) 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
    gap: 0.75rem;
}
.ddp-date-block {
    flex: 1;
    text-align: center;
}
.ddp-weekday {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    opacity: 0.85;
}
.ddp-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.45rem;
    letter-spacing: 2px;
    color: var(--white);
    line-height: 1.1;
}
.ddp-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    flex-shrink: 0;
}
.ddp-close-btn:hover { color: rgba(255,255,255,0.95); }
/* Clear gold "Back" affordance — the faint X read as "no back button" and sat under the clock. */
.ddp-back-btn {
    width: auto;
    height: auto;
    border-radius: 999px;
    gap: 0.15rem;
    padding: 0.3rem 0.6rem 0.3rem 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
}
.ddp-back-btn span { line-height: 1; }
.ddp-back-btn svg { width: 17px; height: 17px; }
.ddp-back-btn:hover { background: rgba(201,168,76,0.12); color: var(--gold); }
.ddp-log-btn {
    background: var(--crimson);
    border: none;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.ddp-log-btn:hover { background: #c01530; }

/* Scrollable body */
.ddp-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Card grid for metrics */
.ddp-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
@media (max-width: 480px) {
    .ddp-metric-grid { grid-template-columns: 1fr 1fr; }
}

/* Individual cards */
.ddp-card {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}
.ddp-card-full { grid-column: 1 / -1; }

/* Card header strip */
.ddp-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ddp-card-icon { font-size: 0.95rem; }
.ddp-card-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
}

/* Color themes */
.ddp-card-weight .ddp-card-header { background: rgba(212,175,55,0.15); color: var(--gold); }
.ddp-card-water  .ddp-card-header { background: rgba(30,144,255,0.15); color: #5aafff; }
.ddp-card-nutrition .ddp-card-header { background: rgba(34,197,94,0.13); color: #6ee7b7; }
.ddp-card-training  .ddp-card-header { background: rgba(184, 151, 46,0.22); color: #f87171; }
.ddp-card-notes     .ddp-card-header { background: rgba(147,51,234,0.15); color: #c084fc; }
.ddp-card-weight { border-top: 2px solid rgba(212,175,55,0.35); }
.ddp-card-water  { border-top: 2px solid rgba(30,144,255,0.35); }
.ddp-card-nutrition { border-top: 2px solid rgba(34,197,94,0.3); }
.ddp-card-training  { border-top: 2px solid rgba(184, 151, 46,0.45); }
.ddp-card-notes     { border-top: 2px solid rgba(147,51,234,0.35); }

/* Filled card body */
.ddp-card-body {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}
.ddp-big-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2.4rem;
    letter-spacing: 2px;
    color: #fff;
    line-height: 1;
}
.ddp-value-unit {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    margin-left: 2px;
}
.ddp-sub-line {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

/* Glass hydration display */
.ddp-glasses {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.ddp-glass { font-size: 1.05rem; color: rgba(255,255,255,0.18); }
.ddp-glass.filled { color: #5aafff; }

/* Meal rows */
.ddp-meal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 0.5rem;
}
.ddp-meal-row:last-child { border-bottom: none; }
.ddp-meal-name { font-size: 0.82rem; color: rgba(255,255,255,0.82); font-weight: 500; }
.ddp-meal-cal  { font-size: 0.73rem; color: rgba(255,255,255,0.4); white-space: nowrap; }

/* Link button inside card */
.ddp-link-btn {
    align-self: flex-start;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.3);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.35rem;
}
.ddp-link-btn:hover { background: rgba(212,175,55,0.25); }
.ddp-card-nutrition .ddp-link-btn { border-color: rgba(34,197,94,0.3); color: #6ee7b7; background: rgba(34,197,94,0.08); }
.ddp-card-training .ddp-link-btn  { border-color: rgba(248,113,113,0.3); color: #f87171; background: rgba(248,113,113,0.08); }

/* Empty card state */
.ddp-card-empty-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    gap: 0.65rem;
    flex: 1;
    cursor: pointer;
}
.ddp-card-empty-body:hover .ddp-empty-prompt { opacity: 1; }
.ddp-empty-icon { font-size: 1.8rem; opacity: 0.4; }
.ddp-empty-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}
.ddp-empty-prompt {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.18);
    text-align: center;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.ddp-card[data-action] .ddp-card-empty-body { cursor: pointer; }
.ddp-card[data-action]:hover { border-color: rgba(255,255,255,0.12); }

/* Notes & Photos full-width card */
.ddp-notes-photos {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ddp-hero-img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
}
.ddp-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0;
}
.ddp-photo-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}
.ddp-photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.ddp-photo-grid-item:hover img { transform: scale(1.05); }
.ddp-photo-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.7rem;
    padding: 1rem 0.5rem 0.4rem;
}
.ddp-note-body {
    padding: 1rem;
    font-size: 0.93rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.75;
    white-space: pre-wrap;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ddp-notes-cta {
    display: flex;
    gap: 0.65rem;
    padding: 1rem;
    flex-wrap: wrap;
}
.ddp-cta-btn {
    flex: 1;
    min-width: 120px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.8rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}
.ddp-cta-btn:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.8);
}

/* Loading / error */
.ddp-loading,
.ddp-empty-state {
    color: rgba(255,255,255,0.35);
    font-size: 0.875rem;
    text-align: center;
    padding: 3rem 0;
    line-height: 1.7;
}

/* Legacy aliases kept for safety */
.ddp-section { display: none; }
.ddp-section-empty { display: none; }
.ddp-value { font-size: 1.5rem; font-weight: 800; color: #fff; }
.ddp-sub { font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.ddp-footer { display: none; }
.ddp-add-btn { display: none; }
.ddp-empty-row { display: none; }
.ddp-action-row { display: none; }
.ddp-section-photo { max-height: 220px; }
.ddp-photo-caption { font-size: 0.78rem; color: rgba(255,255,255,0.55); padding: 0.4rem 0.85rem; }
.ddp-note-row { display: none; }
.ddp-note-type { display: none; }
.ddp-note-text { display: none; }
.ddp-photo-row { display: none; }
.ddp-section-header { display: none; }
.ddp-section-total { display: none; }
.ddp-row { display: none; }
.ddp-row-weight { display: none; }


/* ============================================================
   DAILY LOG — clean row layout (replaces old card grid)
   ============================================================ */

/* Photo strip */
.ddl-photo-strip {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
}
.ddl-photo {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.15s;
}
.ddl-photo:hover { opacity: 0.92; }
.ddl-photo + .ddl-photo { border-top: 2px solid rgba(0,0,0,0.3); }

/* Note block */
.ddl-note-block {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.78);
    line-height: 1.7;
    white-space: pre-wrap;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border-left: 2px solid rgba(255,255,255,0.1);
}

/* Add photo / note action buttons */
.ddl-media-actions {
    display: flex;
    gap: 0.6rem;
}
.ddl-media-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ddl-media-btn svg { opacity: 0.6; flex-shrink: 0; }
.ddl-media-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}
.ddl-media-btn:hover svg { opacity: 1; }

/* Stats list container */
.ddl-stats {
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

/* Individual stat row */
.ddl-stat-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
    cursor: default;
}
.ddl-stat-row:last-child { border-bottom: none; }
.ddl-stat-row[data-nav],
.ddl-stat-row.ddl-stat-empty { cursor: pointer; }
.ddl-stat-row[data-nav]:hover,
.ddl-stat-row.ddl-stat-empty:hover { background: rgba(255,255,255,0.04); }

/* Icon badge */
.ddl-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* Day-log category icons unified to the navy + gold palette (were off-theme blue /
   green / pink). Category is still clear from the label text beside each. */
.si-weight    { background: rgba(200,160,60,0.15); color: var(--gold, #c8a03c); }
.si-water     { background: rgba(200,160,60,0.15); color: var(--gold, #c8a03c); }
.si-nutrition { background: rgba(200,160,60,0.15); color: var(--gold, #c8a03c); }
.si-training  { background: rgba(200,160,60,0.15); color: var(--gold, #c8a03c); }
.ddl-stat-icon svg { display: block; }

/* Info column */
.ddl-stat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ddl-stat-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
.ddl-stat-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.ddl-sub-muted { color: rgba(255,255,255,0.25); }

/* Hydration dots */
.ddl-dots {
    display: flex;
    gap: 4px;
    padding-top: 0.2rem;
}
.ddl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.ddl-dot.on { background: #93c5fd; }

/* Meal / workout sub-rows */
.ddl-row-sub-item {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    padding-top: 0.1rem;
}
.ddl-row-sub-item span:last-child { color: rgba(255,255,255,0.3); white-space: nowrap; }
.ddl-deletable-row { align-items: center; }
.ddl-row-sub-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ddl-sub-type { color: rgba(255,255,255,0.3); white-space: nowrap; }
.ddl-delete-item-btn {
    background: none;
    border: none;
    color: rgba(255,80,80,0.5);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.ddl-deletable-row:hover .ddl-delete-item-btn { opacity: 1; }
.ddl-delete-item-btn:hover { color: #ff5050; }
/* Move-to-another-date button: gold icon, NO bubble (default UA button styling gave it a
   blue background). Matches the bubble-free delete affordance beside it. */
.ddl-move-item-btn {
    background: none;
    border: none;
    color: #d4af37;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    opacity: 0.9;
    transition: opacity 0.15s, color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.ddl-move-item-btn:hover { opacity: 1; color: #e6c45e; }
.ddl-move-item-btn svg { display: block; }
@media (max-width: 900px) {
    .ddl-delete-item-btn { opacity: 0.6; }
}
@media (pointer: coarse) {
    .ddl-delete-item-btn { opacity: 0.6; }
}

/* Big value (right) */
.ddl-stat-val {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 1px;
    line-height: 1;
    text-align: right;
    flex-shrink: 0;
}
.ddl-stat-val span {
    font-size: 0.7rem;
    font-family: inherit;
    color: rgba(255,255,255,0.35);
    display: block;
    letter-spacing: 0.05em;
    text-align: right;
    margin-top: 1px;
}

/* Empty state CTA */
.ddl-stat-cta {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold, #c8a03c);
    flex-shrink: 0;
    border: none;
    padding: 0.2rem 0.3rem;
    transition: opacity 0.15s;
}
.ddl-stat-empty:hover .ddl-stat-cta,
.ddl-stat-empty:active .ddl-stat-cta {
    opacity: 0.65;
}

/* Accent borders per metric */
.ddl-stat-weight  { border-left: 2px solid rgba(212,175,55,0.4); }
.ddl-stat-water   { border-left: 2px solid rgba(96,165,250,0.35); }
.ddl-stat-nutrition { border-left: 2px solid rgba(52,211,153,0.3); }
.ddl-stat-training  { border-left: 2px solid rgba(220,38,38,0.4); }

/* ── Photo Lightbox ─────────────────────────────────────────────────────── */
.photo-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.photo-lightbox-overlay.is-open { opacity: 1; }
.lightbox-img {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    transform: scale(0.96);
    transition: transform 0.2s;
}
.photo-lightbox-overlay.is-open .lightbox-img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 10000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Remove italic from note display */
.ddp-note-body { font-style: normal; }
.ddl-note-block { font-style: normal; }

/* ── Daily log note display (bigger, tappable) ── */
.ddl-note-block {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.09);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}
.ddl-note-block:hover {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
}
.ddl-note-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ddl-note-hdr-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
.ddl-note-hdr-wc {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.22);
}
.ddl-note-content {
    flex: 1;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    white-space: pre-wrap;
    font-style: normal;
}


/* ── Photo Gallery Overlay ───────────────────────────────────────────────── */
.photo-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s;
}
.photo-gallery-overlay.is-open { opacity: 1; }
.gallery-panel {
    background: var(--navy, #0f1823);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 680px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    transition: transform 0.22s;
    overflow: hidden;
}
.photo-gallery-overlay.is-open .gallery-panel { transform: translateY(0); }
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.gallery-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}
.gallery-add-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.3);
    color: var(--gold, #d4af37);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
}
.gallery-close-btn {
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.gallery-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.gallery-loading, .gallery-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    padding: 3rem 1rem;
}
.gallery-item {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.gallery-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: opacity 0.15s;
}
.gallery-img:hover { opacity: 0.9; }
.gallery-item-meta {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.gallery-date {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}
.gallery-caption {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    min-height: 1.2em;
    outline: none;
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 -4px;
}
.gallery-caption[contenteditable="true"] {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
}
.gallery-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.gallery-action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.gallery-action-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }
.gallery-share-btn { border-color: rgba(212,175,55,0.25); color: rgba(212,175,55,0.7); }
.gallery-share-btn:hover { background: rgba(212,175,55,0.12); color: var(--gold, #d4af37); }

/* Community page: flush full-height layout, no outer padding/scroll */
#page-content.page-community {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Discord-style community layout ─────────────────────────────────────── */
.dc-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: var(--navy, #0f1823);
}
.dc-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* Mobile-First Community Layout */
@media (max-width: 768px) {
    /* Full-screen sidebar on mobile (shows when chat not open) */
    .dc-layout {
        position: relative;
    }

    .dc-sidebar {
        width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10;
        transition: transform 0.3s ease;
    }

    /* Hide sidebar when chat is open */
    .dc-layout.chat-open .dc-sidebar {
        transform: translateX(-100%);
    }

    /* Show main chat when active */
    .dc-main {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 5;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .dc-layout.chat-open .dc-main {
        transform: translateX(0);
    }

    /* Back button for mobile chat */
    .dc-mobile-back-btn {
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0.4rem 0.5rem 0.4rem 0;
        background: transparent;
        border: none;
        border-radius: 6px;
        color: var(--gold, #c8a03c);
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: color 0.2s;
    }

    .dc-mobile-back-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Channel preview in sidebar */
    .dc-channel-preview {
        display: block;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.4);
        margin-top: 0.25rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Make channels more touch-friendly */
    .dc-channel-item, .dc-dm-item {
        padding: 0.75rem 1rem;
        min-height: 56px;
    }

    /* Composer adjustments for mobile */
    .dc-inline-composer {
        padding: 0.75rem;
    }

    .dc-ic-textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Feed scrolling */
    .dc-feed {
        -webkit-overflow-scrolling: touch;
    }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
    .dc-mobile-back-btn {
        display: none !important;
    }
    .dc-channel-preview {
        display: none;
    }
}
.dc-sidebar-header {
    padding: 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.dc-section-label {
    padding: 0.9rem 0.75rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
}
.dc-channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.4rem 1rem;
}
.dc-channel-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    font-weight: 500;
    position: relative;
}
.dc-channel-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.dc-channel-item.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }
.dc-channel-hash { font-size: 1rem; opacity: 0.5; flex-shrink: 0; }
.dc-channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-channel-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--crimson, #b8972e);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
}
.nav-community-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: var(--crimson, #b8972e);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.dc-join-btn {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.3);
    color: var(--gold, #d4af37);
    cursor: pointer;
    flex-shrink: 0;
}
.dc-add-channel-btn {
    margin: 0.5rem 0.75rem;
    background: none;
    border: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.3);
    font-size: 0.72rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.dc-add-channel-btn:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.3); }
/* DM section in sidebar */
.dc-dm-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0.75rem 0.3rem;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
}
.dc-new-dm-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 3px;
    transition: color 0.15s;
}
.dc-new-dm-btn:hover { color: rgba(255,255,255,0.8); }
.dc-dm-list {
    padding: 0 0.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    max-height: 180px;
}
.dc-dm-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
}
.dc-dm-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.dc-dm-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.dc-dm-item-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.dc-dm-item-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dc-dm-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-dm-empty { font-size: 0.72rem; color: rgba(255,255,255,0.2); padding: 0.4rem 0.6rem; }
/* DM header avatar in main area */
.dc-dm-header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--crimson, #b8972e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
/* Back button in DM view */
.dc-dm-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.45);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-left: auto;
}
.dc-dm-back-btn:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
/* Hide dm-section labels on mobile */
@media (max-width: 640px) {
    .dc-dm-item-name, .dc-dm-section-label span { display: none; }
    .dc-dm-item { justify-content: center; padding: 0.5rem; }
    .dc-dm-list { padding: 0 0.2rem; }
    .dc-dm-section-label { justify-content: center; padding: 0.5rem 0.2rem 0.2rem; }
    .dc-new-dm-btn { font-size: 0.9rem; }
}

.dc-sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.dc-online-count {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.dc-online-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #23d160;
    flex-shrink: 0;
}
/* Main feed */
.dc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.dc-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    gap: 0.75rem;
}
.dc-main-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
}
.dc-hash { color: rgba(255,255,255,0.3); font-size: 1.1rem; }
.dc-new-post-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--crimson, #b8972e);
    border: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.dc-new-post-btn:hover { background: #c01530; }
.dc-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
@media (max-width: 640px) {
    .dc-feed {
        padding: 0.25rem 0.4rem;
    }
}
.dc-empty {
    color: rgba(255,255,255,0.25);
    font-size: 0.85rem;
    padding: 3rem 0;
    text-align: center;
}
/* Right online panel */
.dc-right {
    width: 180px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.05);
    padding: 0.75rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
@media (max-width: 900px) { .dc-right { display: none; } }
.dc-right-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    padding-bottom: 0.4rem;
}
.dc-online-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
}
.dc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    object-fit: cover;
    flex-shrink: 0;
}
.dc-status {
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}
.dc-status.online { background: #23d160; }
.dc-status.away   { background: #ffdd57; }
.dc-empty-sm { font-size: 0.75rem; color: rgba(255,255,255,0.2); padding: 0.5rem 0; }


/* ─── Instagram-style Photo Gallery ─────────────────────────── */
.photo-gallery-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(10,22,40,0.96);
    display: flex; align-items: stretch;
    opacity: 0; transition: opacity 0.22s ease;
}
.photo-gallery-overlay.is-open { opacity: 1; }

.igal-panel {
    position: absolute; inset: 0;
    background: var(--navy);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.igal-header {
    display: flex; align-items: center; justify-content: space-between;
    /* Sit BELOW the iOS status bar so the top-right X isn't hidden behind the clock/battery. */
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
    border-bottom: 1px solid rgba(212,175,55,0.2);
    background: var(--navy-light);
    flex-shrink: 0;
}
.igal-title {
    font-size: 0.95rem; font-weight: 700; color: var(--gold);
    letter-spacing: 1px; text-transform: uppercase;
}
.igal-close-btn, .igal-add-btn {
    background: rgba(255,255,255,0.08); border: none; color: #fff; cursor: pointer;
    width: 34px; height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.15s, color 0.15s;
}
.igal-close-btn:hover, .igal-add-btn:hover {
    background: rgba(212,175,55,0.12); color: var(--gold);
}

.igal-grid {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    background: var(--navy);
    align-content: start;
    padding: 2px;
}
.igal-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--navy-light);
}
.igal-thumb-img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
    transition: transform 0.18s;
}
.igal-thumb:hover .igal-thumb-img { transform: scale(1.05); }
.igal-thumb-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.78));
    padding: 18px 7px 6px;
    font-size: 0.6rem;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    pointer-events: none;
}

.igal-loading, .igal-empty {
    grid-column: 1/-1; padding: 3rem 1rem;
    text-align: center; color: rgba(255,255,255,0.35);
    font-size: 0.9rem; line-height: 1.6;
}

/* Detail view — slides in from right */
.igal-detail {
    position: absolute; inset: 0;
    background: var(--navy);
    overflow-y: auto;
    animation: igalSlideIn 0.22s ease;
}
@keyframes igalSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.igal-detail-inner { display: flex; flex-direction: column; min-height: 100%; }

.igal-detail-header {
    display: flex; align-items: center; justify-content: space-between;
    /* Below the iOS status bar so the top-right X is reachable, not under the clock/battery. */
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
    border-bottom: 1px solid rgba(212,175,55,0.15);
    background: var(--navy-light);
    flex-shrink: 0;
}
.igal-back-btn {
    background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.15s, color 0.15s;
}
.igal-back-btn:hover { background: rgba(212,175,55,0.12); color: var(--gold); }
.igal-detail-date {
    font-size: 0.82rem; color: var(--gold); font-weight: 600; letter-spacing: 0.5px;
}

.igal-detail-img-wrap {
    width: 100%; background: var(--navy-medium);
    display: flex; align-items: center; justify-content: center;
    max-height: 55vh; overflow: hidden;
}
.igal-detail-img {
    width: 100%; max-height: 55vh; object-fit: contain;
    display: block;
}

.igal-detail-body {
    padding: 1rem 1.25rem 2rem;
    flex: 1;
}
.igal-caption-wrap { margin-bottom: 1rem; }
.igal-caption {
    font-size: 0.9rem; color: rgba(255,255,255,0.8); line-height: 1.5;
    min-height: 1.5em; outline: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 4px;
    transition: border-color 0.15s;
}
.igal-caption[contenteditable="true"] {
    border-bottom-color: rgba(212,175,55,0.4);
}
.igal-edit-cap-btn {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.35); font-size: 0.78rem;
    display: flex; align-items: center; gap: 5px;
    padding: 0; margin-top: 6px;
    transition: color 0.15s;
}
.igal-edit-cap-btn:hover { color: var(--gold); }

.igal-detail-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.igal-share-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--crimson); color: #fff;
    border: none; border-radius: 8px; cursor: pointer;
    padding: 0.65rem 1rem; font-size: 0.85rem; font-weight: 600;
    transition: background 0.15s; width: 100%; justify-content: center;
}
.igal-share-btn:hover { background: var(--crimson-dark); }
.igal-remove-album-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; cursor: pointer;
    padding: 0.65rem 1rem; font-size: 0.85rem; font-weight: 600;
    transition: background 0.15s, border-color 0.15s; width: 100%; justify-content: center;
}
.igal-remove-album-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.igal-delete-photo-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(220,38,38,0.1); color: #f87171;
    border: 1px solid rgba(220,38,38,0.3); border-radius: 8px; cursor: pointer;
    padding: 0.65rem 1rem; font-size: 0.85rem; font-weight: 600;
    transition: background 0.15s, border-color 0.15s; width: 100%; justify-content: center;
}
.igal-delete-photo-btn:hover { background: rgba(220,38,38,0.2); border-color: rgba(220,38,38,0.6); }

/* ============================================================
   PIONEER GLOBAL THEME OVERRIDE
   Consistent navy / crimson / gold across ALL pages
   ============================================================ */

/* ── Page headers — all pages ───────────────────────────── */
.page-header {
    background: var(--navy-light);
    border-bottom: 1px solid rgba(212,175,55,0.15);
    padding: 0.9rem 1.25rem;
    padding-top: calc(0.9rem + var(--safe-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--crimson) 0%, transparent 100%);
}
.page-header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.7rem;
    color: var(--white);
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1;
}
.page-header p,
.page-header .page-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin: 0.2rem 0 0;
    letter-spacing: 0.02em;
    text-transform: none;
}
.page-header-title { flex: 1; }

/* Admin header — matches page-header */
.admin-header {
    background: var(--navy-light);
    border-bottom: 1px solid rgba(212,175,55,0.15);
    padding: 0.9rem 1.25rem;
    padding-top: calc(0.9rem + var(--safe-top));
    position: relative;
    margin-bottom: 1.25rem;
}
.admin-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--crimson) 0%, transparent 100%);
}
.admin-header h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.7rem;
    color: var(--white);
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1;
}
.admin-header p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin: 0.2rem 0 0;
}

/* ── Section headings — all pages ───────────────────────── */
.section-header h2,
.mrt-category-title,
.available-assessments h2,
.assessment-history h2,
.achievement-category h2,
.coach-page h2,
.admin-tabs + [data-panel] h2,
.settings-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(212,175,55,0.2);
    margin-bottom: 0.75rem;
}
.section-header {
    padding: 0 0 0.25rem;
    background: none;
    border: none;
    margin: 1.25rem 0 0.5rem;
}

/* ── Universal card base ─────────────────────────────────── */
.workout-card,
.mrt-module-card,
.achievement-card,
.injury-card,
.athlete-card,
.admin-stat-card,
.profile-card,
.settings-section {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

/* Left accent strip on cards */
.workout-card::before,
.mrt-module-card::before,
.injury-card::before,
.athlete-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--crimson);
    border-radius: 10px 0 0 10px;
}
.achievement-card.earned::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
    border-radius: 10px 0 0 10px;
}

/* ── Workout page ────────────────────────────────────────── */
.workout-card {
    padding: 1rem 1rem 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.workout-card:hover {
    background: var(--navy-medium) !important;
    transform: translateX(3px);
}
.workout-card-icon { display: none; } /* Remove emoji icons */
.workout-card-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.2rem;
}
.workout-card-info p { font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.meta-tag {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.meta-tag.difficulty {
    background: rgba(200, 160, 60,0.12);
    border-color: rgba(200, 160, 60,0.25);
    color: var(--crimson-light);
}
.category-btn {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.category-btn.active,
.category-btn:hover {
    background: var(--crimson);
    border-color: var(--crimson);
    color: #fff;
}

/* ── Training page — APTS & RPE additions ───────────────── */
.training-section-hdr {
    display: flex; align-items: baseline; gap: 8px;
    margin: 0 0 0.75rem; flex-wrap: wrap;
}
.training-section-hdr h2 {
    font-size: 0.95rem; font-weight: 700; color: var(--white);
    margin: 0;
}
.training-section-badge {
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em;
    color: var(--crimson-light, #e05a6a); background: rgba(200, 160, 60,0.12);
    border: 1px solid rgba(200, 160, 60,0.25); border-radius: 4px;
    padding: 2px 6px; text-transform: uppercase;
}
.training-section-sub {
    font-size: 0.72rem; color: rgba(255,255,255,0.35); margin-left: auto;
}

/* APTS movement pattern grid */
.apts-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px; margin-bottom: 0.5rem;
}
.apts-card {
    background: var(--navy-light); border: 1px solid rgba(255,255,255,0.07);
    border-left: 3px solid var(--crimson); border-radius: 8px;
    padding: 10px 10px 8px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    overflow: hidden;
}
.apts-card:hover { background: var(--navy-medium, #1c2640); border-left-color: var(--gold); }
.apts-card.open  { background: var(--navy-medium, #1c2640); border-left-color: var(--gold); }
.apts-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.apts-icon { font-size: 1rem; line-height: 1; }
.apts-label { font-size: 0.82rem; font-weight: 800; color: var(--white); letter-spacing: 0.02em; text-transform: uppercase; }
.apts-desc {
    font-size: 0.72rem; color: rgba(255,255,255,0.5); margin: 0 0 6px; line-height: 1.4;
}
.apts-exercises {
    font-size: 0.68rem; color: rgba(255,255,255,0.35);
    line-height: 1.5; display: none;
}
.apts-muscles {
    font-size: 0.65rem; color: var(--gold, #c8a03c);
    margin-top: 5px; font-weight: 600; display: none;
}
.apts-card.open .apts-exercises,
.apts-card.open .apts-muscles { display: block; }

/* RPE tag on session cards */
.training-rpe-tag {
    background: rgba(200,160,60,0.1) !important;
    border-color: rgba(200,160,60,0.2) !important;
    color: var(--gold, #c8a03c) !important;
}

/* RPE Log Modal */
.rpe-modal-content { max-width: 380px; }
.rpe-modal-body { padding: 1rem 1.25rem 1.25rem; }
.rpe-section { margin-bottom: 1rem; }
.rpe-label {
    display: block; font-size: 0.78rem; font-weight: 700;
    color: rgba(255,255,255,0.7); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.rpe-hint { font-size: 0.7rem; color: #6b7280; margin-bottom: 8px; }
.rpe-scale { display: flex; gap: 5px; flex-wrap: wrap; }
.rpe-btn {
    width: 34px; height: 34px; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--navy-light); color: rgba(255,255,255,0.55);
    font-size: 0.82rem; font-weight: 700; cursor: pointer;
    transition: all 0.15s;
}
.rpe-btn:hover { border-color: var(--gold); color: var(--gold); }
.rpe-btn.active {
    background: var(--gold, #c8a03c); border-color: var(--gold);
    color: #111; font-weight: 800;
}
.rpe-selected-label {
    margin-top: 8px; font-size: 0.78rem; color: var(--gold, #c8a03c);
    font-weight: 600; min-height: 18px;
}
.rpe-duration-input {
    width: 100%; padding: 8px 12px; border-radius: 6px;
    background: var(--navy-light); border: 1px solid rgba(255,255,255,0.1);
    color: var(--white); font-size: 0.9rem;
}
.rpe-notes-input {
    width: 100%; padding: 8px 12px; border-radius: 6px;
    background: var(--navy-light); border: 1px solid rgba(255,255,255,0.1);
    color: var(--white); font-size: 0.82rem; resize: vertical;
    font-family: inherit;
}
.rpe-confirm-btn {
    width: 100%; padding: 12px; border-radius: 8px;
    background: var(--crimson); border: none; color: #fff;
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
    letter-spacing: 0.04em; transition: opacity 0.15s;
}
.rpe-confirm-btn:hover { opacity: 0.88; }

/* ══════════════════════════════════════════════════════════
   TRAINING PAGE — STRUCTURED PROGRAMMES
   ══════════════════════════════════════════════════════════ */

/* ── My Programme card ──────────────────────────────────── */
.my-programme-card {
    background: linear-gradient(135deg, #1c2b46 0%, #121a2c 100%);
    border: 1px solid rgba(201,168,76,0.22);
    border-left: 3px solid var(--gold, #c8a03c);
    border-radius: 14px;
    padding: 1.05rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05);
}
.my-prog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.my-prog-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.my-prog-name::before {
    content: 'ACTIVE PROGRAMME';
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gold, #c8a03c);
    margin-bottom: 3px;
}
.my-prog-week {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

/* Progress bar */
.prog-progress-bar {
    height: 7px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.4rem;
    margin-bottom: 5px;
}
.prog-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold, #c8a03c), #e8b84b);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.prog-progress-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.42);
    margin-bottom: 0.75rem;
}
.prog-week-note {
    font-size: 0.77rem;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.04);
    border-left: 2px solid var(--gold, #c8a03c);
    padding: 7px 10px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.875rem;
    font-style: italic;
}
.my-prog-next {
    margin-bottom: 0.75rem;
}
.my-prog-next-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    margin-bottom: 2px;
}
.my-prog-next-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 2px;
}
.my-prog-next-meta {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.38);
}
.prog-start-btn {
    width: 100%;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: opacity 0.15s;
}
.prog-start-btn:hover { opacity: 0.88; }
.prog-change-btn {
    background: transparent;
    color: rgba(255,255,255,0.4);
    border: none;
    padding: 4px 0;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.prog-change-btn:hover { color: rgba(255,255,255,0.7); }

/* ── Goal Pathway Tabs ────────────────────────────────────── */
.pathway-tabs {
    display: flex; flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow-x: auto;
    scrollbar-width: none;
}
.pathway-tabs::-webkit-scrollbar { display: none; }
.pathway-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.42);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.625rem 1rem;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.pathway-tab:hover { color: rgba(255,255,255,0.7); }
.pathway-tab.active {
    color: var(--white);
    border-bottom-color: var(--crimson, #c8a03c);
}

/* ── Active Programme Collapse ─────────────────────────────────── */
.my-prog-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.prog-collapse-btn {
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 9px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold, #c8a03c);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.prog-collapse-btn:hover {
    background: rgba(201,168,76,0.2);
    color: var(--gold-light, #e8b84b);
}
.collapse-icon {
    display: inline-block;
    transition: transform 0.3s;
}
.my-prog-collapsible {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}
.my-prog-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

/* ── Programme Setup Modal ───────────────────────────────────── */
.prog-setup-modal {
    max-width: 480px;
    border-radius: 12px;
}

/* ── Programme Detail Modal ────────────────────────────────────── */
.prog-detail-modal {
    max-width: 600px;
    border-radius: 12px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.prog-detail-modal .modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 60px);
}
.prog-detail-overview {
    margin-bottom: 1.5rem;
}
.prog-detail-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
}
.prog-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.prog-detail-stat {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.625rem;
    text-align: center;
}
.prog-detail-stat-label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.prog-detail-stat-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--white);
}
.prog-detail-weeks h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.prog-detail-week {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 0.625rem;
    overflow: hidden;
}
.prog-detail-week-header {
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.prog-detail-week-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--crimson-light, #e85c7a);
}
.prog-detail-week-theme {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    flex: 1;
}
.prog-detail-week-rpe {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
}
.prog-detail-sessions {
    list-style: none;
    padding: 0;
    margin: 0;
}
.prog-detail-session {
    border-top: 1px solid rgba(255,255,255,0.05);
}
.prog-detail-session-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}
.prog-detail-session-header:hover {
    background: rgba(255,255,255,0.03);
}
.prog-detail-session-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    flex: 1;
}
.prog-detail-session-meta {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    margin-right: 0.5rem;
}
.prog-detail-session-toggle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
}
.prog-detail-exercises {
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 0.5rem 0.75rem;
}
.prog-detail-exercise {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.prog-detail-exercise:last-child {
    border-bottom: none;
}
.prog-detail-ex-name {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.75);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.prog-detail-ex-meta {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
}
.prog-detail-yt-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--crimson, #c8a03c);
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.6rem;
    transition: background 0.15s;
    flex-shrink: 0;
}
.prog-detail-yt-link:hover {
    background: #d01040;
}
.prog-detail-yt-grey {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255,255,255,0.4);
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.prog-detail-yt-grey:hover {
    color: rgba(255,255,255,0.6);
}
.prog-detail-no-video {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    cursor: not-allowed;
}
.prog-detail-ex-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.prog-detail-ex-right {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}
.prog-detail-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.prog-setup-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.prog-setup-meta {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1.5rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
}
.form-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--white);
    font-size: 0.95rem;
}
.form-input:focus {
    outline: none;
    border-color: var(--crimson);
}
.form-hint {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.75rem;
}
.day-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}
.day-checkbox {
    position: relative;
    cursor: pointer;
}
.day-checkbox input {
    position: absolute;
    opacity: 0;
}
.day-checkbox span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    transition: all 0.2s;
}
.day-checkbox:hover span {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}
.day-checkbox input:checked + span {
    background: var(--crimson);
    border-color: var(--crimson);
    color: #fff;
}

/* ── Pathway Panels ────────────────────────────────────────── */
.pathway-panels { padding-top: 1rem; }
.pathway-panel { display: none; }
.pathway-panel.active { display: block; }
.pathway-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.42);
    margin: 0 0 1.125rem;
    line-height: 1.5;
}
.pw-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    margin-bottom: 0.5rem;
}
.pw-programmes { margin-bottom: 1.25rem; }
.pw-sessions   { margin-bottom: 1.25rem; }

/* ── Programme card grid ──────────────────────────────────── */
.prog-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
    margin-bottom: 1rem;
}

@media (max-width: 1024px) {
    .prog-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .prog-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.prog-card {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 120px;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.prog-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.14);
}
.prog-card-active {
    cursor: default;
}
.prog-card-soon {
    cursor: default;
}
.prog-card-active {
    border-color: rgba(200,160,60,0.45);
    background: rgba(200,160,60,0.06);
}
.prog-card-active:hover {
    border-color: rgba(200,160,60,0.6);
}
.prog-card-active-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold, #c8a03c);
    margin-bottom: 2px;
}
.prog-card-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.3;
}
.prog-card-sub {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.3;
}
.prog-card-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.45;
    flex: 1;
    margin-top: 2px;
    /* Clamp the blurb to 3 lines — full description shows on click (detail modal). */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.prog-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 0.6rem;
}
.prog-card-meta span {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 4px 9px;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
}
/* First chip = category, tinted gold to read as the primary tag */
.prog-card-meta span:first-child {
    color: #e8c87a;
    background: rgba(200, 160, 60, 0.16);
    border-color: rgba(200, 160, 60, 0.35);
}
.prog-select-btn {
    margin-top: 0.625rem;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: opacity 0.15s;
    white-space: nowrap;          /* one line */
    overflow: hidden;
    text-overflow: ellipsis;      /* never bleed past the button edge */
}
.prog-select-btn:hover { opacity: 0.85; }

/* ── Coming soon card ─────────────────────────────────────── */
.prog-card-soon {
    opacity: 0.6;
    pointer-events: none;
}
.prog-card-active-badge,
.coming-soon-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-bottom: 2px;
}
.coming-soon-badge {
    color: rgba(200,160,60,0.8);
}

/* ── Recommended card ─────────────────────────────────────── */
.prog-card-recommended {
    border-color: rgba(100, 180, 255, 0.4);
    background: rgba(100, 180, 255, 0.05);
}
.prog-card-recommended:hover {
    border-color: rgba(100, 180, 255, 0.6);
    background: rgba(100, 180, 255, 0.08);
}
.recommended-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(100, 180, 255, 0.9);
    background: rgba(100, 180, 255, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 2px;
}

/* ── Who It's For chips ───────────────────────────────────── */
.pathway-for-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
    list-style: none;
    padding-left: 0;
}
.pathway-for-chip {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* ── Assessment CTA button ────────────────────────────────── */
.pathway-assessment-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    background: rgba(200, 160, 60,0.08);
    border: 1px solid rgba(200, 160, 60,0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.pathway-assessment-cta:hover {
    background: rgba(200, 160, 60,0.14);
    border-color: rgba(200, 160, 60,0.5);
}
.assessment-cta-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.02em;
}
.assessment-cta-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.4;
}

/* ── Coming soon programme rows ───────────────────────────── */
.programme-row-soon {
    opacity: 0.55;
    pointer-events: none;
}
.coming-soon-badge {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200,160,60,0.75);
    border: 1px solid rgba(200,160,60,0.3);
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* ── Exercise log row (reps + load inputs) ────────────────── */
.ex-log-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.ex-log-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ex-log-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}
.ex-log-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.82rem;
    padding: 0.375rem 0.5rem;
    width: 100%;
    box-sizing: border-box;
}
.ex-log-input:focus {
    outline: none;
    border-color: rgba(200,160,60,0.45);
    background: rgba(255,255,255,0.07);
}
.ex-log-input::placeholder { color: rgba(255,255,255,0.25); }

/* ── Session complete button (in session detail) ──────────── */
.session-complete-btn {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.session-complete-btn:hover { opacity: 0.88; }

/* ── Session Diary screen ─────────────────────────────────── */
.diary-screen {
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.diary-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.diary-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
.diary-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.diary-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.diary-chip span {
    font-size: 0.58rem;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.diary-chip:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.2);
    color: var(--white);
}
.diary-chip.selected {
    background: rgba(200, 160, 60,0.15);
    border-color: rgba(200, 160, 60,0.55);
    color: var(--white);
}
.diary-chip.selected span { color: rgba(255,255,255,0.5); }

.diary-rpe-scale {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.diary-rpe-btn {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.diary-rpe-btn:hover { background: rgba(255,255,255,0.09); color: var(--white); }
.diary-rpe-btn.active {
    background: rgba(200, 160, 60,0.2);
    border-color: rgba(200, 160, 60,0.6);
    color: var(--white);
}
.diary-duration-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    width: 100px;
}
.diary-duration-input:focus { outline: none; border-color: rgba(200,160,60,0.45); }
.diary-notes-input {
    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.85rem;
    line-height: 1.5;
    padding: 0.75rem;
    resize: vertical;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.diary-notes-input:focus { outline: none; border-color: rgba(200,160,60,0.35); }
.diary-notes-input::placeholder { color: rgba(255,255,255,0.2); }
.diary-save-btn {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.15s;
}
.diary-save-btn:hover { opacity: 0.88; }

/* ── Assessment Modal ─────────────────────────────────────── */
.assessment-modal-content {
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
}
.assessment-questions-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem 1.25rem 0;
}
.assessment-question {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 1.25rem;
}
.assessment-question:last-child { border-bottom: none; }
.assessment-q-num {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 4px;
}
.assessment-q-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.assessment-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.assessment-option {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    padding: 0.625rem 0.875rem;
    color: rgba(255,255,255,0.65);
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.assessment-option:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: var(--white);
}
.assessment-option.selected {
    background: rgba(200, 160, 60,0.12);
    border-color: rgba(200, 160, 60,0.5);
    color: var(--white);
}
.assessment-submit-btn {
    display: block;
    width: calc(100% - 2.5rem);
    margin: 1.25rem 1.25rem 1.5rem;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.assessment-submit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.assessment-submit-btn:not(:disabled):hover { opacity: 0.88; }

/* ── Assessment result ────────────────────────────────────── */
.assessment-result {
    margin: 1rem 1.25rem 0;
    background: rgba(200,160,60,0.07);
    border: 1px solid rgba(200,160,60,0.25);
    border-radius: 10px;
    padding: 1.125rem;
}
.assessment-result-level {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold, #c8a03c);
    margin-bottom: 0.75rem;
}
.assessment-result-rec {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.75rem;
}
.result-rec-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
.result-rec-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
}
.assessment-result-note {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    margin: 0;
}

/* ── Session Detail Modal ─────────────────────────────────── */
.session-detail-content {
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-subtitle {
    font-size: 0.77rem;
    color: rgba(255,255,255,0.45);
    margin: 2px 0 0;
}
.session-detail-body { padding: 1rem 1.25rem 1.5rem; }
.session-detail-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.875rem;
}
.session-week-note {
    font-size: 0.77rem;
    color: rgba(255,255,255,0.6);
    background: rgba(200,160,60,0.07);
    border-left: 2px solid var(--gold, #c8a03c);
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1rem;
    font-style: italic;
}

/* ── Exercise list ──────────────────────────────────────────── */
.session-exercises {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.125rem;
}
.session-exercise-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.75rem;
}
.session-ex-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.45rem;
}
.session-ex-num {
    width: 22px;
    height: 22px;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    font-weight: 800;
    flex-shrink: 0;
}
.session-ex-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.session-ex-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--white);
}
/* YouTube demo link in exercise header */
.ex-video-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ff4444;
    text-decoration: none;
    background: rgba(255,68,68,0.1);
    border: 1px solid rgba(255,68,68,0.25);
    border-radius: 4px;
    padding: 2px 7px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ex-video-link:hover {
    background: rgba(255,68,68,0.2);
    color: #ff6666;
}
.ex-video-link svg { flex-shrink: 0; }
.session-ex-movement {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(200,160,60,0.14);
    color: var(--gold, #c8a03c);
    text-transform: uppercase;
}
.session-ex-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.4rem;
}
.ex-detail-item {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.48);
}
.session-ex-notes {
    font-size: 0.71rem;
    color: rgba(255,255,255,0.38);
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* ── Set checkboxes ─────────────────────────────────────────── */
.session-sets-tracker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.set-checkbox {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.set-checkbox:hover { border-color: var(--gold, #c8a03c); }
.set-checkbox.completed {
    background: var(--crimson, #c8a03c);
    border-color: var(--crimson, #c8a03c);
    color: var(--white);
}
.set-num { font-size: 0.7rem; font-weight: 800; pointer-events: none; }

/* ── Session log / complete section ───────────────────────── */
.session-log-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 1rem;
}
.session-complete-btn {
    width: 100%;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
}
.session-complete-btn:hover { opacity: 0.88; }

/* ── MRT page ────────────────────────────────────────────── */
.mrt-module-card {
    padding: 1rem 1rem 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}
.mrt-module-card:hover { background: var(--navy-medium) !important; }
.mrt-module-card.completed::before { background: var(--gold); }
.mrt-module-card.in-progress::before { background: var(--crimson); }
.mrt-module-num {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
.mrt-module-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    margin: 0.3rem 0;
}
.mrt-module-desc { font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.mrt-duration {
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 600;
}
.mrt-progress-banner {
    background: var(--navy-light);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.mrt-stat-val {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.6rem;
    color: var(--gold);
    line-height: 1;
}
.mrt-stat-lbl { font-size: 0.65rem; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.mrt-progress-bar-wrap {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.mrt-progress-bar { height: 100%; background: var(--crimson); border-radius: 2px; }
.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}
.status-badge.completed {
    background: rgba(212,175,55,0.15);
    color: var(--gold);
    border: 1px solid rgba(212,175,55,0.3);
}
.status-badge.in-progress {
    background: rgba(200, 160, 60,0.15);
    color: var(--crimson-light);
    border: 1px solid rgba(200, 160, 60,0.3);
}
.status-badge.not-started {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.35);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Assessment page ─────────────────────────────────────── */
/* Assessment category badges (inherit ex-card-badge base styles) */
.assessment-type-badge-military {
    background: rgba(200, 160, 60, 0.2);
    color: #ff6b85;
    border: 1px solid rgba(200, 160, 60, 0.3);
}

.assessment-type-badge-aerobic {
    background: rgba(23, 162, 184, 0.2);
    color: #4dd0e1;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.assessment-type-badge-functional {
    background: rgba(243, 156, 18, 0.2);
    color: #ffb84d;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.assessment-type-badge-strength {
    background: rgba(52, 199, 89, 0.2);
    color: #66d9a9;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.assessment-type-badge-general {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ex-card-badge-time {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Assessment Detail Modal (matching programme detail) */
.assess-detail-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.assess-detail-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.assess-detail-instructions,
.assess-detail-equipment {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 0.95rem;
}

.assess-detail-tests {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.assess-detail-test {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
    transition: background 0.2s ease;
}

.assess-detail-test:hover {
    background: rgba(255, 255, 255, 0.04);
}

.assess-detail-test-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.assess-detail-test-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.assess-detail-test-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
}

.assess-detail-test-unit {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.assess-detail-test-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-left: 36px;
}
.test-chip {
    display: inline-block;
    font-size: 0.68rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin: 0.15rem 0.15rem 0 0;
}

.result-grade {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    margin: 0.3rem 0;
}
.result-grade.grade-pass, .result-grade.grade-excellent { color: var(--gold); }
.result-grade.grade-fail { color: var(--crimson-light); }
.result-date { font-size: 0.72rem; color: rgba(255,255,255,0.4); }

/* Assessment Results Grid (within filters) */
.assessment-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.assessment-result-card {
    background: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 1rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.assessment-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ── Awards / Achievements page ──────────────────────────── */
.achievements-summary {
    display: flex;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--navy-light);
    border-bottom: 1px solid rgba(212,175,55,0.12);
}
.achieve-stat { text-align: center; flex: 1; }
.achieve-stat-val {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2rem;
    color: var(--white);
    line-height: 1;
}
.achieve-stat.points .achieve-stat-val { color: var(--gold); }
.achieve-stat-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
}
.achievement-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.85rem 0.85rem 1.1rem;
    margin-bottom: 0.6rem;
}
.achievement-card.locked { opacity: 0.45; }
.achievement-card.locked::before { background: rgba(255,255,255,0.15); }
.achievement-icon { font-size: 1.5rem; flex-shrink: 0; }
.achievement-info { flex: 1; }
.achievement-info strong { font-size: 0.88rem; color: var(--white); font-weight: 700; }
.achievement-info p { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin: 0.1rem 0 0; }
.earned-date { font-size: 0.68rem; color: var(--gold); }
.achievement-points {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    white-space: nowrap;
}
.achievement-category h2 {
    margin: 1.25rem 1.25rem 0.6rem;
}

/* ── Rehab page ──────────────────────────────────────────── */
.injury-card {
    padding: 1rem 1rem 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.injury-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.injury-severity {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
}
.injury-severity.mild { background: rgba(212,175,55,0.15); color: var(--gold); border: 1px solid rgba(212,175,55,0.3); }
.injury-severity.moderate { background: rgba(200, 160, 60,0.15); color: var(--crimson-light); border: 1px solid rgba(200, 160, 60,0.3); }
.injury-severity.severe { background: rgba(200, 160, 60,0.3); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.4); }
.injury-progress-bar { background: rgba(255,255,255,0.08); border-radius: 2px; }
.injury-progress-fill { background: var(--crimson); border-radius: 2px; }
.body-region {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    border-radius: 8px;
    transition: all 0.15s;
}
.body-region:hover { border-color: var(--crimson); color: var(--white); }
.body-region.has-injury { border-color: var(--crimson); background: rgba(200, 160, 60,0.1); color: var(--white); }

/* ── Profile page ────────────────────────────────────────── */
.profile-card {
    padding: 1.5rem !important;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.profile-stats {
    display: flex;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.profile-stat {
    flex: 1;
    padding: 0.85rem;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.07);
}
.profile-stat:last-child { border-right: none; }
.profile-stat-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.8rem;
    color: var(--white);
    line-height: 1;
}
.profile-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
}
.profile-stat-edit { color: var(--gold); font-size: 0.8rem; }
.settings-section {
    padding: 1rem 1.1rem !important;
    margin-bottom: 0.75rem;
}
.settings-section h3 {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--gold) !important;
    margin-bottom: 0.6rem !important;
    padding-bottom: 0.4rem !important;
    border-bottom: 1px solid rgba(212,175,55,0.15) !important;
}
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.settings-item:last-child { border-bottom: none; }
.settings-item-icon { margin-right: 0.5rem; font-size: 0.9rem; }
.settings-item-text { font-size: 0.85rem; color: rgba(255,255,255,0.75); }
.settings-item-right { font-size: 0.82rem; color: rgba(255,255,255,0.45); }

/* ── Admin page ──────────────────────────────────────────── */
.admin-stat-card .stat-number {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 2rem !important;
    color: var(--white) !important;
}
.admin-stat-card .stat-label {
    font-size: 0.65rem !important;
    color: rgba(255,255,255,0.4) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-tabs {
    display: flex;
    gap: 0;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.admin-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}
.admin-tab.active {
    background: var(--crimson);
    color: #fff;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead tr {
    background: var(--navy-medium);
}
.admin-table th {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
.admin-table td {
    padding: 0.65rem 0.8rem;
    font-size: 0.83rem;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.admin-search {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--white);
    border-radius: 7px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    width: 100%;
}
.admin-search::placeholder { color: rgba(255,255,255,0.3); }
.admin-search:focus { outline: none; border-color: var(--gold); }

/* ── Community / Discord ─────────────────────────────────── */
.dc-sidebar {
    background: var(--navy-dark, #060f1e) !important;
    border-right: 1px solid rgba(212,175,55,0.1) !important;
}
.dc-sidebar-header {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--gold) !important;
    border-bottom: 1px solid rgba(212,175,55,0.15) !important;
}
.dc-section-label {
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    color: rgba(255,255,255,0.3) !important;
    text-transform: uppercase !important;
}
.dc-channel-item {
    border-radius: 6px;
    color: rgba(255,255,255,0.5) !important;
    transition: all 0.15s;
}
.dc-channel-item:hover { background: rgba(255,255,255,0.06) !important; color: rgba(255,255,255,0.9) !important; }
.dc-channel-item.active {
    background: rgba(200, 160, 60,0.15) !important;
    color: var(--white) !important;
}
.dc-channel-hash { color: rgba(255,255,255,0.3) !important; }
.dc-channel-item.active .dc-channel-hash { color: var(--crimson-light) !important; }
.dc-join-btn {
    background: rgba(200, 160, 60,0.2) !important;
    border: 1px solid rgba(200, 160, 60,0.35) !important;
    color: var(--crimson-light) !important;
    font-size: 0.65rem !important;
}
.dc-main-header {
    background: var(--navy-light) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
.dc-main-title { font-weight: 700 !important; color: var(--white) !important; }
.dc-hash { color: var(--crimson-light) !important; }
.dc-new-post-btn {
    background: var(--crimson) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
}
.dc-new-post-btn:hover { background: var(--crimson-dark) !important; }
.dc-right {
    background: var(--navy-dark, #060f1e) !important;
    border-left: 1px solid rgba(212,175,55,0.08) !important;
}
.dc-right-label {
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    color: rgba(255,255,255,0.3) !important;
    text-transform: uppercase !important;
}
.dc-online-dot { background: var(--success) !important; }
.dc-add-channel-btn {
    background: rgba(212,175,55,0.1) !important;
    border: 1px solid rgba(212,175,55,0.25) !important;
    color: var(--gold) !important;
    font-size: 0.72rem !important;
}

/* ── Nutrition page ──────────────────────────────────────── */
.calorie-ring .progress { stroke: var(--crimson) !important; }
.calorie-ring .bg { stroke: rgba(255,255,255,0.06) !important; }
.ring-value { color: var(--white) !important; }
.ring-label { color: rgba(255,255,255,0.4) !important; }
.meal-section {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
    border-radius: 10px !important;
    margin-bottom: 0.75rem !important;
}
.meal-header { border-bottom: 1px solid rgba(255,255,255,0.06) !important; }
.meal-type-label {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.5) !important;
}
.add-food-btn {
    color: var(--gold) !important;
    border-color: rgba(212,175,55,0.3) !important;
}
.add-food-btn:hover { background: rgba(212,175,55,0.08) !important; }
.macro-bar .macro-fill { background: var(--crimson) !important; }
.macro-bar .macro-fill.protein { background: var(--crimson) !important; }
.macro-bar .macro-fill.carbs { background: var(--gold) !important; }
.macro-bar .macro-fill.fat { background: var(--navy-medium) !important; border: 1px solid rgba(255,255,255,0.2) !important; }

/* ── Buttons global polish ───────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    width: auto !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, #b8972e 100%) !important;
    box-shadow: 0 4px 12px rgba(200, 160, 60, 0.4) !important;
}
.btn-secondary {
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.7) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    font-weight: 600 !important;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1) !important;
    color: var(--white) !important;
    border-color: rgba(255,255,255,0.25) !important;
}

/* ── Empty states ────────────────────────────────────────── */
.empty-state {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; color: var(--gold); }
.empty-state h3 { font-size: 1.1rem; color: var(--white); margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.82rem; color: rgba(255,255,255,0.4); }

/* ── Coach / Athletes ────────────────────────────────────── */
.athlete-card {
    padding: 1rem 1rem 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
}
.athlete-card:hover { background: var(--navy-medium) !important; }
.athlete-avatar {
    width: 36px; height: 36px;
    background: var(--crimson);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}



/* ============================================================
   NUTRITION THEME OVERRIDE — calm, home-consistent
   ============================================================ */

/* ── Calorie summary — compact, subdued ─────────────────── */
.calorie-summary {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 10px !important;
    padding: 1rem 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 1.25rem !important;
    margin-bottom: 1rem !important;
}
.calorie-ring {
    width: 72px !important;
    height: 72px !important;
    flex-shrink: 0 !important;
}
.calorie-ring .progress { stroke: var(--crimson) !important; }
.calorie-ring .bg { stroke: rgba(255,255,255,0.07) !important; }
.ring-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1.2rem !important;
    color: var(--white) !important;
    line-height: 1 !important;
}
.ring-label {
    font-size: 0.55rem !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.35) !important;
}
.calorie-details { flex: 1 !important; }
.calorie-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.3rem 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.calorie-row:last-child { border-bottom: none !important; }
.calorie-row span:first-child {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}
.calorie-row span:last-child {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1rem !important;
    color: var(--white) !important;
    letter-spacing: 0.03em !important;
}

/* ── Macro cards — navy theme, no bright colors ─────────── */
.macro-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 1rem !important;
}
.macro-card {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-top: none !important;
    border-radius: 8px !important;
    padding: 0.65rem 0.5rem !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
}
/* Thin top accent using ::before — themed */
.macro-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0; left: 0; right: 0 !important;
    height: 2px !important;
}
.macro-card.protein::before { background: var(--crimson) !important; }
.macro-card.carbs::before { background: var(--gold) !important; }
.macro-card.fat::before { background: rgba(255,255,255,0.25) !important; }
/* Remove old colored borders */
.macro-card.protein { border-top: none !important; }
.macro-card.carbs   { border-top: none !important; }
.macro-card.fat     { border-top: none !important; }
.macro-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1.25rem !important;
    color: var(--white) !important;
    display: block !important;
    line-height: 1.1 !important;
}
.macro-label {
    font-size: 0.6rem !important;
    color: rgba(255,255,255,0.35) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
}

/* ── Water section — navy theme, no blue ────────────────── */
.water-section {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 10px !important;
    padding: 0.85rem 1rem !important;
    margin-bottom: 1rem !important;
}
.water-section-title {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: var(--gold) !important;
}
.water-log-btn {
    background: rgba(212,175,55,0.08) !important;
    border: 1px solid rgba(212,175,55,0.25) !important;
    color: var(--gold) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 0.28rem 0.65rem !important;
    border-radius: 5px !important;
}
.water-log-btn:hover { background: rgba(212,175,55,0.15) !important; }
.water-glass { color: rgba(255,255,255,0.1) !important; width: 18px !important; }
.water-glass.filled { color: var(--gold) !important; }
.water-glass.partial { color: rgba(212,175,55,0.35) !important; }
.water-total {
    font-size: 0.7rem !important;
    color: rgba(255,255,255,0.3) !important;
    letter-spacing: 0.04em !important;
}

/* ── AI suggestions banner — quiet row ──────────────────── */
.ai-suggestions-banner {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-left: 2px solid var(--gold) !important;
    border-radius: 8px !important;
    padding: 0.7rem 1rem !important;
    margin: 0.75rem 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
}
.ai-banner-content {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
}
.ai-banner-content svg { color: var(--gold) !important; width: 16px !important; height: 16px !important; }
.ai-banner-content h3 {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: var(--white) !important;
    margin: 0 !important;
}
.ai-banner-content p {
    font-size: 0.72rem !important;
    color: rgba(255,255,255,0.35) !important;
    margin: 0 !important;
}
/* AI button — small ghost */
.ai-suggestions-banner .btn-primary {
    background: none !important;
    border: 1px solid rgba(212,175,55,0.35) !important;
    color: var(--gold) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 5px !important;
    width: auto !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}
.ai-suggestions-banner .btn-primary:hover {
    background: rgba(212,175,55,0.08) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Meal sections — clean rows ─────────────────────────── */
.meal-section {
    background: var(--navy-light) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
}
.meal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.7rem 1rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    margin-bottom: 0 !important;
}
.meal-header h3 {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.5) !important;
    margin: 0 !important;
}
.add-food-btn {
    background: none !important;
    border: none !important;
    color: var(--gold) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    cursor: pointer !important;
}
.add-food-btn:hover { color: var(--gold-light) !important; }
.meal-items { padding: 0.25rem 0 !important; }
.meal-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.55rem 1rem !important;
    gap: 0.75rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.meal-item:last-child { border-bottom: none !important; }
.meal-item-icon { display: none !important; }
.meal-item-info strong { font-size: 0.83rem !important; color: var(--white) !important; font-weight: 600 !important; }
.meal-item-info span { font-size: 0.68rem !important; color: rgba(255,255,255,0.35) !important; }
.meal-item-calories {
    margin-left: auto !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1rem !important;
    color: rgba(255,255,255,0.7) !important;
    white-space: nowrap !important;
}
.meal-item-delete {
    background: none !important;
    border: none !important;
    color: rgba(255,255,255,0.2) !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    padding: 0 0 0 0.25rem !important;
    line-height: 1 !important;
    transition: color 0.15s !important;
}
.meal-item-delete:hover { color: var(--crimson-light) !important; }
.empty-meal {
    padding: 0.85rem 1rem !important;
    font-size: 0.78rem !important;
    color: rgba(255,255,255,0.2) !important;
    cursor: pointer !important;
    transition: color 0.15s !important;
}
.empty-meal:hover { color: rgba(255,255,255,0.45) !important; }

/* ── Nutrition content padding ───────────────────────────── */
.nutrition-content {
    padding: 1rem 1rem 5rem !important;
}



/* ============================================================
   NUTRITION PAGE — NEW LAYOUT
   ============================================================ */
.nut-content { padding: 0.85rem 0.85rem 5rem; display: flex; flex-direction: column; gap: 0.75rem; }

@media (max-width: 480px) {
    .nut-content {
        padding: 0.6rem 0.6rem 5rem;
        gap: 0.6rem;
    }
}

/* ── Tabs (Today vs Meal Plans) ── */
.nut-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nut-main-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nut-main-tab:hover {
    color: rgba(255,255,255,0.7);
}
.nut-main-tab.active {
    color: rgba(255,255,255,0.95);
    border-bottom-color: var(--gold);
}

/* ── Stats strip ── */
.nut-stats-strip {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nut-ring-wrap {
    position: relative;
    width: 64px; height: 64px;
    flex-shrink: 0;
}
.nut-ring-svg { width: 100%; height: 100%; }
.nut-ring-bg  { stroke: rgba(255,255,255,0.06); }
.nut-ring-prog { stroke: var(--crimson); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.nut-ring-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.nut-ring-val {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem; color: var(--white); line-height: 1;
}
.nut-ring-lbl { font-size: 0.5rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.05em; }
.nut-kpi-col { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; }
.nut-kpi-row { display: flex; align-items: center; gap: 0.5rem; }
.nut-kpi { text-align: center; flex: 1; }
.nut-kpi-val { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 1.15rem; color: var(--white); display: block; line-height: 1; }
.nut-kpi-lbl { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(255,255,255,0.3); }
.nut-kpi-div { width: 1px; height: 28px; background: rgba(255,255,255,0.08); }
.nut-macro-row { display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 0.4rem; }
.nut-macro { flex: 1; text-align: center; }
.nut-macro-val { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 0.9rem; color: rgba(255,255,255,0.8); display: block; line-height: 1.1; }
.nut-macro-lbl { font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.3); }
.nut-macro-protein { color: rgba(200, 160, 60,0.8) !important; }
.nut-macro-carbs   { color: rgba(212,175,55,0.8) !important; }
.nut-macro-fat     { color: rgba(255,255,255,0.25) !important; }
.nut-water-btn {
    background: none; border: none; cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem; color: rgba(255,255,255,0.8); line-height: 1.1;
    display: flex; align-items: center; gap: 3px;
    padding: 0; width: 100%; justify-content: center;
}
.nut-water-btn svg { color: rgba(100,180,255,0.7); }

/* ── Meals 2×2 grid ── */
.nut-meals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

@media (max-width: 768px) {
    .nut-meals-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nut-meals-grid {
        gap: 0.6rem;
    }
}
.nut-meal-col {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    min-height: 110px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    .nut-meal-col {
        min-height: auto;
    }
}
.nut-meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.nut-meal-label-row { display: flex; flex-direction: column; gap: 1px; }
.nut-meal-name { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.5); }
.nut-meal-kcal { font-size: 0.6rem; color: var(--gold); }
.nut-add-btn {
    background: none; border: none; color: var(--gold);
    font-size: 1.1rem; line-height: 1; cursor: pointer;
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.15s;
}
.nut-add-btn:hover { background: rgba(212,175,55,0.12); }
.nut-meal-items { flex: 1; padding: 0.2rem 0; overflow-y: auto; max-height: 160px; }
.nut-meal-item {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.nut-meal-item:last-child { border-bottom: none; }
.nut-item-name { flex: 1; font-size: 0.72rem; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nut-item-kcal { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 0.85rem; color: rgba(255,255,255,0.5); white-space: nowrap; }
.nut-item-del { background: none; border: none; color: rgba(255,255,255,0.15); font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; transition: color 0.15s; }
.nut-item-del:hover { color: var(--crimson-light); }
.nut-meal-empty { padding: 0.9rem 0.7rem; font-size: 0.72rem; color: rgba(255,255,255,0.18); cursor: pointer; flex: 1; }
.nut-meal-empty:hover { color: rgba(255,255,255,0.4); }

/* ── AI Meals Bottom Sheet ── */
.ai-meals-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-end;
    opacity: 0; transition: opacity 0.22s ease;
}
.ai-meals-overlay.is-open { opacity: 1; }
.aim-panel {
    background: var(--navy);
    width: 100%; max-height: 88vh;
    border-radius: 18px 18px 0 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    transform: translateY(40px);
    transition: transform 0.22s ease;
}
.ai-meals-overlay.is-open .aim-panel { transform: translateY(0); }

.aim-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem 0.75rem;
    border-bottom: 1px solid rgba(212,175,55,0.15);
    flex-shrink: 0;
}
.aim-header-left { display: flex; align-items: center; gap: 0.5rem; }
.aim-title { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 1.2rem; color: var(--gold); letter-spacing: 0.05em; }
.aim-close { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.15s; }
.aim-close:hover { background: rgba(255,255,255,0.08); }

.aim-prefs-bar {
    padding: 0.45rem 1.1rem;
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    background: rgba(212,175,55,0.04);
    border-bottom: 1px solid rgba(212,175,55,0.08);
    flex-shrink: 0;
}
.aim-pref-tag {
    font-size: 0.65rem; font-weight: 700;
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.25);
    color: var(--gold);
    padding: 0.18rem 0.5rem; border-radius: 4px;
    text-transform: capitalize;
}
.aim-allergy {
    background: rgba(200, 160, 60,0.1) !important;
    border-color: rgba(200, 160, 60,0.25) !important;
    color: var(--crimson-light) !important;
}
.aim-prefs-note { font-size: 0.6rem; color: rgba(255,255,255,0.25); margin-left: auto; }

.aim-tabs {
    display: flex; gap: 0; padding: 0.6rem 0.85rem 0;
    flex-shrink: 0;
}
.aim-tab {
    flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.35); font-size: 0.78rem; font-weight: 700;
    padding: 0.4rem 0; cursor: pointer; transition: all 0.15s;
    text-transform: capitalize;
}
.aim-tab.active { color: var(--white); border-bottom-color: var(--crimson); }

.aim-cards-wrap { flex: 1; overflow-y: auto; padding: 0.85rem; }
.aim-cards-scroll { display: flex; flex-direction: column; gap: 0.75rem; }

.aim-card {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.aim-card-visual {
    height: 110px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.aim-card-emoji { font-size: 3rem; }
.aim-card-macros-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.35);
    display: flex; gap: 0.75rem; justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem; color: rgba(255,255,255,0.8); font-weight: 700;
}
.aim-card-body { padding: 0.75rem 0.9rem; }
.aim-card-title { font-size: 0.95rem; font-weight: 700; color: var(--white); margin: 0 0 0.25rem; }
.aim-card-desc { font-size: 0.76rem; color: rgba(255,255,255,0.45); margin: 0 0 0.5rem; line-height: 1.4; }
.aim-card-meta { display: flex; gap: 0.85rem; font-size: 0.68rem; color: rgba(255,255,255,0.3); margin-bottom: 0.65rem; }
.aim-card-actions { display: flex; gap: 0.5rem; }
.aim-log-btn {
    flex: 1; background: var(--crimson); border: none; color: #fff;
    font-size: 0.78rem; font-weight: 700; padding: 0.45rem 0;
    border-radius: 6px; cursor: pointer; transition: background 0.15s;
}
.aim-log-btn:hover { background: var(--crimson-dark); }
.aim-detail-btn {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); font-size: 0.78rem; font-weight: 600;
    padding: 0.45rem 0.85rem; border-radius: 6px; cursor: pointer; transition: background 0.15s;
}
.aim-detail-btn:hover { background: rgba(255,255,255,0.12); }

.aim-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem; color: rgba(255,255,255,0.35); font-size: 0.85rem; }
.aim-empty { padding: 2.5rem; text-align: center; color: rgba(255,255,255,0.3); font-size: 0.85rem; }
.aim-footer-note { padding: 0.5rem 1.1rem 0.85rem; font-size: 0.65rem; color: rgba(255,255,255,0.2); text-align: center; flex-shrink: 0; }



/* ═══════════════════════════════════════════════════════
   CALORIE & MACRO DASHBOARD
═══════════════════════════════════════════════════════ */
.nut-dash {
    background: var(--navy-light, #0d1b2a);
    border: 1px solid rgba(200,160,60,0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 10px 0 0;
}

@media (max-width: 480px) {
    .nut-dash {
        padding: 12px 12px;
        margin: 8px 0 0;
        border-radius: 8px;
    }
    .nut-dash-consumed {
        font-size: 1.8rem;
    }
    .nut-mbar {
        margin-bottom: 0.35rem;
    }
    .nut-mbar-name {
        font-size: 0.65rem;
    }
    .nut-mbar-val {
        font-size: 0.62rem;
    }
    .nut-micros-toggle {
        font-size: 0.65rem;
    }
}
.nut-dash-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .nut-dash-top {
        flex-direction: column;
        gap: 12px;
    }
    .nut-dash-cal-col {
        width: 100%;
    }
}
.nut-dash-cal-col { flex: 1; }
.nut-dash-cal-nums {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
}
.nut-dash-consumed {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold, #c8a03c);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 1px;
    line-height: 1;
}
.nut-dash-sep { color: rgba(255,255,255,0.25); font-size: 1.1rem; }
.nut-dash-target { font-size: 0.95rem; color: rgba(255,255,255,0.45); }
.nut-dash-unit { font-size: 0.65rem; color: rgba(255,255,255,0.25); margin-left: 2px; }
.nut-dash-cal-bar-wrap {
    height: 10px;
    background: rgba(255,255,255,0.07);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}
.nut-dash-cal-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--crimson,#8b1a1a) 0%, var(--gold,#c8a03c) 100%);
    border-radius: 5px;
    transition: width 0.7s ease;
    min-width: 3px;
}
.nut-dash-cal-labels { font-size: 0.68rem; }
.nut-water-btn2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: rgba(100,160,220,0.1);
    border: 1px solid rgba(100,160,220,0.2);
    border-radius: 8px;
    color: #7cb8e8;
    padding: 8px 12px;
    cursor: pointer;
    min-width: 68px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.15s;
    min-height: 44px;
    justify-content: center;
}

@media (max-width: 480px) {
    .nut-water-btn2 {
        flex: 0 1 auto;
        min-width: auto;
        width: 100%;
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }
}
.nut-water-btn2 small { font-size: 0.58rem; color: rgba(255,255,255,0.3); font-weight: 400; }
.nut-water-btn2:hover { background: rgba(100,160,220,0.2); }
/* Energy balance: eaten − burned = net (Health Connect). Flat, no bubbles. */
.nut-energy-row {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    margin: 0.55rem 0 0.2rem; padding-top: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.nut-energy-stat { display: flex; flex-direction: column; align-items: center; gap: 0.05rem; min-width: 48px; }
.nut-energy-stat strong { font-size: 1.05rem; font-weight: 700; line-height: 1; color: var(--white,#fff); }
.nut-energy-stat span { font-size: 0.56rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.4); }
.nut-energy-net strong { color: var(--gold,#c8a03c); }
.nut-energy-op { font-size: 0.95rem; color: rgba(255,255,255,0.3); font-weight: 600; padding-bottom: 0.5rem; }
.nut-macro-bars { display: flex; flex-direction: column; gap: 9px; }
.nut-mbar-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.nut-mbar-name { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.nut-mbar-val  { font-size: 0.65rem; color: rgba(255,255,255,0.4); }
.nut-mbar-track {
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
}
.nut-mbar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 2px;
    opacity: 0.85;
}
.nut-mbar--micro { margin-top: 2px; }

/* Micros toggle */
.nut-micros-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.35);
    user-select: none;
}
.nut-micros-toggle:hover { color: rgba(255,255,255,0.6); }
.nut-micros-chevron { transition: transform 0.2s; }
.nut-micros-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════════════════
   AI MEAL IDEA — Featured single card (top of page)
═══════════════════════════════════════════════════════ */
.nut-ai-box {
    background: var(--navy-light, #0d1b2a);
    border: 1px solid rgba(200,160,60,0.2);
    border-radius: 10px;
    overflow: hidden;
}

@media (max-width: 480px) {
    /* De-box the Meal Idea on mobile — the hard gold-bordered container felt
       restricting; let the image + content breathe edge to edge. */
    .nut-ai-box {
        border-radius: 8px;
        border: none;
        background: transparent;
        overflow: visible;
    }
    .nut-ai-bar {
        padding: 2px 2px 8px;
        gap: 8px;
        flex-direction: column;       /* title row, then a full-width chip row */
        align-items: stretch;
        border-bottom: none;
    }
    .nut-ai-title {
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }
    .nut-ai-tabs {
        gap: 4px;
        flex-wrap: nowrap;            /* all 4 chips on ONE line */
        width: 100%;
    }
    .nut-ai-tab {
        flex: 1 1 0;                  /* equal width on the full-width line */
        min-width: 0;
        text-align: center;          /* label centred in each chip */
        font-size: 0.6rem;
        padding: 5px 4px;
        white-space: nowrap;
    }
}
.nut-ai-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px 7px;
    border-bottom: 1px solid rgba(200,160,60,0.1);
    flex-wrap: wrap;
    gap: 6px;
}
.nut-ai-bar-left { display: flex; align-items: center; gap: 6px; }
.nut-ai-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--gold, #c8a03c);
}
/* Put the four chips on their own full-width line (below the title) so they aren't squeezed into
   half the bar. Each pill sizes to its word (min-width:max-content) → full words, never "Bre...". */
.nut-ai-tabs { display: flex; gap: 4px; flex-wrap: nowrap; flex: 1 1 100%; width: 100%; }
.nut-ai-tab {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    color: rgba(255,255,255,0.4);
    font-size: 0.6rem;
    padding: 5px 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex: 1 1 0;                  /* equal-width chips on the full-width line — fits "Breakfast" */
    min-width: 0;
    text-align: center;          /* label centred in each chip */
}
.nut-ai-tab.active, .nut-ai-tab:hover {
    background: var(--gold,#c8a03c);
    border-color: var(--gold,#c8a03c);
    color: #000;
    font-weight: 600;
}
/* "Your usual <meal>" — starred most-used foods pinned at the top of Quick Picks. */
.most-used-block { margin-bottom: 8px; border-bottom: 1px solid rgba(200,160,60,0.18); padding-bottom: 6px; }
.most-used-head { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold,#c8a03c); padding: 4px 4px 6px; }
.most-used-item { background: rgba(200,160,60,0.06); border-left: 2px solid rgba(200,160,60,0.5); }
.most-used-item:hover { background: rgba(200,160,60,0.12); }

/* Logged-food row actions — plain icons (no "bubble" backgrounds), never bleed. */
.nut-meal-item { display: flex; align-items: center; gap: 8px; }
.nut-item-info { min-width: 0; }
.nut-item-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; margin-left: auto; }
.nut-item-duplicate {
    background: transparent !important; border: none !important; box-shadow: none !important;
    color: var(--gold, #c8a03c); font-size: 1.4rem; line-height: 1; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.nut-item-del {
    background: transparent !important; border: none !important; box-shadow: none !important;
    color: #f87171; width: 30px; height: 30px; padding: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nut-item-del svg { width: 18px; height: 18px; }
.nut-item-duplicate:active, .nut-item-del:active { opacity: 0.6; }

/* Dashboard Today's-Activity rows — bin icon, never bleeds off the edge. */
.today-event-item { display: flex; align-items: center; gap: 8px; }
.today-event-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-event-delete {
    flex-shrink: 0; background: transparent !important; border: none !important; box-shadow: none !important;
    color: #f87171; width: 30px; height: 30px; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.today-event-delete svg { width: 17px; height: 17px; }
.nut-ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
}
.nut-ai-empty { text-align: center; padding: 20px; color: rgba(255,255,255,0.3); font-size: 0.8rem; }

/* Featured card layout */
@media (max-width: 480px) {
    .nut-feat-card { flex-direction: column; min-height: auto; max-height: none; border: none; border-radius: 12px; background: rgba(255,255,255,0.03); }
    .nut-feat-img-wrap { width: 100%; height: 280px; min-height: 280px; }      /* bigger image — more space */
    .nut-feat-info { max-height: none; padding: 12px 12px 14px; }
}

/* ── API Key Management Panel ──────────────────────────────────────────────── */
.api-keys-panel {
    padding: 8px 0;
}
.api-keys-header {
    margin-bottom: 24px;
}
.api-keys-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 6px;
}
.api-keys-header p {
    color: #9ca3af;
    font-size: 0.875rem;
}
.api-key-group {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.api-key-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #dc143c;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.api-key-group-icon {
    font-size: 1rem;
}
.api-key-group-note {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
.api-key-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.api-key-row:first-of-type {
    border-top: none;
}
.api-key-info {
    flex: 1;
    min-width: 0;
}
.api-key-name {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.api-key-desc {
    color: #6b7280;
    font-size: 0.78rem;
    margin-bottom: 4px;
}
.api-key-link {
    color: #dc143c;
    font-size: 0.75rem;
    text-decoration: none;
}
.api-key-link:hover { text-decoration: underline; }
.api-key-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.api-key-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.api-key-status.set {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.3);
}
.api-key-status.unset {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.25);
}
.api-key-input {
    width: 220px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #e5e7eb;
    font-size: 0.82rem;
    font-family: monospace;
    outline: none;
    transition: border-color 0.2s;
}
.api-key-input:focus {
    border-color: #dc143c;
    box-shadow: 0 0 0 2px rgba(220,20,60,0.2);
}
.api-key-toggle {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 7px 12px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.api-key-toggle:hover { background: rgba(255,255,255,0.12); color: #e5e7eb; }
.api-keys-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.api-save-pending { color: #f59e0b; font-size: 0.85rem; }
.api-save-ok      { color: #4ade80; font-size: 0.85rem; }
.api-save-err     { color: #f87171; font-size: 0.85rem; }

@media (max-width: 600px) {
    .api-key-row { flex-direction: column; align-items: flex-start; }
    .api-key-input { width: 100%; }
    .api-key-input-wrap { width: 100%; }
}

/* ── Enhanced Professional Recipe Card ─────────────────────────────────────── */
.nut-feat-card {
    display: flex;
    gap: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    min-height: 450px;
    max-height: 600px;
}
.nut-feat-img-wrap {
    position: relative;
    width: 42%;
    flex-shrink: 0;
    background: #111;
    min-height: 450px;
}
.nut-feat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nut-feat-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: rgba(255,255,255,0.03);
}
.nut-feat-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.nut-feat-macro-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.nut-feat-chip {
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    color: #e5e7eb;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.nut-feat-chip.kcal-chip {
    background: rgba(13,20,40,0.82);
    border-color: rgba(200,160,60,0.5);
    color: #e8c87a;
}
.nut-feat-weight {
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 3px;
}
.nut-feat-nav {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.65);
    border-radius: 20px;
    padding: 3px 8px;
}
.nut-feat-arrow {
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.nut-feat-arrow:disabled { color: #4b5563; cursor: default; }
.nut-feat-counter { font-size: 0.7rem; color: #9ca3af; }
.nut-ai-fresh {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(200,160,60,0.92);
    color: #0a0e1a;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
}
/* Right info panel */
.nut-feat-info {
    flex: 1;
    padding: 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
}
.nut-feat-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.nut-feat-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.3;
}
.nut-live-badge {
    background: rgba(200,160,60,0.15);
    color: #e8c87a;
    border: 1px solid rgba(200,160,60,0.35);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}
.nut-stock-badge {
    background: rgba(156,163,175,0.1);
    color: #6b7280;
    border: 1px solid rgba(156,163,175,0.2);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.nut-feat-desc {
    color: #9ca3af;
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
}
/* Macro/Micro table */
.nut-macro-table {
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.nut-macro-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #dc143c;
    margin-bottom: 6px;
}
.nut-macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.nut-macro-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 5px 4px;
}
.nmc-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e5e7eb;
    line-height: 1;
}
.nmc-lbl {
    font-size: 0.6rem;
    color: #6b7280;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nut-micro-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.nut-micro-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #d1d5db;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
}
/* Performance badges */
.nut-perf-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.nut-perf-badge, .nut-gi-badge, .nut-recovery-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.nut-recovery-badge {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border-color: rgba(99,102,241,0.3);
}
/* Tags */
.nut-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.nut-tag {
    background: rgba(220,20,60,0.1);
    border: 1px solid rgba(220,20,60,0.2);
    color: #fca5a5;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
}
/* Meta row */
.nut-feat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: #6b7280;
}
/* Log button */
.nut-feat-log-btn {
    background: #dc143c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: auto;
}
.nut-feat-log-btn:hover { background: #b01030; }

@media (max-width: 640px) {
    .nut-feat-card { flex-direction: column; min-height: auto; max-height: none; }
    .nut-feat-img-wrap { width: 100%; height: 240px; min-height: 240px; }
    .nut-feat-info { max-height: none; }
    .nut-macro-grid { grid-template-columns: repeat(3,1fr); }
}

/* ── Photo Wall: Caption on Thumbnails + Comments ──────────────────────────── */



/* Comments section in detail view */
.igal-comments-section {
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.igal-comments-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.igal-comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 10px;
}
.igal-comment {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.igal-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.igal-comment-initials {
    background: #dc143c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.igal-comment-body {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 6px 10px;
}
.igal-comment-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e5e7eb;
}
.igal-comment-date {
    font-size: 0.65rem;
    color: #6b7280;
    margin-left: 6px;
}
.igal-comment-text {
    font-size: 0.8rem;
    color: #d1d5db;
    margin: 3px 0 0;
    line-height: 1.4;
}
.igal-no-comments, .igal-comments-loading {
    font-size: 0.78rem;
    color: #6b7280;
    text-align: center;
    padding: 8px 0;
}
.igal-add-comment {
    display: flex;
    gap: 6px;
    align-items: center;
}
.igal-comment-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 10px;
    color: #e5e7eb;
    font-size: 0.82rem;
    outline: none;
}
.igal-comment-input:focus { border-color: #dc143c; }
.igal-comment-post-btn {
    background: #dc143c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.igal-comment-post-btn:hover { background: #b01030; }
.igal-comment-post-btn:disabled { opacity: 0.5; cursor: default; }

/* Nutrition benefit badges */
.nut-benefit-section { margin-top: 8px; }
.nut-benefit-label {
    font-size: 0.62rem; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 5px;
}
.nut-benefit-row { display: flex; flex-wrap: wrap; gap: 5px; }
.nut-benefit-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 600; line-height: 1;
    border: 1px solid currentColor;
}
.nut-benefit-chip.anti-inflammatory { color: #34d399; background: rgba(52,211,153,0.1); }
.nut-benefit-chip.omega-3-rich      { color: #60a5fa; background: rgba(96,165,250,0.1); }
.nut-benefit-chip.iron-rich         { color: #f87171; background: rgba(248,113,113,0.1); }
.nut-benefit-chip.calcium-rich      { color: #e2e8f0; background: rgba(226,232,240,0.08); }
.nut-benefit-chip.potassium-rich    { color: #a78bfa; background: rgba(167,139,250,0.1); }
.nut-benefit-chip.high-protein      { color: #c8a03c; background: rgba(200,160,60,0.1); }
.nut-benefit-chip.muscle-building   { color: #c8a03c; background: rgba(200,160,60,0.1); }
.nut-benefit-chip.recovery          { color: #4ade80; background: rgba(74,222,128,0.1); }
.nut-benefit-chip.pre-workout       { color: #fb923c; background: rgba(251,146,60,0.1); }
.nut-benefit-chip.post-workout      { color: #fb923c; background: rgba(251,146,60,0.1); }
.nut-benefit-chip.immune-support    { color: #34d399; background: rgba(52,211,153,0.1); }
.nut-benefit-chip.zinc-rich         { color: #f59e0b; background: rgba(245,158,11,0.1); }
.nut-benefit-chip.default-benefit   { color: #9ca3af; background: rgba(156,163,175,0.1); }

/* Meal details: why suitable, ingredients, how to cook */
.nut-why-box {
    margin-top: 8px;
    padding: 9px 11px;
    background: rgba(212,175,55,0.07);
    border-left: 3px solid var(--gold);
    border-radius: 0 6px 6px 0;
    font-size: 0.75rem;
    color: #d1d5db;
    line-height: 1.5;
}
.nut-why-label {
    font-size: 0.62rem; font-weight: 700; color: var(--gold);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.nut-detail-toggle {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none;
    margin-top: 10px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.07);
    transition: background 0.15s;
}
.nut-detail-toggle:hover { background: rgba(255,255,255,0.08); }
.nut-detail-toggle-arrow { font-size: 0.65rem; transition: transform 0.2s; }
.nut-detail-toggle.open .nut-detail-toggle-arrow { transform: rotate(180deg); }
.nut-detail-body {
    display: none;
    margin-top: 6px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 0 0 6px 6px;
    font-size: 0.74rem;
    color: #d1d5db;
    line-height: 1.6;
}
.nut-detail-body.open { display: block; }
.nut-detail-section-title {
    font-size: 0.63rem; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.07em;
    margin: 8px 0 4px;
}
.nut-detail-section-title:first-child { margin-top: 0; }
.nut-ingredients-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.nut-ingredients-list li::before { content: '• '; color: var(--gold); }
.nut-steps-list {
    list-style: none; padding: 0; margin: 0;
    counter-reset: step-counter;
    display: flex; flex-direction: column; gap: 6px;
}
.nut-steps-list li {
    counter-increment: step-counter;
    padding-left: 24px;
    position: relative;
}
.nut-steps-list li::before {
    content: counter(step-counter);
    position: absolute; left: 0; top: 0;
    width: 18px; height: 18px;
    background: rgba(212,175,55,0.2);
    color: var(--gold);
    border-radius: 50%;
    font-size: 0.62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

/* ═══════════════════════════════════════
   GOALS SYSTEM
═══════════════════════════════════════ */
.goals-loading { padding: 8px 0; color: #9ca3af; font-size: 0.85rem; }
.goals-empty { color: #6b7280; font-size: 0.85rem; padding: 8px 0; }
.goals-spinner { padding: 12px 0; color: #9ca3af; }

/* Points bar */
.points-bar-wrap {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px 14px;
    background: rgba(212,175,55,0.06);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 10px;
    margin-bottom: 14px;
}
.points-bar-wrap > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.points-level-badge { font-size: 0.9rem; font-weight: 700; }
.points-total { font-size: 1.1rem; font-weight: 800; color: var(--gold, #c8a03c); }
.points-bar-track {
    height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden;
}
.points-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.points-bar-label { font-size: 0.68rem; color: #9ca3af; }

/* Goal cards */
.goals-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.goal-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    transition: background 0.15s;
}
.goal-card.goal-done {
    background: rgba(52,211,153,0.06);
    border-color: rgba(52,211,153,0.2);
}
.goal-emoji { font-size: 1.4rem; flex-shrink: 0; }
.goal-card-body { flex: 1; min-width: 0; }
.goal-card-title { font-size: 0.85rem; font-weight: 600; color: #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.goal-freq-badge {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
    padding: 1px 6px; border-radius: 10px;
    background: rgba(255,255,255,0.08); color: #9ca3af;
}
.goal-streak { font-size: 0.7rem; color: #fb923c; }
.goal-pts { font-size: 0.7rem; color: var(--gold, #c8a03c); font-weight: 700; }

.goal-complete-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.3rem; padding: 4px; border-radius: 50%;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.goal-complete-btn:hover { transform: scale(1.2); }
.goal-delete-btn {
    background: none; border: none; cursor: pointer;
    font-size: 0.85rem; padding: 4px; opacity: 0.4;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.goal-delete-btn:hover { opacity: 1; }

/* Add goal form */
.goal-add-form {
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px;
}
.goal-add-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.goal-emoji-picker {
    font-size: 1.3rem; cursor: pointer; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    transition: background 0.15s;
}
.goal-emoji-picker:hover { background: rgba(255,255,255,0.12); }
.goal-title-input {
    flex: 1; background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    color: #f0f0f0; padding: 9px 12px; font-size: 0.85rem;
}
.goal-title-input:focus { outline: none; border-color: var(--gold, #c8a03c); }
.goal-add-options { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.goal-select {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px; color: #f0f0f0; padding: 7px 10px; font-size: 0.8rem;
    cursor: pointer;
}
.goal-add-btn {
    background: var(--gold, #c8a03c); color: #000; border: none;
    padding: 8px 16px; border-radius: 8px; font-weight: 700;
    font-size: 0.82rem; cursor: pointer; white-space: nowrap;
    transition: opacity 0.15s;
}
.goal-add-btn:hover { opacity: 0.85; }
.goal-emoji-row {
    display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.goal-emoji-row.open { display: flex; }
.goal-emoji-opt {
    font-size: 1.2rem; cursor: pointer; padding: 4px;
    border-radius: 6px; transition: background 0.1s;
}
.goal-emoji-opt:hover { background: rgba(255,255,255,0.1); }

/* ═══════════════════════════════════════
   CALENDAR ACHIEVEMENT GOLD BORDER
═══════════════════════════════════════ */
.cal-day.achievement-day {
    outline: 2px solid var(--gold, #c8a03c);
    outline-offset: -2px;
    border-radius: 8px;
    position: relative;
}
.cal-day.achievement-day::after {
    content: '🏆';
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.6rem;
    line-height: 1;
    pointer-events: none;
}
.cal-day.achievement-day .day-num {
    color: var(--gold, #c8a03c);
    font-weight: 800;
}

/* ── Meal Plans Tab Content ── */
.meal-plans-container {
    padding: 0.85rem 0.85rem 5rem;
}
.meal-plans-header {
    margin-bottom: 1.5rem;
}
.meal-plans-header h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.8rem;
    color: rgba(255,255,255,0.95);
    margin: 0 0 0.25rem 0;
}
.meal-plans-header p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
}
.meal-plans-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.meal-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.meal-plan-card {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.meal-plan-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}
.plan-admin-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(212,175,55,0.15);
    color: var(--gold);
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.plan-card-header {
    margin-bottom: 0.75rem;
}
.plan-card-header h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.4rem;
    color: rgba(255,255,255,0.95);
    margin: 0 0 0.25rem 0;
}
.plan-card-date {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
}
.plan-card-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 1rem 0;
    line-height: 1.4;
}
.plan-card-macros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.plan-macro {
    display: flex;
    flex-direction: column;
}
.plan-macro-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.plan-macro-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}
.plan-card-macros-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.plan-macro-chip {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}
.pmc-label {
    display: block;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.pmc-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
}
.plan-card-actions {
    display: flex;
    gap: 0.5rem;
}
.plan-action-btn {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.plan-action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.plan-delete-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255,59,48,0.1);
    border: 1px solid rgba(255,59,48,0.2);
    color: rgba(255,59,48,1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}
.plan-delete-icon:hover {
    background: rgba(255,59,48,0.2);
    transform: scale(1.1);
}
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}
.empty-state h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.6);
    margin: 0.5rem 0;
}
.empty-state p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin: 0.25rem 0;
}

/* ── Meal Plan Modals ── */
.meal-plan-builder-content {
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    background: var(--navy-light);
    border-radius: var(--radius-lg);
}
.meal-plan-builder-content .modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--navy-medium);
}
.meal-plan-builder-content .modal-header h2 {
    font-size: 1.25rem;
    color: var(--white);
}
.meal-plan-builder-content .modal-body {
    max-height: calc(85vh - 100px);
    overflow-y: auto;
    padding: 1rem;
}
.ai-meal-plan-content,
.meal-plan-detail-content,
.shopping-list-content {
    max-width: 600px;
    width: 100%;
    background: var(--navy-light);
    border-radius: var(--radius-lg);
    max-height: 90vh;
    overflow: hidden;
}
.ai-meal-plan-content .modal-header,
.meal-plan-detail-content .modal-header,
.shopping-list-content .modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ai-meal-plan-content .modal-header h2,
.meal-plan-detail-content .modal-header h2,
.shopping-list-content .modal-header h2 {
    font-size: 1.25rem;
    color: var(--white);
    margin: 0;
}
.ai-meal-plan-content .modal-close,
.meal-plan-detail-content .modal-close,
.shopping-list-content .modal-close,
.meal-plan-builder-content .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 1.25rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.ai-meal-plan-content .modal-close:hover,
.meal-plan-detail-content .modal-close:hover,
.shopping-list-content .modal-close:hover,
.meal-plan-builder-content .modal-close:hover {
    background: var(--crimson);
    color: var(--white);
}
.ai-meal-plan-content .modal-body,
.meal-plan-detail-content .modal-body,
.shopping-list-content .modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}
.meal-plan-builder-content .modal-body .btn,
.ai-meal-plan-content .modal-body .btn,
.meal-plan-detail-content .modal-body .btn,
.shopping-list-content .modal-body .btn {
    margin-top: 1.5rem;
    width: 100%;
}
.meal-plan-form,
.ai-meal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* Menu-style meal-plan picker (chips, no free text) */
.ai-mp-hint {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--gray-300, #c7cdd6);
}
.ai-mp-hint strong { color: var(--crimson, #c8a03c); }
.ai-mp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ai-mp-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: var(--navy-medium, #16223c);
    color: var(--white, #fff);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.ai-mp-chip:hover { border-color: rgba(200,160,60,0.55); }
.ai-mp-chip.active {
    background: rgba(200,160,60,0.16);
    border-color: var(--crimson, #c8a03c);
    color: var(--crimson, #c8a03c);
}
.ai-mp-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.ai-mp-actions .btn { flex: 0 0 auto; }
.ai-mp-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white, #fff);
}
/* Meal-detail modal (tap a meal name to view/manage its foods) */
.meal-detail-content { max-width: 460px; }
.mdm-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0.85rem; margin-bottom: 0.75rem;
    background: var(--navy-medium, #16223c); border-radius: 8px;
    font-weight: 700; color: var(--white, #fff);
}
.mdm-total-val { color: var(--crimson, #c8a03c); }
.mdm-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 50vh; overflow-y: auto; }
.mdm-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.7rem; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07); border-radius: 8px;
}
.mdm-info { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.mdm-name { color: var(--white, #fff); font-weight: 600; font-size: 0.92rem; }
.mdm-macros { color: var(--gray-400, #9aa3b2); font-size: 0.72rem; }
.mdm-dup, .mdm-del {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1;
}
.mdm-dup { background: rgba(200,160,60,0.18); border: 1px solid rgba(200,160,60,0.3); color: var(--crimson, #c8a03c); }
.mdm-del { background: rgba(220,38,38,0.12); border: 1px solid rgba(220,38,38,0.25); color: #f87171; }
.mdm-empty { padding: 1.5rem; text-align: center; color: var(--gray-400, #9aa3b2); font-size: 0.9rem; }
.mdm-add { width: 100%; margin-top: 0.85rem; }
/* Change-password requirements hint */
.cp-reqs { font-size: 0.78rem; line-height: 1.5; color: var(--gray-400, #9aa3b2); margin: 0 0 1rem; }
.cp-reqs strong { color: var(--white, #fff); }
/* Add-exercise-to-programme chooser */
.aep-list { display: flex; flex-direction: column; gap: 0.45rem; max-height: 40vh; overflow-y: auto; }
.aep-prog {
    text-align: left; padding: 0.7rem 0.85rem; border-radius: 8px;
    background: var(--navy-medium, #16223c); border: 1px solid rgba(255,255,255,0.1);
    color: var(--white, #fff); font-weight: 600; font-size: 0.92rem; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.aep-prog:hover { border-color: var(--crimson, #c8a03c); background: rgba(200,160,60,0.1); }
.aep-prog:disabled { opacity: 0.5; cursor: default; }
.aep-empty { padding: 1rem; text-align: center; color: var(--gray-400, #9aa3b2); font-size: 0.88rem; }
/* Profile calendar: clickable days + the selected-day filter bar */
.pf-cal-cell[data-pf-date] { cursor: pointer; }
.pf-cal-cell.pf-cal-selected { outline: 2px solid #c8a03c; outline-offset: -2px; border-radius: 8px; }
.pf-day-filter {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.5rem 0.85rem; margin: 0 0 0.75rem;
    background: rgba(200,160,60,0.1); border: 1px solid rgba(200,160,60,0.3);
    border-radius: 8px; color: #c8a03c; font-size: 0.82rem; font-weight: 600;
}
.pf-day-clear {
    background: none; border: 1px solid rgba(200,160,60,0.5); color: #c8a03c;
    border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.pf-day-clear:hover { background: rgba(200,160,60,0.15); }
/* Meal Idea: honesty styling for approximate macros */
.nut-macro-approx { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.03em; color: var(--gray-400, #9aa3b2); opacity: 0.85; margin-left: 4px; }
.nut-macro-disclaimer { margin-top: 8px; font-size: 0.72rem; line-height: 1.45; color: var(--gray-400, #9aa3b2); font-style: italic; }
.meal-plan-form .form-group,
.ai-meal-form .form-group {
    display: flex;
    flex-direction: column;
}
.meal-plan-form .form-group label,
.ai-meal-form .form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.meal-plan-form .form-group input,
.ai-meal-form .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--navy-medium);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.875rem;
    transition: all 0.2s;
}
.meal-plan-form .form-group input:focus,
.ai-meal-form .form-group input:focus {
    outline: none;
    border-color: var(--crimson);
    background: var(--navy-light);
}
.meal-plan-form .form-group input::placeholder,
.ai-meal-form .form-group input::placeholder {
    color: var(--gray-400);
}
.meal-plan-form .form-group textarea,
.ai-meal-form .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--navy-medium);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}
.meal-plan-form .form-group textarea:focus,
.ai-meal-form .form-group textarea:focus {
    outline: none;
    border-color: var(--crimson);
    background: var(--navy-light);
}
.meal-plan-form .form-group textarea::placeholder,
.ai-meal-form .form-group textarea::placeholder {
    color: var(--gray-400);
}
.meal-plan-form .form-group select,
.ai-meal-form .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--navy-medium);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--white);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.meal-plan-form .form-group select:focus,
.ai-meal-form .form-group select:focus {
    outline: none;
    border-color: var(--crimson);
    background: var(--navy-light);
}
.meal-plan-form .form-group select option,
.ai-meal-form .form-group select option {
    background: var(--navy-medium);
    color: var(--white);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.meal-plan-week-builder {
    padding: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}

/* ── Day Tabs ── */
.day-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.day-tab {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}
.day-tab:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}
.day-tab.active {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--white);
    font-weight: 600;
}

/* ── Day Panels ── */
.day-panel {
    display: none;
}
.day-panel.active {
    display: block;
}
.day-panel-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(255,255,255,0.15);
    padding-bottom: 0.5rem;
}

/* ── Compact Meal Grid (2x2 Layout) ── */
.meal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-height: 450px;
}

@media (max-width: 768px) {
    .meal-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }
    .meal-plan-builder-content {
        max-width: 100%;
        width: 100%;
    }
}
.meal-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.75rem;
    position: relative;
    transition: all 0.2s;
}
.meal-card:hover {
    border-color: rgba(255,255,255,0.15);
}
.meal-card-header {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0.5rem;
}
.meal-card-header h4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.meal-count {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}
.meal-card-foods {
    min-height: 80px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}
.compact-food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-bottom: 0.35rem;
}
.food-name-compact {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.remove-food-compact {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,59,48,0.15);
    border: 1px solid rgba(255,59,48,0.3);
    color: rgba(255,59,48,1);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.remove-food-compact:hover {
    background: rgba(255,59,48,0.3);
    transform: scale(1.1);
}
.empty-meal-compact {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    font-style: italic;
}
.add-food-compact-btn {
    width: 100%;
    background: var(--crimson);
    border: none;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.add-food-compact-btn:hover {
    background: var(--crimson-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 160, 60, 0.4);
}
.food-search-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
}

/* ── Day Food Search ── */
.day-food-search {
    margin-bottom: 1rem;
    position: relative;
}
.day-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.875rem;
    transition: all 0.2s;
}
.day-search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}
.day-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.2s;
}
.search-result-item:hover {
    background: rgba(255,255,255,0.05);
}
.search-result-item:last-child {
    border-bottom: none;
}
.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.result-info strong {
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
}
.result-info span {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}
.add-to-day-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    color: var(--navy);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.add-to-day-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(212,175,55,0.4);
}
.no-results {
    padding: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.875rem;
}

/* ── Day Meals List ── */
.day-meals-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.empty-day-msg {
    padding: 2rem 1rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.875rem;
    font-style: italic;
}
.day-meal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    transition: all 0.2s;
}
.day-meal-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.day-meal-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.day-meal-info strong {
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
}
.day-meal-macros {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}
.remove-day-meal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,59,48,0.1);
    border: 1px solid rgba(255,59,48,0.2);
    color: rgba(255,59,48,1);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.remove-day-meal:hover {
    background: rgba(255,59,48,0.2);
    transform: scale(1.1);
}
.plan-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}
.plan-stat {
    text-align: center;
}
.stat-label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.stat-value {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}
.plan-detail-days {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.plan-day-section h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin: 0 0 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}
.plan-meal-type-group {
    margin-bottom: 1rem;
}
.meal-type-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}
.meal-foods-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.meal-foods-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    margin-bottom: 0.35rem;
}
.food-name {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}
.food-macros {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.plan-meal-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
.plan-meal-item strong {
    display: block;
    font-size: 0.75rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.plan-meal-item ul {
    margin: 0;
    padding-left: 1.5rem;
}
.plan-meal-item li {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.25rem;
}
.plan-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.shopping-list-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.shopping-category h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
}
.shopping-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.shopping-items li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shopping-items li:last-child {
    border-bottom: none;
}
.shopping-item-check {
    flex-shrink: 0;
}
.item-name {
    flex: 1;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}
.item-quantity {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.ai-success,
.ai-error {
    padding: 1rem;
    border-radius: 8px;
}
.ai-success {
    background: rgba(52,199,89,0.1);
    border: 1px solid rgba(52,199,89,0.2);
}
.ai-success h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.4rem;
    color: rgba(52,199,89,1);
    margin: 0 0 0.5rem 0;
}
.ai-error {
    background: rgba(255,59,48,0.1);
    border: 1px solid rgba(255,59,48,0.2);
    color: rgba(255,59,48,1);
}

/* ═══════════════════════════════════════
   FOOD MODAL — tabs + USDA styles
═══════════════════════════════════════ */
.food-modal-content { max-height: 88vh; display: flex; flex-direction: column; }

/* Mobile: the food modal is a full-screen sheet. The OVERLAY itself is solid navy so any
   area the keyboard reveals below the content is navy — not the grey body background. */
@media (max-width: 768px) {
    #food-modal { align-items: stretch; justify-content: stretch; padding: 0; background: #0a1628 !important; }
    #food-modal .food-modal-content {
        width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: none;
        background: #0a1628;
    }
    #food-modal .modal-body { flex: 1; background: #0a1628; }
}

/* Food modal header: clean gold "Back" link (not a bold round button), tighter top gap. */
.food-modal-content .modal-header { padding: 0.55rem 1rem 0.5rem; }
.food-modal-content .modal-header h2 { font-size: 1.05rem; }
.food-modal-content .modal-close {
    width: auto; height: auto; border-radius: 0; background: transparent;
    color: var(--gold, #c8a03c); font-size: 0.95rem; font-weight: 600; padding: 0.2rem 0.3rem;
}
.food-modal-content .modal-close:hover { background: transparent; color: var(--gold-light, #d4af37); }
.food-modal-content .fmt-x-ico { display: none; }

/* Tighter food result rows so the name / macros / calories don't bleed out of the box. */
.food-modal-content .food-result-item { padding: 0.6rem 0.8rem; gap: 0.65rem; align-items: center; }
.food-modal-content .food-result-item .food-details { min-width: 0; }
.food-modal-content .food-result-item .food-details strong { font-size: 0.82rem; }
.food-modal-content .food-result-item .food-details span { font-size: 0.64rem; line-height: 1.3; }
.food-modal-content .usda-brand { font-size: 0.62rem; display: block; }
.food-modal-content .food-cals { font-size: 0.92rem; flex-shrink: 0; }
.food-modal-content .food-cals span { font-size: 0.6rem; }

/* Scan + barcode result macro boxes — force a clean stacked layout (the generic .macro-value /
   .macro-label rules elsewhere were clashing and overlapping the number with the label). */
.photo-macros { grid-template-columns: repeat(4, 1fr) !important; gap: 0.45rem !important; }
.photo-macros .macro-item {
    display: flex !important; flex-direction: column !important; align-items: center !important;
    justify-content: center !important; padding: 0.55rem 0.25rem !important; min-width: 0 !important;
}
.photo-macros .macro-value {
    position: static !important; display: block !important; font-size: 1rem !important;
    line-height: 1.1 !important; margin: 0 0 0.12rem 0 !important; color: var(--gold, #c8a03c) !important;
    white-space: nowrap;
}
.photo-macros .macro-label {
    position: static !important; display: block !important; font-size: 0.52rem !important;
    margin: 0 !important; letter-spacing: 0.02em !important; white-space: nowrap;
    color: rgba(255,255,255,0.55) !important;
}

/* Meal target selector row */
.fmt-meal-selector {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0; flex-wrap: wrap;
}
.fmt-meal-label {
    font-size: 0.72rem; color: #9ca3af; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.fmt-meal-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.fmt-meal-btn {
    padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04); color: #9ca3af;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.fmt-meal-btn.active {
    background: rgba(200,160,60,0.15); border-color: var(--gold, #c8a03c);
    color: var(--gold, #c8a03c);
}
.fmt-meal-btn:hover:not(.active) { color: #e0e0e0; border-color: rgba(255,255,255,0.25); }
.food-modal-tabs {
    display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.fmt-tab {
    flex: 1; padding: 10px 8px; background: none; border: none;
    color: #9ca3af; font-size: 0.82rem; font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.fmt-tab.active { color: var(--gold, #c8a03c); border-bottom-color: var(--gold, #c8a03c); }
.fmt-tab:hover:not(.active) { color: #f0f0f0; }
.fmt-panel { display: block; }
.food-modal-content .modal-body { overflow-y: auto; flex: 1; }

/* Quick Picks: pin the filter box + category buttons so they don't scroll away with the food list.
   Kill the modal-body top padding (forced 16px by mobile-compress) so the pinned header sits flush
   at the very top — otherwise scrolling foods peek through the gap above the search bar. */
#food-modal .modal-body { padding-top: 0 !important; }
#fmt-quick .fmt-quick-head {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--navy-light, #142238);
    padding-top: 0.5rem;
    padding-bottom: 0.3rem;
}
#fmt-quick .fmt-quick-head .search-box { margin-bottom: 0.55rem !important; }
#fmt-quick .fmt-quick-head .food-categories { margin-bottom: 0 !important; }

/* USDA search specifics */
.usda-search-box input { font-size: 0.82rem; }
.usda-hint {
    font-size: 0.68rem; color: #6b7280;
    padding: 4px 2px 8px; line-height: 1.4;
}
.usda-empty, .usda-loading {
    padding: 24px 0; text-align: center;
    color: #6b7280; font-size: 0.85rem;
}
.usda-loading { color: var(--gold, #c8a03c); }
.usda-brand {
    display: block; font-size: 0.68rem; color: #6b7280;
    font-style: italic; margin: 1px 0 2px;
}
.usda-item { border-left: 2px solid rgba(99,102,241,0.3); }
.usda-item:hover { background: rgba(99,102,241,0.07); border-left-color: #818cf8; }
.usda-results { max-height: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   NUTRITION HEADER INLINE SEARCH
   ═══════════════════════════════════════════════════════════════════════════ */
.nut-header-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(200,160,60,0.25);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    gap: 6px;
    cursor: text;
    transition: border-color 0.2s, background 0.2s;
    max-width: 180px;
    min-width: 120px;
}
.nut-header-search:focus-within {
    border-color: rgba(200,160,60,0.6);
    background: rgba(255,255,255,0.1);
}
#nut-header-search-input {
    background: none;
    border: none;
    outline: none;
    color: #e8e0d0;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    min-width: 0;
}
#nut-header-search-input::placeholder {
    color: rgba(200,160,60,0.5);
    font-size: 12px;
}
.nut-search-icon {
    color: rgba(200,160,60,0.6);
    flex-shrink: 0;
    pointer-events: none;
}
.nut-header-search:focus-within .nut-search-icon {
    color: var(--gold, #c8a03c);
}
@media (max-width: 360px) {
    .nut-header-search { min-width: 90px; }
}

/* ============================================================================
   STRONG-STYLE SET LOGGING (Phase 3)
   ============================================================================ */

/* Multi-programme card container */
.my-programmes-section { margin-bottom: 1rem; }

/* Hide old single-set checkbox styles when unused */
.session-sets-tracker { display: none; }
.ex-log-row { display: none; }

/* Per-exercise set table */
.sets-table-header {
    display: grid;
    grid-template-columns: 28px 1fr 1fr 36px 28px;
    gap: 6px;
    padding: 0 0 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 4px;
}
.sth-set, .sth-reps, .sth-load, .sth-done, .sth-rm {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    text-align: center;
}
.sth-reps, .sth-load { text-align: left; }

/* Individual set rows */
.sets-list { margin-bottom: 6px; }

.set-row {
    display: grid;
    grid-template-columns: 28px 1fr 1fr 36px 28px;
    gap: 6px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    border-radius: 4px;
}
.set-row.set-done {
    background: rgba(200, 160, 60, 0.08);
}
.set-row.set-done .set-reps-input,
.set-row.set-done .set-weight-input {
    color: rgba(255,255,255,0.55);
}

.set-num-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-align: center;
}

.set-reps-input,
.set-weight-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    color: var(--white);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 8px;
    text-align: center;
    min-width: 0;
    transition: border-color 0.15s;
}
.set-reps-input:focus,
.set-weight-input:focus {
    outline: none;
    border-color: var(--gold, #c8a03c);
    background: rgba(255,255,255,0.09);
}
.set-reps-input::placeholder,
.set-weight-input::placeholder {
    color: rgba(255,255,255,0.2);
    font-size: 0.72rem;
}

/* Tick (complete set) button */
.set-tick-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.25);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    justify-self: center;
}
.set-tick-btn:hover { border-color: var(--crimson, #c8a03c); color: var(--crimson, #c8a03c); }
.set-row.set-done .set-tick-btn {
    background: var(--crimson, #c8a03c);
    border-color: var(--crimson, #c8a03c);
    color: var(--white);
}

/* Remove set button */
.remove-set-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.2);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    justify-self: center;
    border-radius: 4px;
    transition: color 0.15s;
}
.remove-set-btn:hover { color: rgba(255,80,80,0.8); }

/* Add Set button */
.add-set-btn {
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.4);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    letter-spacing: 0.02em;
    transition: all 0.15s;
    margin-bottom: 6px;
}
.add-set-btn:hover {
    border-color: var(--gold, #c8a03c);
    color: var(--gold, #c8a03c);
}

/* Per-exercise notes field */
.ex-notes-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    padding: 6px 9px;
    margin-top: 4px;
    box-sizing: border-box;
}
.ex-notes-input:focus { outline: none; border-color: rgba(255,255,255,0.18); }
.ex-notes-input::placeholder { color: rgba(255,255,255,0.18); }

/* ============================================================================
   PLANNED CALENDAR CHIP (Phase 4)
   ============================================================================ */

.cal-chip-planned {
    background: transparent;
    border: 1.5px solid rgba(200,160,60,0.45);
    color: rgba(200,160,60,0.75);
    font-style: italic;
}

/* ============================================================================
   DAY PANEL — PROGRAMME SECTION (Phase 4)
   ============================================================================ */

.ddp-prog-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ddp-prog-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.32);
    margin-bottom: 0.625rem;
}
.ddp-prog-card {
    background: rgba(28,38,64,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--gold, #c8a03c);
    border-radius: 7px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
.ddp-prog-name {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(200,160,60,0.8);
    margin-bottom: 2px;
}
.ddp-prog-session {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}
.ddp-prog-meta {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.38);
    margin-bottom: 0.625rem;
}
.ddp-begin-btn {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
}
.ddp-begin-btn:hover { opacity: 0.85; }

/* ============================================================================
   COMMUNITY — CONNECTION REQUESTS BANNER
   ============================================================================ */

.conn-requests-banner {
    background: rgba(200,160,60,0.08);
    border: 1px solid rgba(200,160,60,0.25);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.875rem;
}
.conn-req-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(200,160,60,0.85);
    margin-bottom: 0.5rem;
}
.conn-req-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}
.conn-req-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.conn-req-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conn-req-name { flex: 1; font-size: 0.82rem; font-weight: 600; color: var(--white); }
.conn-req-accept, .conn-req-decline {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.conn-req-accept { background: var(--gold, #c8a03c); color: #000; }
.conn-req-decline { background: transparent; color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.15); }
.conn-req-accept:hover, .conn-req-decline:hover { opacity: 0.8; }

/* ============================================================================
   COMMUNITY — CONNECTIONS + DISCOVER IN RIGHT SIDEBAR
   ============================================================================ */

.dc-conn-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.dc-conn-clickable {
    cursor: pointer;
}
.dc-conn-clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}
.dc-conn-clickable:active {
    background: rgba(255, 255, 255, 0.08);
}
.dc-conn-name { flex: 1; font-size: 0.78rem; color: rgba(255,255,255,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-discover-btn {
    width: 100%;
    margin-top: 0.5rem;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: 6px;
    color: rgba(255,255,255,0.38);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.dc-discover-btn:hover { border-color: var(--gold, #c8a03c); color: var(--gold, #c8a03c); }

/* ============================================================================
   DISCOVER PEOPLE PANEL
   ============================================================================ */

.discover-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.duc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    overflow: hidden;
}
.duc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.duc-info { flex: 1; min-width: 0; }
.duc-name { font-size: 0.85rem; font-weight: 700; color: var(--white); }
.duc-branch { font-size: 0.68rem; color: rgba(255,255,255,0.4); margin-top: 1px; }
.duc-connect-btn {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.duc-connect-btn:hover { opacity: 0.85; }
.duc-connect-btn:disabled { opacity: 0.4; cursor: default; }

/* ============================================================================
   DM CONVERSATION PANEL
   ============================================================================ */

/* Fill the overlay (was max-height:80vh, which stopped the panel 20vh short and left the
   composer floating above a dead strip with the keyboard below it). */
.dm-panel { display: flex; flex-direction: column; height: 100%; max-height: 100%; min-height: 0; }
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}
/* Spacer that pushes messages to the bottom when there are only a few */
.dm-push { flex: 1; min-height: 0; }
.dm-msg { display: flex; flex-direction: column; max-width: 80%; }
.dm-mine { align-self: flex-end; align-items: flex-end; }
.dm-theirs { align-self: flex-start; align-items: flex-start; }
.dm-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}
.dm-mine .dm-bubble {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border-bottom-right-radius: 4px;
}
.dm-theirs .dm-bubble {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-bottom-left-radius: 4px;
}
.dm-time { font-size: 0.62rem; color: rgba(255,255,255,0.3); margin-top: 2px; padding: 0 4px; }
.dm-empty { text-align: center; color: rgba(255,255,255,0.3); font-size: 0.8rem; padding: 2rem 0; }

/* DM Media Content */
.dm-media-img {
    max-width: 300px;
    max-height: 400px;
    border-radius: 8px;
    margin-top: 6px;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

.dm-media-video {
    max-width: 320px;
    max-height: 240px;
    border-radius: 8px;
    margin-top: 6px;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.dm-media-audio {
    width: 240px;
    max-width: 100%;
    margin-top: 6px;
    display: block;
}

/* Make media full-width within bubble on small screens */
@media (max-width: 600px) {
    .dm-media-img,
    .dm-media-video {
        max-width: 100%;
    }
}
.dm-input-row {
    display: flex;
    gap: 8px;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: var(--navy-dark, #0f1420);
}
.dm-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.85rem;
    padding: 9px 12px;
    min-width: 0;
}
.dm-input:focus { outline: none; border-color: rgba(255,255,255,0.25); }
.dm-send-btn {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.dm-send-btn:hover { opacity: 0.85; }

/* ============================================================
   COMPACT DM MESSAGES
   ============================================================ */
.dm-messages { gap: 4px; padding: 0.5rem 0.75rem; }
.dm-bubble { padding: 5px 10px; font-size: 0.82rem; line-height: 1.35; }
.dm-time { font-size: 0.58rem; margin-top: 1px; }
.dm-msg + .dm-msg.dm-mine { margin-top: 1px; }
.dm-msg + .dm-msg.dm-theirs { margin-top: 1px; }

/* ============================================================
   DM NAV BUTTON (left sidebar)
   ============================================================ */
.dc-dm-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% - 1.2rem);
    margin: 0.5rem 0.6rem 0.3rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
    flex-shrink: 0;
}
.dc-dm-nav-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dc-dm-nav-label { flex: 1; text-align: left; }
.dc-dm-nav-badge {
    background: var(--crimson, #c8a03c);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================================================
   DM LIST PANEL
   ============================================================ */
.dm-list-panel { display: flex; flex-direction: column; max-height: 85vh; }
.dml-body { flex: 1; overflow-y: auto; }
.dml-list { display: flex; flex-direction: column; }
.dml-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.12s;
}
.dml-item:hover { background: rgba(255,255,255,0.05); }
.dml-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.dml-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dml-info { flex: 1; min-width: 0; }
.dml-name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.dml-preview {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.dml-unread {
    background: var(--crimson, #c8a03c);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.dml-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
}
.dml-empty p { margin: 0; font-size: 0.85rem; }
.dml-new-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.dml-new-btn:hover { color: var(--gold, #c9a84c); background: rgba(255,255,255,0.07); }

/* ============================================================
   CHANNEL INITIAL (mobile — replaces # hash)
   ============================================================ */
.dc-channel-initial {
    display: none;
    min-width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 0.68rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 6px;
    letter-spacing: 0.02em;
}
.dc-channel-item.active .dc-channel-initial { background: rgba(200, 160, 60,0.2); color: var(--crimson-light, #e85c7a); }

/* ============================================================
   FOOTER — mobile adjustments
   ============================================================ */
@media (max-width: 640px) {
    .app-footer {
        padding: 0.25rem 1rem 0.25rem 1rem;
        gap: 0.1rem;
    }
    .app-footer-copyright {
        font-size: 0.62rem;
    }
    .app-footer p {
        font-size: 0.9rem;
    }
}

/* ============================================================================
   POST COMPOSER BOTTOM SHEET
   ============================================================================ */

.post-composer-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 520px;
    z-index: 1100;
    background: var(--navy-medium, #1c2640);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 80vh;
    overflow-y: auto;
}
.post-composer-sheet.open { transform: translateX(-50%) translateY(0); }
.pcs-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 10px auto 0;
}
.pcs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.pcs-title { font-size: 0.88rem; font-weight: 700; color: var(--white); }
.pcs-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.pcs-body { padding: 0.75rem 1rem 1.25rem; }
.pcs-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}
.pcs-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--crimson, #c8a03c);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pcs-channel-sel {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    padding: 4px 8px;
}
.pcs-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
    min-height: 80px;
}
.pcs-textarea::placeholder { color: rgba(255,255,255,0.25); }
.pcs-emoji-section { margin-bottom: 0.625rem; }
.pcs-emoji-search-row { margin-bottom: 5px; }
.pcs-emoji-search {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 0.78rem;
    padding: 5px 10px;
    box-sizing: border-box;
}
.pcs-emoji-search:focus { outline: none; border-color: rgba(255,255,255,0.25); }
.pcs-emoji-search::placeholder { color: rgba(255,255,255,0.3); }
.pcs-emoji-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-height: 80px;
    overflow-y: auto;
}
.pcs-emoji {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 3px;
    border-radius: 5px;
    transition: background 0.1s;
}
.pcs-emoji:hover { background: rgba(255,255,255,0.08); }
.pcs-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}
.pcs-remove-img {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pcs-img-preview { position: relative; display: inline-block; }
.pcs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 0.625rem;
    margin-top: 0.25rem;
}
.pcs-tool-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.pcs-tool-btn:hover { color: var(--gold, #c8a03c); background: rgba(255,255,255,0.05); }
.pcs-post-btn {
    background: var(--crimson, #c8a03c);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 9px 24px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.15s;
}
.pcs-post-btn:hover { opacity: 0.88; }
.pcs-post-btn:disabled { opacity: 0.4; cursor: default; }

/* Channel input (reused in new-channel sheet) */
.pcs-ch-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.88rem;
    padding: 9px 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.pcs-ch-input:focus { border-color: var(--gold, #c8a03c); }
.pcs-ch-input::placeholder { color: rgba(255,255,255,0.25); }

/* GIF Picker */
.pcs-gif-picker {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0.5rem 0 0.25rem;
    margin-bottom: 0.5rem;
}
.pcs-gif-search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 0.5rem;
}
.pcs-gif-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.82rem;
    padding: 5px 10px;
    outline: none;
}
.pcs-gif-input:focus { border-color: var(--gold, #c8a03c); }
.pcs-gif-search-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
}
.pcs-gif-search-btn:hover { background: rgba(255,255,255,0.15); }
.pcs-gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-height: 160px;
    overflow-y: auto;
}
.pcs-gif-thumb {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
}
.pcs-gif-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}
.pcs-gif-thumb:hover img { opacity: 0.8; }
.pcs-gif-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    padding: 1rem 0;
}

/* ============================================================================
   INLINE COMMUNITY COMPOSER
   ============================================================================ */
.dc-inline-composer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0.6rem 1rem;
    background: var(--navy, #0f1823);
}
.dc-ic-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.dc-ic-textarea {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--white);
    font-size: 0.88rem;
    line-height: 1.45;
    padding: 8px 12px;
    resize: none;
    outline: none;
    min-height: 36px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
    font-family: inherit;
}
.dc-ic-textarea:focus { border-color: rgba(255,255,255,0.22); }
.dc-ic-textarea::placeholder { color: rgba(255,255,255,0.25); }
.dc-ic-tool-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    height: 32px;
    min-width: 32px;
}
.dc-ic-tool-btn:hover { color: var(--gold, #c8a03c); background: rgba(255,255,255,0.05); }
.dc-ic-post-btn {
    background: var(--crimson, #b8972e);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.dc-ic-post-btn:hover { opacity: 0.88; }
.dc-ic-post-btn:disabled { opacity: 0.4; cursor: default; }
/* GIF picker above composer row */
.dc-ic-gif-picker {
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
}
/* GIF grid inside inline composer — compact 3-col tiles */
.dc-ic-gif-picker .pcs-gif-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 220px;
    gap: 5px;
}
.dc-ic-gif-picker .pcs-gif-thumb {
    aspect-ratio: auto;
    height: 76px;
}
.dc-ic-gif-picker .pcs-gif-thumb img {
    height: 76px;
    width: 100%;
    object-fit: cover;
}

/* DM composer GIF picker — compact grid of small thumbnails */
.dc-gif-picker {
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem;
    background: rgba(0,0,0,0.25);
}
.dc-gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}
.dc-gif-item {
    width: 100%;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.12s ease, outline 0.12s ease;
}
.dc-gif-item:hover {
    transform: scale(1.04);
    outline: 2px solid rgba(200, 160, 60, 0.7);
}
/* Media preview strip */
.dc-ic-media-preview {
    margin-bottom: 0.4rem;
    position: relative;
    display: inline-block;
}
.dc-ic-preview-img {
    max-height: 80px;
    border-radius: 6px;
    display: block;
}
.dc-ic-remove-img {
    position: absolute;
    top: -6px;
    right: -6px;
    background: rgba(0,0,0,0.75);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================================================
   ONLINE / OFFLINE SIDEBAR
   ============================================================================ */
.dc-user-name {
    flex: 1;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dc-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dc-status.online { background: #23d160; }
.dc-status.offline { background: rgba(255,255,255,0.2); }
.dc-offline-user .dc-user-name { color: rgba(255,255,255,0.3); }
.dc-offline-user .dc-avatar { opacity: 0.45; }
.dc-offline-section {
    margin-top: 0.5rem;
}
.dc-offline-toggle {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 0.4rem;
    margin-bottom: 0;
    user-select: none;
}
.dc-offline-toggle::-webkit-details-marker { display: none; }
.dc-offline-toggle::before {
    content: '▶';
    font-size: 0.5rem;
    color: rgba(255,255,255,0.3);
    transition: transform 0.2s;
}
details[open] .dc-offline-toggle::before { transform: rotate(90deg); }

/* ================================================
   Like Tooltip — hover heart to see who liked
   ================================================ */
.like-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--navy-dark, #0d1117);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    min-width: 130px;
    max-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    pointer-events: none;
    animation: lt-fadein 0.15s ease;
}
@keyframes lt-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lt-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.35rem;
}
.lt-name {
    font-size: 0.8rem;
    color: #e5e7eb;
    padding: 0.1rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lt-extra {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.25rem;
    font-style: italic;
}

/* ================================================
   Comment Reply Context — right-click to reply
   ================================================ */
.comment-reply-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(212,175,55,0.08);
    border-left: 3px solid var(--gold, #d4af37);
    border-radius: 0 6px 6px 0;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
}
.comment-reply-cancel {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
}
.comment-reply-cancel:hover { color: #fff; }
.comment-reply-ref {
    font-size: 0.72rem;
    color: var(--gold, #d4af37);
    margin-bottom: 0.2rem;
    opacity: 0.85;
}
.comment { cursor: context-menu; }

/* ================================================
   Channel drag-to-reorder (admin)
   ================================================ */
.dc-channel-drag-handle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.2);
    cursor: grab;
    margin-right: 2px;
    flex-shrink: 0;
    user-select: none;
    transition: color 0.15s;
}
.dc-channel-item:hover .dc-channel-drag-handle { color: rgba(255,255,255,0.5); }
.dc-channel-item.dc-channel-dragging { opacity: 0.4; }
.dc-channel-item.dc-channel-drag-over {
    border-top: 2px solid var(--gold, #d4af37);
}

/* ================================================
   Calendar chip drag-to-reschedule
   ================================================ */
.cal-chip[draggable="true"] { cursor: grab; }
.cal-chip.cal-chip-dragging { opacity: 0.35; cursor: grabbing; }
.cal-chip.cal-chip-drag-ready {
    box-shadow: 0 0 0 2px var(--gold, #d4af37);
    cursor: grab;
    animation: chip-drag-pulse 1s ease-in-out infinite;
}
@keyframes chip-drag-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--gold, #d4af37); }
    50%       { box-shadow: 0 0 0 3px rgba(212,175,55,0.5); }
}
.cal-day.cal-day-drop-target {
    background: rgba(212,175,55,0.12) !important;
    box-shadow: inset 0 0 0 2px var(--gold, #d4af37);
}

/* ================================================
   Community feed — fill from bottom
   ================================================ */
.dc-feed-push { flex: 1; min-height: 0; }

/* ================================================
   Themed confirm dialog
   ================================================ */
.pioneer-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fade-in 0.15s ease;
}
.pioneer-confirm-modal {
    background: #141c26;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.25rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: slide-up 0.15s ease;
}
.pioneer-confirm-modal .pcm-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}
.pioneer-confirm-modal p {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.55;
    font-family: 'Inter', sans-serif;
}
.pioneer-confirm-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.pioneer-confirm-cancel {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    padding: 0.55rem 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}
.pioneer-confirm-cancel:hover { background: rgba(255,255,255,0.12); }
.pioneer-confirm-ok {
    background: #b8972e;
    border: none;
    color: #fff;
    padding: 0.55rem 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}
.pioneer-confirm-ok:hover { background: #c01530; }
.pioneer-confirm-ok.pcm-neutral { background: rgba(255,255,255,0.12); }
.pioneer-confirm-ok.pcm-neutral:hover { background: rgba(255,255,255,0.2); }

/* ================================================
   Context Menu (right-click)
   ================================================ */
.ctx-menu {
    position: fixed;
    z-index: 9999;
    background: #141c26;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.6);
    min-width: 160px;
    padding: 4px 0;
    animation: lt-fadein 0.12s ease;
}
.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: background 0.12s;
}
.ctx-menu-item:hover { background: rgba(255,255,255,0.06); }
.ctx-menu-danger { color: #f87171; }
.ctx-menu-danger:hover { background: rgba(248,113,113,0.08); }
.ctx-menu-disabled { color: rgba(255,255,255,0.25); cursor: default; font-size: 0.77rem; }
.ctx-menu-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
.ctx-menu-reactions {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
}
/* Each reaction is a small line-icon over a tiny label (was a big 1.25rem text word). */
.ctx-reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--gold, #c8a03c);
    padding: 5px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    line-height: 1;
}
.ctx-reaction-btn svg { width: 19px; height: 19px; display: block; }
.ctx-reaction-lbl { font-size: 0.6rem; font-weight: 600; color: rgba(255,255,255,0.75); letter-spacing: 0.01em; }
.ctx-reaction-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.12); }
.ctx-reaction-btn:hover .ctx-reaction-lbl { color: #fff; }

/* Reaction pills on posts */
.pc-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.react-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 3px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: opacity 0.12s;
    color: #cbd5e1;
}
.react-pill:hover { opacity: 0.75; }
.react-pill svg { width: 12px; height: 12px; display: block; color: var(--gold, #c8a03c); }
.react-pill-active {
    background: transparent;
    border: none;
    color: var(--gold, #c8a03c);
}
.react-pill-active svg { color: var(--gold, #c8a03c); }

/* ================================================
   Comment header row + delete button
   ================================================ */
.comment-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.comment-delete-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.comment:hover .comment-delete-btn { opacity: 1; }
.comment-delete-btn:hover { color: #f87171; }

/* ================================================
   Voice Note - post card player + composer UI
   ================================================ */
.pc-voice-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--gold, #d4af37);
}
/* Themed custom audio player (.aud) — replaces native <audio controls>. */
.aud {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 5px 12px 5px 5px;
}
.aud-el { display: none !important; }
.aud-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--gold, #c8a03c);
    color: #0a1628;
    padding: 0;
}
.aud-play:active { transform: scale(0.94); }
.aud-ico-pause { display: none; }
.aud.is-playing .aud-ico-play { display: none; }
.aud.is-playing .aud-ico-pause { display: inline; }
.aud-track {
    position: relative;
    flex: 1 1 auto;
    min-width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
}
.aud-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--gold, #c8a03c);
    border-radius: 2px;
}
.aud-time {
    flex: 0 0 auto;
    min-width: 32px;
    text-align: right;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}
.pcs-audio-row {
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}
.pcs-audio-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #f87171;
}
.pcs-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f87171;
    animation: rec-pulse 1s infinite;
    flex-shrink: 0;
}
@keyframes rec-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.pcs-audio-stop {
    margin-left: auto;
    background: rgba(248,113,113,0.15);
    border: 1px solid rgba(248,113,113,0.3);
    border-radius: 6px;
    color: #f87171;
    cursor: pointer;
    padding: 3px 10px;
    font-size: 0.75rem;
}
.pcs-audio-stop:hover { background: rgba(248,113,113,0.25); }

/* ============================================================================
   SUPER ADMIN DASHBOARD
   ============================================================================ */

/* ================================================
   SUPER ADMIN - PROFESSIONAL DASHBOARD
   ================================================ */

/* Main Container */
.super-admin-app {
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    background: #f8f9fa;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.super-admin-header {
    background: #ffffff;
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.super-admin-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.super-admin-logo .pioneer-mark {
    background: #1a1a1a;
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
}

.super-admin-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

/* Navigation */
.super-admin-nav {
    display: flex;
    gap: 0.25rem;
}

.super-admin-nav-item {
    background: none;
    border: none;
    color: #6b7280;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.super-admin-nav-item:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.super-admin-nav-item.active {
    background: #1a1a1a;
    color: #ffffff;
}

.nav-badge {
    display: inline-block;
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
}

/* User Menu */
.super-admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.admin-logout-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.admin-logout-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Content Area */
.super-admin-content {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Container */
.admin-page-container,
.admin-dashboard-container {
    max-width: 100%;
}

/* Page Header */
.page-header,
.dashboard-header {
    margin-bottom: 2rem;
    background: transparent;
}

.page-header h1,
.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.page-subtitle,
.dashboard-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-card-revenue {
    border-left: 3px solid #10b981;
}

.stat-card-warning {
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
}

.stat-card-potential {
    border-left: 3px solid #8b5cf6;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.stat-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.stat-breakdown span {
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
}

.stat-growth {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-growth.positive {
    color: #10b981;
}

.stat-growth.negative {
    color: #ef4444;
}

/* Dashboard Sections */
.dashboard-sections,
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

/* Data Tables */
.table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

.subdomain-link {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8125rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-starter {
    background: #dbeafe;
    color: #1e40af;
}

.badge-pro {
    background: #fef3c7;
    color: #92400e;
}

.badge-enterprise {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-status-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-status-trial {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-status-suspended {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Action Buttons */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.action-btn-view:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.action-btn-suspend:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.action-btn-activate:hover {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.action-btn-delete:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Analytics Dashboard */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.analytics-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.analytics-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.growth-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.growth-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.growth-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
}

.top-org-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: #f9fafb;
    border-radius: 6px;
}

.top-org-rank {
    background: #1a1a1a;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.top-org-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.top-org-users {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Pricing Page */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.pricing-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.pricing-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.pricing-card-featured {
    border-color: #1a1a1a;
    border-width: 2px;
}

.pricing-badge {
    position: absolute;
    top: -10px;
    right: 1.5rem;
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.pricing-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

.pricing-amount span {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.pricing-features li {
    padding: 0.625rem 0;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-stats {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.pricing-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
}

.pricing-summary {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.pricing-summary h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.revenue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.revenue-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
}

.revenue-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.revenue-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #10b981;
}

/* Revenue Page */
.revenue-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.revenue-breakdown-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.revenue-breakdown-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.forecast-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.15s ease;
}

.forecast-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.forecast-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.forecast-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.forecast-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Settings Page */
.admin-settings {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
}

.admin-settings h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 2rem 0;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.settings-section p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Modal */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

@media (max-width: 768px) {
    .admin-modal {
        padding: 1rem;
        align-items: flex-start;
        padding-top: max(1rem, var(--safe-area-inset-top));
    }
}

.admin-modal-content {
    background: #ffffff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
    .admin-modal-content {
        max-width: calc(100% - 2rem);
        max-height: 85vh;
        width: 100%;
    }
}

.admin-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.admin-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.admin-modal-close:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.admin-modal-body {
    padding: 1.5rem;
}

.org-detail-section {
    margin-bottom: 2rem;
}

.org-detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.org-detail-section p {
    color: #6b7280;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.org-detail-section a {
    color: #3b82f6;
    text-decoration: none;
}

.org-detail-section a:hover {
    text-decoration: underline;
}

/* Organization Info Cards */
.org-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.org-info-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.org-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.org-info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
}

.org-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.org-link:hover {
    text-decoration: underline;
}

/* Organization Branding Section */
.org-branding-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.org-branding-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.org-branding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.org-branding-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.org-branding-logo {
    grid-column: span 2;
}

.org-logo-preview {
    max-width: 200px;
    max-height: 60px;
    object-fit: contain;
    padding: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.org-color-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.org-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.org-color-value {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
}

@media (max-width: 768px) {
    .org-info-grid,
    .org-branding-grid {
        grid-template-columns: 1fr;
    }

    .org-branding-logo {
        grid-column: span 1;
    }
}

/* Admin Table in Modal */
.admin-modal .admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-modal .admin-table th {
    background: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-modal .admin-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #1a1a1a;
    border-bottom: 1px solid #e5e7eb;
}

.admin-modal .admin-table tbody tr:hover {
    background: #f9fafb;
}

/* User Management Actions */
.user-role-select {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-role-select:hover {
    border-color: #9ca3af;
}

.user-role-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.user-actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-action-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.user-action-reset {
    background: #ffffff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.user-action-reset:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.user-action-suspend {
    background: #ffffff;
    border-color: #f59e0b;
    color: #f59e0b;
}

.user-action-suspend:hover {
    background: #fffbeb;
    border-color: #d97706;
    color: #d97706;
}

.user-action-delete {
    background: #ffffff;
    border-color: #ef4444;
    color: #ef4444;
}

.user-action-delete:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.form-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1a1a1a;
    transition: all 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Analytics Visualizations */
.analytics-viz-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.analytics-viz-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
}

/* Engagement Bars */
.engagement-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.engagement-bar-item {
    display: grid;
    grid-template-columns: 200px 1fr 80px;
    align-items: center;
    gap: 1rem;
}

.engagement-bar-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.engagement-bar-label span {
    font-size: 0.875rem;
    color: #6b7280;
}

.engagement-bar-label strong {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
}

.engagement-bar-track {
    height: 32px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.engagement-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.engagement-bar-percent {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
}

/* Growth Visualization */
.growth-viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.growth-viz-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
}

.growth-viz-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.growth-viz-bars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    height: 200px;
}

.growth-viz-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.growth-viz-bar-visual {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.growth-viz-bar-fill {
    width: 80%;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.75rem;
    transition: height 0.5s ease;
    min-height: 30px;
}

.growth-viz-bar-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.growth-viz-bar-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
}

/* Top Organisations Visualization */
.top-orgs-viz {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-org-viz-item {
    display: grid;
    grid-template-columns: 40px 200px 1fr 120px;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.top-org-viz-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.top-org-viz-rank {
    width: 32px;
    height: 32px;
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.top-org-viz-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
}

.top-org-viz-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.top-org-viz-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.top-org-viz-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6b7280;
    text-align: right;
}

.no-data {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    padding: 2rem;
}

/* Responsive Analytics */
@media (max-width: 768px) {
    .engagement-bar-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .engagement-bar-label {
        flex-direction: row;
        justify-content: space-between;
    }

    .engagement-bar-percent {
        text-align: left;
    }

    .top-org-viz-item {
        grid-template-columns: 40px 1fr 100px;
        gap: 0.75rem;
    }

    .top-org-viz-name {
        grid-column: 2 / 4;
    }

    .top-org-viz-bar {
        grid-column: 2 / 4;
    }

    .growth-viz-bars {
        height: 180px;
        gap: 1rem;
    }

    .growth-viz-bar-visual {
        height: 130px;
    }
}

/* Loading & Error States */
.loading {
    padding: 3rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.error {
    padding: 2rem;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
}

/* Demo Request Modal Styles */
.detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.detail-row {
    display: flex;
    margin-bottom: 0.75rem;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 120px;
    font-size: 0.875rem;
}

.detail-value {
    color: #1a1a1a;
    font-size: 0.875rem;
    flex: 1;
}

.detail-value a {
    color: #3b82f6;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* Demo Request Modal - White Background Override */
#demo-request-modal .modal-content {
    background: white !important;
}

#demo-request-modal .modal-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

#demo-request-modal .modal-header h2 {
    color: #1a1a1a;
    margin: 0;
}

#demo-request-modal .modal-footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

#demo-request-modal .detail-section p {
    background: #f9fafb !important;
    color: #1a1a1a !important;
    padding: 1rem;
    border-radius: 8px;
    margin: 0;
    border: 1px solid #e5e7eb;
    user-select: text;
    -webkit-user-select: text;
}

#demo-request-modal .modal-close {
    background: transparent;
    color: #6b7280;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

#demo-request-modal .modal-close:hover {
    color: #1a1a1a;
}

#demo-request-modal .form-input {
    background: white;
    color: #1a1a1a;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.875rem;
}

#demo-request-modal .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Filter Tabs for Demo Requests */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: #1a1a1a;
}

.filter-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ============================================================================
   MOBILE/PWA RESPONSIVE STYLES
   ============================================================================ */

/* Mobile-optimized Stats Grid */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Mobile-optimized Filter Tabs */
@media (max-width: 640px) {
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .filter-tab {
        display: inline-block;
        flex-shrink: 0;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile-optimized Data Tables - Convert to Card View */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
    }

    .data-table {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: block;
    }

    .data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .data-table tbody tr:hover {
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .data-table tbody td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        text-align: left;
    }

    .data-table tbody td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.25rem;
    }

    /* Actions cell should stack buttons vertically */
    .actions-cell {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem !important;
        border-top: 1px solid #f3f4f6;
        margin-top: 0.5rem;
    }

    .actions-cell:before {
        display: none;
    }

    .action-btn {
        width: 100%;
        text-align: center;
        margin: 0 !important;
    }
}

/* Mobile-optimized Action Buttons */
@media (max-width: 480px) {
    .action-btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
}

/* Mobile-optimized Page Header */
@media (max-width: 640px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }
}

/* Mobile-optimized Modal */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* Touch-friendly button sizes (Apple HIG: min 44x44px) */
@media (hover: none) and (pointer: coarse) {
    button, .btn, .action-btn, .filter-tab {
        min-height: 44px;
        min-width: 44px;
    }

    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

/* Mobile Navigation */
@media (max-width: 640px) {
    .super-admin-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }

    .super-admin-nav-item {
        display: inline-flex;
        min-width: auto;
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Mobile-optimized Status Badges */
@media (max-width: 640px) {
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}


/* ================================================
   PWA BOTTOM NAVIGATION
   ================================================ */
.pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy-light);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    padding: 0.5rem 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .pwa-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .app-nav {
        display: none !important;
    }
}

.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.2s;
    text-align: center;
    min-width: 60px;
}

.pwa-nav-item svg {
    width: 20px;
    height: 20px;
}

.pwa-nav-item.active {
    color: var(--gold);
}

.pwa-nav-item:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ================================================
   STATUS BADGES - Reusable Components
   ================================================ */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge-available {
    background: rgba(52, 199, 89, 0.2);
    color: var(--status-available);
}

.status-badge-waitlist {
    background: rgba(255, 149, 0, 0.2);
    color: var(--status-waitlist);
}

.status-badge-full {
    background: rgba(239, 68, 68, 0.2);
    color: var(--status-full);
}

.status-badge-booked {
    background: rgba(52, 199, 89, 0.2);
    color: var(--status-booked);
}

.status-badge-special {
    background: var(--special-badge-bg);
    color: var(--special-badge-text);
}

/* ================================================
   MACRO NUTRITION BADGES
   ================================================ */
.macro-badge-protein {
    color: var(--macro-protein);
}

.macro-bar-protein {
    background: var(--macro-protein);
}

.macro-badge-carbs {
    color: var(--macro-carbs);
}

.macro-bar-carbs {
    background: var(--macro-carbs);
}

.macro-badge-fat {
    color: var(--macro-fat);
}

.macro-bar-fat {
    background: var(--macro-fat);
}

/* ================================================
   CARD STYLES - Consistent Containers
   ================================================ */
.content-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
}

.content-card-text-primary {
    color: rgba(255, 255, 255, 0.95);
}

.content-card-text-secondary {
    color: rgba(255, 255, 255, 0.7);
}

.content-card-text-muted {
    color: rgba(255, 255, 255, 0.5);
}

/* ================================================
   BOOKING CARDS
   ================================================ */
.booking-card-available {
    border-left: 3px solid var(--status-available);
}

.booking-card-waitlist {
    border-left: 3px solid var(--status-waitlist);
}

/* ================================================
   PWA INSTALL PROMPT
   ================================================ */
.install-toast {
    will-change: transform;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* Mobile adjustments for install prompt */
@media (max-width: 768px) {
    .install-toast {
        bottom: 70px !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        flex-direction: column;
        text-align: center;
    }

    .install-toast button {
        width: 100%;
    }
}

/* ================================================
   PHOTO UPLOAD & BARCODE SCANNING FEATURES
   AI-powered nutrition tracking enhancements
   ================================================ */

/* ── Photo Scan Container ────────────────────────────────────────────── */
.photo-scan-container,
.barcode-scan-container {
    padding: 1.5rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.photo-hint {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(200, 160, 60, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-left: 3px solid var(--crimson);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Choice Buttons Grid ──────────────────────────────────────────────── */
.photo-choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.photo-choice-btn,
.barcode-scan-btn {
    width: 100%;
    min-height: 56px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--navy-medium) 0%, var(--navy-light) 100%);
    border: 2px solid rgba(200, 160, 60, 0.3);
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.photo-choice-btn:hover,
.barcode-scan-btn:hover {
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
    border-color: var(--crimson-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.photo-choice-btn:active,
.barcode-scan-btn:active {
    transform: translateY(0);
}

/* ── Camera View Area ─────────────────────────────────────────────────── */
#photo-camera-area,
#photo-preview-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

#photo-video-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--shadow-lg);
}

#photo-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

.camera-controls,
.preview-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.capture-photo-btn {
    flex: 1;
    min-height: 56px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(200, 160, 60, 0.3);
}

.capture-photo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 160, 60, 0.4);
}

.cancel-camera-btn,
.retake-photo-btn {
    min-height: 56px;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cancel-camera-btn:hover,
.retake-photo-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ── Photo Preview Area ───────────────────────────────────────────────── */
#photo-preview {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

.analyze-photo-btn {
    flex: 1;
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.analyze-photo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

.analyze-photo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Barcode Scanner Area ─────────────────────────────────────────────── */
#barcode-scanner-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
}

#barcode-video-container {
    position: relative;
    max-width: 500px;
    width: 100%;
    margin: 1rem auto 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--shadow-lg);
}

#barcode-video {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 0 auto;
}

#barcode-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barcode-target-box {
    width: 80%;
    height: 40%;
    border: 3px solid #00ff00;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5),
                inset 0 0 20px rgba(0, 255, 0, 0.2);
    animation: scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.stop-scan-btn {
    width: 100%;
    max-width: 500px;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin: 0 auto;
}

.stop-scan-btn:hover {
    background: linear-gradient(135deg, var(--crimson-dark) 0%, #7a1020 100%);
    transform: translateY(-1px);
}

/* ── Analysis/Product Results Cards ───────────────────────────────────── */
.photo-analysis-card,
.barcode-product-card {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-medium) 100%);
    border: 2px solid rgba(200, 160, 60, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideUpFade 0.4s ease;
}

.photo-analysis-card h3,
.barcode-product-card h3 {
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.photo-analysis-card p,
.barcode-product-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 1rem;
}

.barcode-product-card img {
    display: block;
    margin: 0 auto 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Macro Display Grid ───────────────────────────────────────────────── */
.photo-macros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.macro-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: var(--transition);
}

.macro-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(200, 160, 60, 0.3);
    transform: translateY(-2px);
}

.macro-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.macro-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Confidence/Info Notes ────────────────────────────────────────────── */
.confidence-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Add to Meal Buttons ──────────────────────────────────────────────── */
.add-ai-meal-btn,
.add-barcode-product-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 1rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(200, 160, 60, 0.3);
}

.add-ai-meal-btn:hover,
.add-barcode-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 160, 60, 0.4);
    background: linear-gradient(135deg, var(--crimson-light) 0%, var(--crimson) 100%);
}

.add-ai-meal-btn:active,
.add-barcode-product-btn:active {
    transform: translateY(0);
}

/* ── Error States ─────────────────────────────────────────────────────── */
.photo-error,
.barcode-error {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(184, 151, 46, 0.05) 100%);
    border: 2px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--radius-lg);
    color: #ff6b6b;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile Optimizations ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .photo-scan-container,
    .barcode-scan-container {
        padding: 1rem;
        gap: 1rem;
    }

    .photo-hint {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .photo-choice-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .photo-choice-btn,
    .barcode-scan-btn {
        min-height: 52px;
        font-size: 0.95rem;
    }

    #photo-video-container,
    #barcode-video-container {
        max-width: 100%;
    }

    #photo-preview {
        max-width: 100%;
    }

    .camera-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    /* Retake + Scan-with-AI sit side by side after a capture. */
    .preview-controls {
        flex-direction: row;
        gap: 0.6rem;
    }
    .preview-controls .analyze-photo-btn,
    .preview-controls .retake-photo-btn {
        flex: 1;
        width: auto;
        min-height: 52px;
    }
    .capture-photo-btn,
    .cancel-camera-btn {
        width: 100%;
    }

    .stop-scan-btn {
        max-width: 100%;
    }

    .photo-analysis-card,
    .barcode-product-card {
        padding: 1.25rem;
    }

    .photo-analysis-card h3,
    .barcode-product-card h3 {
        font-size: 1.2rem;
    }

    .photo-macros {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .macro-item {
        padding: 0.875rem 0.5rem;
    }

    .macro-value {
        font-size: 1.35rem;
    }

    .macro-label {
        font-size: 0.7rem;
    }
}

/* ── Small Mobile (iPhone SE, etc.) ───────────────────────────────────── */
@media (max-width: 375px) {
    .photo-macros {
        grid-template-columns: repeat(2, 1fr);
    }

    .macro-item {
        padding: 0.75rem 0.5rem;
    }

    .macro-value {
        font-size: 1.25rem;
    }
}

/* ── Touch Device Enhancements ────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .photo-upload-btn:active,
    .barcode-scan-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .add-ai-meal-btn:active,
    .add-barcode-product-btn:active {
        transform: scale(0.98);
    }
}
/* ================================================
   EXERCISE LIBRARY - Matching PIONEER Theme
   ================================================ */

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

/* Filters Section */
.ex-lib-filters {
    background: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    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: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

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

.ex-lib-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.ex-lib-filter-btn.active {
    background: var(--crimson);
    border-color: var(--crimson);
    color: white;
}

/* Search Row */
.ex-lib-search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ex-lib-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: var(--transition);
}

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

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

/* View Toggle */
.ex-lib-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.ex-view-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.ex-view-btn.active {
    background: var(--crimson);
    color: white;
}

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

/* Exercise Grid - List View */
.ex-lib-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.ex-lib-grid.list-view .ex-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
}

.ex-lib-grid.list-view .ex-card-header {
    flex: 1;
    margin-bottom: 0;
}

.ex-lib-grid.list-view .ex-card-meta {
    flex-shrink: 0;
    margin: 0 1rem;
}

.ex-lib-grid.list-view .ex-card-muscles,
.ex-lib-grid.list-view .ex-card-desc {
    display: none;
}

.ex-lib-grid.list-view .ex-card-actions {
    flex-shrink: 0;
    margin-top: 0;
}

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

.ex-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Card Header */
.ex-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ex-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.4;
}

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

.ex-card-video-link:hover {
    color: var(--crimson);
}

/* Card Meta - Badges */
.ex-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ex-card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category Badges */
.ex-card-badge-strength {
    background: rgba(200, 160, 60, 0.2);
    color: #ff6b85;
    border: 1px solid rgba(200, 160, 60, 0.3);
}

.ex-card-badge-cardio {
    background: rgba(23, 162, 184, 0.2);
    color: #4dd0e1;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.ex-card-badge-swimming {
    background: rgba(52, 199, 89, 0.2);
    color: #66d9a9;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.ex-card-badge-mobility {
    background: rgba(243, 156, 18, 0.2);
    color: #ffb84d;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.ex-card-badge-plyometric {
    background: rgba(156, 39, 176, 0.2);
    color: #ba68c8;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.ex-card-badge-balance {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.ex-card-badge-rehab {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.ex-card-badge-core {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Difficulty Badges */
.ex-card-badge-diff-beginner {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.ex-card-badge-diff-intermediate {
    background: rgba(243, 156, 18, 0.2);
    color: #ffb84d;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.ex-card-badge-diff-advanced {
    background: rgba(200, 160, 60, 0.2);
    color: #e8c87a;
    border: 1px solid rgba(200, 160, 60, 0.3);
}

/* Equipment Badge */
.ex-card-badge-eq {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Muscles */
.ex-card-muscles {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
}

.ex-card-muscles strong {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

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

/* Card Actions */
.ex-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ex-card-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.ex-card-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.ex-card-btn-view {
    background: var(--crimson);
    border-color: var(--crimson);
    color: white;
}

.ex-card-btn-view:hover {
    background: var(--crimson-dark);
    border-color: var(--crimson-dark);
}

.ex-card-btn-add {
    flex: 0 0 auto;
    width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Empty State */
.ex-lib-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.ex-lib-empty h3 {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

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

/* Actions Section */
.ex-lib-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
    .ex-lib-grid {
        grid-template-columns: 1fr;
    }

    .ex-lib-search-row {
        flex-direction: column;
        align-items: stretch;
    }

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

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

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



/* Post action buttons - properly aligned icons */
.dc-post-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dc-post-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 36px;
}

.dc-post-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.dc-post-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dc-post-action-btn.liked {
    color: var(--pioneer-gold, #c8a03c);
}

.dc-post-action-count {
    font-weight: 600;
    font-size: 0.875rem;
}



/* Online/Offline status dots */
.dc-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--pioneer-navy, #0f1419);
    z-index: 1;
}

.dc-status-dot.online {
    background: #34C759;
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.6);
}

.dc-status-dot.offline {
    background: rgba(255, 255, 255, 0.3);
}
/* Bookings Tab - Class Card Hover Effects */
.class-booking-header:hover { background: #f9fafb !important; }

/* =================================================================== */
/* ANALYTICS DASHBOARD - MOBILE RESPONSIVE (PWA)                      */
/* =================================================================== */

/* Mobile optimizations for analytics hero stats */
@media (max-width: 600px) {
    /* Hero stats - stack single column on mobile */
    .admin-page-container > div[style*="grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Reduce hero stat font sizes for mobile */
    .stat-card .stat-value[style*="font-size: 3rem"] {
        font-size: 2.25rem !important;
    }

    /* Smaller icon badges on mobile */
    .stat-card > div > div[style*="width: 48px; height: 48px"] {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.25rem !important;
    }

    /* Change "Click" to "Tap" on mobile - hide original, show mobile version */
    .stat-sublabel {
        font-size: 0.8rem !important;
    }

    /* Secondary metrics - single column on small screens */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Organization breakdown - single column */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Expandable card details - better mobile scrolling */
    .card-details[style*="max-height: 300px"] {
        max-height: 400px !important;
    }

    /* Page header responsive */
    .page-header h1 {
        font-size: 1.5rem !important;
    }

    .page-header .page-subtitle {
        font-size: 0.85rem !important;
    }

    /* Organization breakdown section padding */
    div[style*="background: rgba(255,255,255,0.02)"] {
        padding: 1rem !important;
    }

    /* Organization breakdown title */
    h3[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
    }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 400px) {
    /* Even smaller hero stats on tiny screens */
    .stat-card .stat-value[style*="font-size: 3rem"],
    .stat-card .stat-value[style*="font-size: 2.25rem"] {
        font-size: 2rem !important;
    }

    /* Secondary metrics font size */
    .stat-card .stat-value[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }

    /* Reduce padding */
    .admin-page-container {
        padding: 1rem !important;
    }
}

/* Touch feedback for expandable cards */
@media (hover: none) and (pointer: coarse) {
    /* Mobile touch devices */
    .expandable-card {
        -webkit-tap-highlight-color: rgba(200, 160, 60, 0.1);
        transition: background-color 0.15s ease;
    }

    .expandable-card:active {
        background-color: rgba(255, 255, 255, 0.05) !important;
        transform: scale(0.98);
    }

    /* Ensure minimum 48px touch targets */
    .stat-card {
        min-height: 48px;
        padding: 1rem !important;
    }
}

/* Tablet breakpoint */
@media (min-width: 601px) and (max-width: 900px) {
    /* Two columns for hero stats on tablets */
    .admin-page-container > div[style*="grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Organization breakdown - 2 columns */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
.btn-cancel-booking:hover { background: #dc2626 !important; }

/* ============================================================
   REHAB LIBRARY - Admin UI
   ============================================================ */

.rehab-library-admin {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.rehab-library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.rehab-library-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary, #111);
}

.rehab-library-subtitle {
    margin: 0;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
}

.rehab-category-section {
    margin-bottom: 2.5rem;
}

.rehab-category-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #666);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rehab-category-count {
    background: var(--accent, #4f46e5);
    color: #fff;
    border-radius: 9999px;
    font-size: 0.75rem;
    padding: 0.1em 0.55em;
    font-weight: 600;
}

.rehab-conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.rehab-condition-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.15s;
}

.rehab-condition-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.rehab-condition-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary, #111);
}

.rehab-condition-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rehab-meta-pill {
    background: var(--pill-bg, #f3f4f6);
    color: var(--text-muted, #555);
    border-radius: 9999px;
    font-size: 0.75rem;
    padding: 0.15em 0.6em;
    white-space: nowrap;
}

.rehab-condition-desc {
    font-size: 0.82rem;
    color: var(--text-muted, #666);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rehab-view-btn {
    margin-top: 0.4rem;
    background: var(--accent, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: opacity 0.15s;
}

.rehab-view-btn:hover { opacity: 0.85; }

/* Detail view */
.rehab-detail-admin {
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.rehab-detail-header {
    margin-bottom: 2rem;
}

.rehab-back-btn {
    background: none;
    border: none;
    color: var(--accent, #4f46e5);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.rehab-back-btn:hover { text-decoration: underline; }

.rehab-detail-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.rehab-detail-meta {
    margin: 0 0 0.5rem;
    color: var(--text-muted, #666);
    font-size: 0.88rem;
    text-transform: capitalize;
}

.rehab-detail-desc {
    margin: 0;
    color: var(--text-secondary, #444);
    font-size: 0.9rem;
}

.rehab-phases-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rehab-phase-block {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}

.rehab-phase-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--accent, #4f46e5);
    color: #fff;
    padding: 0.75rem 1.25rem;
}

.rehab-phase-num {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    white-space: nowrap;
}

.rehab-phase-name {
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
}

.rehab-phase-duration {
    font-size: 0.82rem;
    opacity: 0.8;
    white-space: nowrap;
}

.rehab-phase-body {
    padding: 1.25rem;
    background: var(--card-bg, #fff);
}

.rehab-phase-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.rehab-phase-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #666);
    margin: 0 0 0.4rem;
}

.rehab-phase-col ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.83rem;
    color: var(--text-secondary, #333);
}

.rehab-phase-col ul li { margin-bottom: 0.25rem; }

.rehab-precautions {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 0.6rem 0.9rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.83rem;
    margin-bottom: 1rem;
    color: #78350f;
}

.rehab-session-block {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.rehab-session-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-subtle, #f9fafb);
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rehab-session-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.rehab-ex-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.rehab-ex-table th {
    background: var(--bg-subtle, #f9fafb);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #666);
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.rehab-ex-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border, #f3f4f6);
    color: var(--text-secondary, #333);
    vertical-align: top;
}

.rehab-ex-table tr:last-child td { border-bottom: none; }

.rehab-ex-table tr:hover td { background: var(--hover-bg, #f9fafb); }

.rehab-ex-notes {
    color: var(--text-muted, #666) !important;
    font-style: italic;
    max-width: 220px;
}

.rehab-no-ex {
    padding: 1rem;
    color: var(--text-muted, #888);
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 768px) {
    .rehab-phase-cols { grid-template-columns: 1fr; }
    .rehab-conditions-grid { grid-template-columns: 1fr; }
    .rehab-session-title { flex-direction: column; align-items: flex-start; }
}

/* Password field with show/hide eye toggle (auth pages) */
.pw-field {
    position: relative;
    display: flex;
    align-items: center;
}
.pw-field input {
    width: 100%;
    padding-right: 44px !important;
}
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s;
}
.pw-toggle:hover { color: var(--gold, #c8a03c); }

/* ================================================
   Wheel picker (iOS-style scroll-snap value picker)
   ================================================ */
.wheel-overlay {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(8, 14, 26, 0.55);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.wheel-overlay.active { opacity: 1; visibility: visible; }
.wheel-sheet {
    width: 100%; max-width: 460px;
    background: var(--navy, #0a1628);
    border-top-left-radius: 18px; border-top-right-radius: 18px;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
    transform: translateY(100%); transition: transform 0.22s ease;
}
.wheel-overlay.active .wheel-sheet { transform: translateY(0); }
.wheel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.1rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.wheel-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.wheel-cancel, .wheel-done {
    background: transparent; border: none; cursor: pointer;
    font-size: 0.95rem; font-weight: 700; padding: 0.2rem 0.3rem;
}
.wheel-cancel { color: rgba(255,255,255,0.45); }
.wheel-done { color: var(--gold, #c8a03c); }
.wheel-wrap { position: relative; height: 200px; overflow: hidden; }
.wheel-band {
    position: absolute; left: 0; right: 0; top: 80px; height: 40px;
    border-top: 1px solid rgba(200,160,60,0.5); border-bottom: 1px solid rgba(200,160,60,0.5);
    background: rgba(200,160,60,0.06); pointer-events: none; z-index: 1;
}
.wheel {
    height: 200px; overflow-y: scroll; scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-pad { height: 80px; }
.wheel-item {
    height: 40px; line-height: 40px; text-align: center;
    font-size: 1.25rem; font-weight: 600; color: rgba(255,255,255,0.85);
    scroll-snap-align: center;
}

/* Step-goal modal quick chips */
.steps-goal-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.7rem; }
.steps-goal-chip {
    background: transparent; border: 1px solid rgba(200,160,60,0.4); color: var(--gold, #c8a03c);
    border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.steps-goal-chip:hover { background: rgba(200,160,60,0.12); }

/* Calendar month change: smooth fade in place (no loader flash). */
@keyframes calFade { from { opacity: 0.4; } to { opacity: 1; } }
.db-cal-panel.cal-fade { animation: calFade 0.18s ease; }

/* Legal/policy links: clearly look like links (gold + underlined), overriding the global a{} reset. */
.policy-link { color: var(--gold, #c8a03c) !important; text-decoration: underline !important; font-weight: 600; }

/* Booked classes as cards (no horizontal scroll on mobile). */
.mbk-cards { display: flex; flex-direction: column; gap: 0.6rem; }
.mbk-card { background: #142238; border: 1px solid rgba(200,160,60,0.2); border-radius: 12px; padding: 0.85rem 1rem; }
.mbk-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.mbk-card-name { color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1.25; min-width: 0; }
.mbk-card-meta { color: rgba(255,255,255,0.6); font-size: 0.76rem; margin-top: 0.25rem; }
.mbk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.65rem; }
.mbk-card-when { color: rgba(255,255,255,0.85); font-size: 0.85rem; font-weight: 600; }
.mbk-cancel { padding: 0.4rem 0.85rem; min-height: 36px; background: transparent; color: var(--gold, #c8a03c); border: 1px solid var(--gold, #c8a03c); border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

/* ===== CORE AUTOFIT — pull every page's content to the screen edge ==========
   The app shell (#page-content) is already full-bleed, but each page's wrapper
   (.dashboard-page, .nutrition-page, every tier's container, etc.) was sitting
   inset because a class rule carried a stray horizontal margin/padding. Target
   the wrapper at ID specificity (#page-content > *) so it beats ALL class rules:
   margin 0, max-width none, and ONE consistent hairline edge via the token.
   Applies to member, org-admin and super-admin tiers alike. */
@media (max-width: 768px) {
  main#page-content, #page-content { padding-left: 0 !important; padding-right: 0 !important; }
  #page-content > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    padding-left: var(--edge-mobile) !important;
    padding-right: var(--edge-mobile) !important;
  }
  /* Community is a flush full-bleed layout — no edge inset. */
  #page-content.page-community > * { padding-left: 0 !important; padding-right: 0 !important; }
}

/* ===== Assessment archive button + items + result detail ===== */
.assess-archive-btn {
    background: transparent; border: none; color: var(--gold, #d4af37); cursor: pointer;
    width: 38px; height: 38px; flex: 0 0 auto; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    -webkit-appearance: none; appearance: none; transition: opacity 0.15s;
}
.assess-archive-btn:hover { opacity: 0.8; }
.assess-archive-item {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 0.7rem 0.85rem; margin-bottom: 0.5rem; cursor: pointer;
    transition: background 0.15s, border-color 0.15s; -webkit-appearance: none; appearance: none;
}
.assess-archive-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(212,175,55,0.35); }
.aai-name { color: #fff; font-weight: 600; font-size: 0.95rem; }
.aai-meta { color: rgba(255,255,255,0.55); font-size: 0.8rem; }
.ar-detail-scores { display: flex; flex-direction: column; gap: 0.4rem; }
.ar-detail-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 0.7rem; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07); border-radius: 8px;
    color: rgba(255,255,255,0.8); font-size: 0.9rem;
}
.ar-detail-row strong { color: #fff; }
.ar-detail-empty { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin: 0; }

/* ===== Assessment progression (Progress page) ===== */
.apg-section { margin: 0 0 1rem; padding: 1rem 1.1rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; }
.apg-sub { margin: 0 0 0.85rem; color: rgba(255,255,255,0.5); font-size: 0.82rem; }
.apg-group { margin-bottom: 0.9rem; }
.apg-group:last-child { margin-bottom: 0; }
.apg-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.apg-name { color: #fff; font-weight: 600; font-size: 0.92rem; }
.apg-track { display: flex; align-items: stretch; gap: 0.4rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.2rem; }
.apg-point { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 0.5rem 0.6rem; background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.25); border-radius: 10px; cursor: pointer; -webkit-appearance: none; appearance: none; transition: background 0.15s, border-color 0.15s; }
.apg-point:hover { background: rgba(212,175,55,0.16); border-color: var(--gold, #d4af37); }
.apg-score { color: var(--gold, #d4af37); font-weight: 700; font-size: 1rem; }
.apg-date { color: rgba(255,255,255,0.5); font-size: 0.68rem; white-space: nowrap; }
.apg-arrow { display: flex; align-items: center; color: rgba(255,255,255,0.3); font-size: 0.9rem; flex: 0 0 auto; }

/* ===== Profile: App version / update ===== */
.app-update-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.aus-version { color: #fff; font-weight: 600; font-size: 0.95rem; }
.aus-build { color: rgba(255,255,255,0.5); font-weight: 400; font-size: 0.82rem; }
.aus-status { color: rgba(255,255,255,0.55); font-size: 0.82rem; margin-top: 2px; }

/* ===== Profile reminder scheduling controls (time / class lead / nutrition) ===== */
.settings-time-input,
.settings-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    -webkit-appearance: none; appearance: none;
    cursor: pointer;
    min-width: 140px;
}
.settings-select option { background: #0f1a2e; color: #fff; }
.settings-time-input::-webkit-calendar-picker-indicator { filter: invert(0.85); cursor: pointer; }

/* Offline sync badge — "N items waiting to upload" (tap to retry) */
#offline-sync-badge {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 2000;
    background: rgba(212,175,55,0.96); color: #0a1628;
    border: none; border-radius: 999px; padding: 0.42rem 0.95rem;
    font-size: 0.78rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* ===== Custom programme builder — clear, labelled creation methods ===== */
.cpb-methods-label { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; color:rgba(255,255,255,0.45); font-weight:700; margin:0 0 0.65rem; }
.cpb-method { background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:12px; padding:0.9rem 1rem; margin-bottom:0.85rem; }
.cpb-method-title { font-weight:700; font-size:0.98rem; color:#fff; margin-bottom:0.2rem; }
.cpb-method-desc { font-size:0.8rem; color:rgba(255,255,255,0.55); margin:0 0 0.7rem; line-height:1.4; }
.cpb-link-btn { display:block; width:100%; margin-top:0.5rem; background:transparent; border:none; color:var(--gold,#d4af37); font-size:0.82rem; cursor:pointer; padding:0.3rem; text-align:center; }
.cpb-link-btn:hover { opacity:0.8; }

/* Every editable field must allow text selection + the long-press Paste menu (Android/iOS WebView swallow it without this) */
input[type="text"], input[type="url"], input[type="email"], input[type="search"],
input[type="number"], input[type="password"], input[type="tel"], input:not([type]),
textarea, [contenteditable="true"] {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
