/* ========== THEME VARIABLES ========== */

[data-theme="synthwave"] {
    --bg-anim-1: #0d0d12;
    --bg-anim-2: #1a1025;
    --bg-anim-3: #0a1510;
    --bg-anim-4: #25120f;
    --bg-surface: #1c1c1e;
    --bg-surface-elevated: #1c1c2e;
    --bg-input: #2c2c2e;
    --bg-secondary: #252528;
    --bg-subtle: #2a2a2e;

    --accent-primary: #39ff14;
    --accent-primary-rgb: 57, 255, 20;
    --accent-primary-dark: #1a8f0b;
    --accent-secondary: #ff5e00;
    --accent-secondary-rgb: 255, 94, 0;
    --accent-secondary-dark: #993800;
    --accent-tertiary: #b026ff;
    --accent-tertiary-rgb: 176, 38, 255;
    --accent-pink: #ff107a;
    --accent-cyan: #00e5ff;
    --accent-blue: #007aff;
    --accent-blue-rgb: 0, 122, 255;

    --brand-gradient: linear-gradient(90deg, #39ff14, #ff107a, #b026ff, #ff5e00);
    --brand-gradient-135: linear-gradient(135deg, #39ff14, #ff107a, #b026ff, #ff5e00);
    --brand-gradient-dim: linear-gradient(135deg, #2a4a1a, #4a1a2a, #2a1a4a, #4a2a1a);

    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-soft: #cccccc;
    --text-muted: #aaaaaa;
    --text-faint: #777777;
    --text-faint2: #666666;
    --text-faint3: #555555;

    --border-subtle: #333333;
    --border-mid: #444444;
    --border-faint: #2a2a2a;

    --success: #34c759;
    --success-rgb: 52, 199, 89;
    --danger: #ff3b30;
    --strava: #fc4c02;

    --cal-lift: #39ff14;
    --cal-lift-rgb: 57, 255, 20;
    --cal-cardio: #ff9500;
    --cal-cardio-rgb: 255, 149, 0;
    --cal-both: #0a84ff;
    --cal-both-rgb: 10, 132, 255;

    --wc-back: #39ff14;
    --wc-chest: #ff107a;
    --wc-legs: #b026ff;
    --wc-arms: #00e5ff;
    --wc-cardio: #ff5e00;
    --wc-default: #007aff;

    --stat-1: #007aff;
    --stat-1-rgb: 0, 122, 255;
    --stat-1-text: #4da6ff;
    --stat-2: #ff5e00;
    --stat-2-rgb: 255, 94, 0;
    --stat-2-text: #ff9d4d;
    --stat-3: #b026ff;
    --stat-3-rgb: 176, 38, 255;
    --stat-3-text: #d98cff;
    --stat-4: #39ff14;
    --stat-4-rgb: 57, 255, 20;
    --stat-4-text: #8cff73;

    --text-shadow-strong: 1px 1px 2px #000;
    --text-outline: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    --text-glow-subtle: rgba(255, 255, 255, 0.15);

    --warning: #ff9500;
    --danger-rgb: 255, 59, 48;

    --overlay-bg: rgba(0, 0, 0, 0.72);
    --overlay-bg-deep: rgba(0, 0, 0, 0.85);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-bg-faint: rgba(255, 255, 255, 0.06);

    --nav-icon-filter: grayscale(1) brightness(0.45);
    --nav-icon-active-filter: none drop-shadow(0 0 6px rgba(57, 255, 20, 0.9));

    --nav-label-transform: none;
    --nav-label-spacing: 0.3px;
    --heading-weight: 700;
    --heading-spacing: 0px;
    --body-line-height: 1.4;
    --logo-spacing: 1px;

}

[data-theme="midnight"] {
    /* Backgrounds: near-black → deep navy progression */
    --bg-anim-1: #020409;
    --bg-anim-2: #060d1c;
    --bg-anim-3: #040a14;
    --bg-anim-4: #080f1e;
    --bg-surface: #0d1626;
    --bg-surface-elevated: #111e32;
    --bg-input: #0f1c2e;
    --bg-secondary: #0b1220;
    --bg-subtle: #0e1828;

    /* Accents: steel blue primary, sky blue secondary, soft indigo tertiary */
    --accent-primary: #3b82f6;
    --accent-primary-rgb: 59, 130, 246;
    --accent-primary-dark: #1d4ed8;
    --accent-secondary: #38bdf8;
    --accent-secondary-rgb: 56, 189, 248;
    --accent-secondary-dark: #0284c7;
    --accent-tertiary: #818cf8;
    --accent-tertiary-rgb: 129, 140, 248;
    --accent-pink: #c084fc;
    --accent-cyan: #38bdf8;
    --accent-blue: #3b82f6;
    --accent-blue-rgb: 59, 130, 246;

    /* Brand gradient: steel blue → sky → soft indigo → silver blue */
    --brand-gradient: linear-gradient(90deg, #3b82f6, #38bdf8, #818cf8, #93c5fd);
    --brand-gradient-135: linear-gradient(135deg, #3b82f6, #38bdf8, #818cf8, #93c5fd);
    --brand-gradient-dim: linear-gradient(135deg, #182040, #0e1a30, #1c1a44, #0e1a30);

    /* Text: cool silver-blue tones */
    --text-primary: #e8edf8;
    --text-secondary: #c8d4ec;
    --text-soft: #9aaac8;
    --text-muted: #7888a8;
    --text-faint: #566480;
    --text-faint2: #455070;
    --text-faint3: #374060;

    /* Borders: restrained blue-steel */
    --border-subtle: #1a2640;
    --border-mid: #223050;
    --border-faint: #141e32;

    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --danger: #f87171;
    --strava: #fc4c02;

    --cal-lift: #3b82f6;
    --cal-lift-rgb: 59, 130, 246;
    --cal-cardio: #f59e0b;
    --cal-cardio-rgb: 245, 158, 11;
    --cal-both: #2dd4bf;
    --cal-both-rgb: 45, 212, 191;

    --wc-back: #3b82f6;
    --wc-chest: #c084fc;
    --wc-legs: #818cf8;
    --wc-arms: #38bdf8;
    --wc-cardio: #f59e0b;
    --wc-default: #60a5fa;

    --stat-1: #3b82f6;
    --stat-1-rgb: 59, 130, 246;
    --stat-1-text: #93c5fd;
    --stat-2: #38bdf8;
    --stat-2-rgb: 56, 189, 248;
    --stat-2-text: #7dd3fc;
    --stat-3: #818cf8;
    --stat-3-rgb: 129, 140, 248;
    --stat-3-text: #a5b4fc;
    --stat-4: #10b981;
    --stat-4-rgb: 16, 185, 129;
    --stat-4-text: #6ee7b7;

    --text-shadow-strong: 1px 1px 3px rgba(0, 0, 20, 0.9);
    --text-outline: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    /* Blue-tinted glow for headings — more refined than plain white */
    --text-glow-subtle: rgba(147, 197, 253, 0.18);

    --warning: #f59e0b;
    --danger-rgb: 248, 113, 113;

    /* Navy-tinted overlays and blue-shimmer glass */
    --overlay-bg: rgba(0, 4, 18, 0.80);
    --overlay-bg-deep: rgba(0, 3, 12, 0.92);
    --glass-border: rgba(100, 160, 255, 0.14);
    --glass-bg-faint: rgba(59, 100, 200, 0.08);

    /* Nav: slightly more visible inactive, restrained active glow */
    --nav-icon-filter: grayscale(1) brightness(0.45);
    --nav-icon-active-filter: none drop-shadow(0 0 5px rgba(59, 130, 246, 0.75));

    --nav-label-transform: none;
    --nav-label-spacing: 0px;
    --heading-weight: 600;
    --heading-spacing: -0.3px;
    --body-line-height: 1.45;
    --logo-spacing: 0.5px;

    --font-heading: 'Raleway', system-ui, sans-serif;
    --font-body: 'Raleway', system-ui, sans-serif;
}

[data-theme="carbon"] {
    --bg-anim-1: #0a0a0a;
    --bg-anim-2: #111111;
    --bg-anim-3: #0d0d0d;
    --bg-anim-4: #080808;
    --bg-surface: #141414;
    --bg-surface-elevated: #1a1a1a;
    --bg-input: #1e1e1e;
    --bg-secondary: #181818;
    --bg-subtle: #1c1c1c;

    --accent-primary: #f59e0b;
    --accent-primary-rgb: 245, 158, 11;
    --accent-primary-dark: #b45309;
    --accent-secondary: #ef4444;
    --accent-secondary-rgb: 239, 68, 68;
    --accent-secondary-dark: #b91c1c;
    --accent-tertiary: #a78bfa;
    --accent-tertiary-rgb: 167, 139, 250;
    --accent-pink: #f43f5e;
    --accent-cyan: #14b8a6;
    --accent-blue: #f59e0b;
    --accent-blue-rgb: 245, 158, 11;

    --brand-gradient: linear-gradient(90deg, #f59e0b, #f97316, #dc2626, #f59e0b);
    --brand-gradient-135: linear-gradient(135deg, #f59e0b, #f97316, #dc2626, #f59e0b);
    --brand-gradient-dim: linear-gradient(135deg, #2a1800, #1a0a00, #2a0800, #1a1000);

    --text-primary: #f5f5f5;
    --text-secondary: #e0e0e0;
    --text-soft: #c0c0c0;
    --text-muted: #a0a0a0;
    --text-faint: #7a7a7a;
    --text-faint2: #666666;
    --text-faint3: #555555;

    --border-subtle: #2a2a2a;
    --border-mid: #333333;
    --border-faint: #222222;

    --success: #22c55e;
    --success-rgb: 34, 197, 94;
    --danger: #ef4444;
    --strava: #fc4c02;

    --cal-lift: #f59e0b;
    --cal-lift-rgb: 245, 158, 11;
    --cal-cardio: #22d3ee;
    --cal-cardio-rgb: 34, 211, 238;
    --cal-both: #a78bfa;
    --cal-both-rgb: 167, 139, 250;

    --wc-back: #f59e0b;
    --wc-chest: #f43f5e;
    --wc-legs: #a78bfa;
    --wc-arms: #14b8a6;
    --wc-cardio: #ef4444;
    --wc-default: #f59e0b;

    --stat-1: #f59e0b;
    --stat-1-rgb: 245, 158, 11;
    --stat-1-text: #fcd34d;
    --stat-2: #ef4444;
    --stat-2-rgb: 239, 68, 68;
    --stat-2-text: #fca5a5;
    --stat-3: #a78bfa;
    --stat-3-rgb: 167, 139, 250;
    --stat-3-text: #c4b5fd;
    --stat-4: #22c55e;
    --stat-4-rgb: 34, 197, 94;
    --stat-4-text: #86efac;

    --text-shadow-strong: 1px 1px 2px #000;
    --text-outline: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    --text-glow-subtle: rgba(255, 255, 255, 0.15);

    --warning: #f97316;
    --danger-rgb: 239, 68, 68;

    --overlay-bg: rgba(0, 0, 0, 0.72);
    --overlay-bg-deep: rgba(0, 0, 0, 0.85);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-bg-faint: rgba(255, 255, 255, 0.06);

    --nav-icon-filter: grayscale(1) brightness(0.45);
    --nav-icon-active-filter: none drop-shadow(0 0 6px rgba(245, 158, 11, 0.9));

    --nav-label-transform: uppercase;
    --nav-label-spacing: 1.5px;
    --heading-weight: 800;
    --heading-spacing: 1px;
    --body-line-height: 1.35;
    --logo-spacing: 3px;

    --font-heading: 'Barlow Condensed', system-ui, sans-serif;
    --font-body: 'Barlow', system-ui, sans-serif;
}

[data-theme="arctic"] {
    --bg-anim-1: #f0f4f8;
    --bg-anim-2: #e8f0fe;
    --bg-anim-3: #f0f8f4;
    --bg-anim-4: #f4f0f8;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-secondary: #f8fafc;
    --bg-subtle: #e2e8f0;

    --accent-primary: #2563eb;
    --accent-primary-rgb: 37, 99, 235;
    --accent-primary-dark: #1d4ed8;
    --accent-secondary: #0891b2;
    --accent-secondary-rgb: 8, 145, 178;
    --accent-secondary-dark: #0e7490;
    --accent-tertiary: #7c3aed;
    --accent-tertiary-rgb: 124, 58, 237;
    --accent-pink: #db2777;
    --accent-cyan: #0891b2;
    --accent-blue: #2563eb;
    --accent-blue-rgb: 37, 99, 235;

    --brand-gradient: linear-gradient(90deg, #2563eb, #0891b2, #7c3aed, #2563eb);
    --brand-gradient-135: linear-gradient(135deg, #2563eb, #0891b2, #7c3aed, #2563eb);
    --brand-gradient-dim: linear-gradient(135deg, #bdd4f8, #b8dce8, #d8c8f8, #bdd4f8);

    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-soft: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --text-faint2: #94a3b8;
    --text-faint3: #cbd5e1;

    --border-subtle: #e2e8f0;
    --border-mid: #cbd5e1;
    --border-faint: #f1f5f9;

    --success: #16a34a;
    --success-rgb: 22, 163, 74;
    --danger: #dc2626;
    --strava: #fc4c02;

    --cal-lift: #2563eb;
    --cal-lift-rgb: 37, 99, 235;
    --cal-cardio: #f59e0b;
    --cal-cardio-rgb: 245, 158, 11;
    --cal-both: #16a34a;
    --cal-both-rgb: 22, 163, 74;

    --wc-back: #2563eb;
    --wc-chest: #db2777;
    --wc-legs: #7c3aed;
    --wc-arms: #0891b2;
    --wc-cardio: #f59e0b;
    --wc-default: #2563eb;

    --stat-1: #2563eb;
    --stat-1-rgb: 37, 99, 235;
    --stat-1-text: #1e40af;
    --stat-2: #0891b2;
    --stat-2-rgb: 8, 145, 178;
    --stat-2-text: #164e63;
    --stat-3: #7c3aed;
    --stat-3-rgb: 124, 58, 237;
    --stat-3-text: #4c1d95;
    --stat-4: #16a34a;
    --stat-4-rgb: 22, 163, 74;
    --stat-4-text: #14532d;

    --text-shadow-strong: none;
    --text-outline: 0 0 0 transparent;
    --text-glow-subtle: rgba(0, 0, 0, 0.10);

    --warning: #d97706;
    --danger-rgb: 220, 38, 38;

    --overlay-bg: rgba(0, 0, 0, 0.55);
    --overlay-bg-deep: rgba(0, 0, 0, 0.65);
    --glass-border: rgba(0, 0, 0, 0.10);
    --glass-bg-faint: rgba(0, 0, 0, 0.04);

    --nav-icon-filter: grayscale(1) brightness(0.75);
    --nav-icon-active-filter: none drop-shadow(0 0 6px rgba(37, 99, 235, 0.9));

    --nav-label-transform: none;
    --nav-label-spacing: 0.1px;
    --heading-weight: 700;
    --heading-spacing: 0.2px;
    --body-line-height: 1.6;
    --logo-spacing: 0.5px;

    --font-heading: 'Poppins', system-ui, sans-serif;
    --font-body: 'Poppins', system-ui, sans-serif;
}

/* ========== BASE STYLES ========== */

body {
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    margin: 0 auto;
    padding: 70px 0 80px;
    background: linear-gradient(-45deg, var(--bg-anim-1), var(--bg-anim-2), var(--bg-anim-3), var(--bg-anim-4));
    background-size: 400% 400%;
    animation: bgFlow 20s ease infinite;
    max-width: 600px;
    color: var(--text-secondary);
    line-height: var(--body-line-height);
}

@keyframes bgFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1, h2, h3, h4 {
    font-family: var(--font-heading, var(--font-body, system-ui, sans-serif));
}

header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 16px;
    text-align: center;
    border-bottom: 2px solid var(--accent-secondary);
    box-shadow: 0 4px 20px rgba(var(--accent-secondary-rgb), 0.2);
    z-index: 100;
    box-sizing: border-box;
    user-select: none;
}

#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--bg-surface);
    border-top: 2px solid var(--accent-secondary);
    box-shadow: 0 -4px 20px rgba(var(--accent-secondary-rgb), 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
    z-index: 100;
    box-sizing: border-box;
}

#bottom-nav button {
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    text-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px !important;
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s ease, text-shadow 0.15s ease !important;
}

#bottom-nav button .nav-icon {
    filter: var(--nav-icon-filter);
    transition: filter 0.15s ease;
}

#bottom-nav button .nav-label {
    color: var(--text-faint3);
    transition: color 0.15s ease;
}

#bottom-nav button:active {
    transform: scale(0.92) !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

#bottom-nav button.nav-active .nav-icon {
    filter: none;
}

#bottom-nav button.nav-active .nav-label {
    color: var(--text-primary);
}

#bottom-nav button[data-section="log"].nav-active .nav-icon {
    filter: var(--nav-icon-active-filter);
}

#bottom-nav button[data-section="log"].nav-active .nav-label {
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.6);
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.nav-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: var(--nav-label-spacing);
    text-transform: var(--nav-label-transform);
    white-space: nowrap;
}

header h1 {
    margin: 0;
    font-size: 28px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: var(--logo-spacing);
}

.neon-gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    text-shadow: none !important;
}

nav {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

nav button {
    padding: 10px 14px;
    font-size: 15px;
    background: linear-gradient(145deg, var(--bg-subtle), var(--bg-surface)) !important;
    color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary-dark) !important;
    border-bottom: 3px solid var(--accent-primary-dark) !important;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(var(--accent-primary-rgb), 0.2) !important;
    text-shadow: var(--text-outline), 0 0 8px rgba(var(--accent-primary-rgb), 0.6) !important;
}
nav button:active {
    transform: scale(0.98) translateY(2px) !important;
    border-bottom: 1px solid var(--accent-primary-dark) !important;
}

.section {
    padding: 16px;
}

h2 {
    margin-top: 0;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-glow-subtle);
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-spacing);
}

button {
    padding: 14px 16px;
    margin: 8px 0;
    background: rgba(var(--accent-tertiary-rgb), 0.15) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(var(--accent-tertiary-rgb), 0.5) !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
    box-shadow: inset 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.3), 0 4px 14px rgba(var(--accent-tertiary-rgb), 0.25) !important;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 0 8px var(--accent-tertiary), var(--text-shadow-strong) !important;
}

button:active {
    transform: scale(0.97);
    box-shadow: inset 0 1px 4px rgba(var(--accent-tertiary-rgb), 0.55), 0 2px 6px rgba(var(--accent-tertiary-rgb), 0.2) !important;
}

.neon-tab-active {
    background: rgba(var(--accent-tertiary-rgb), 0.28) !important;
    border: 1px solid rgba(var(--accent-tertiary-rgb), 0.88) !important;
    box-shadow: inset 0 2px 10px rgba(var(--accent-tertiary-rgb), 0.45), 0 0 16px rgba(var(--accent-tertiary-rgb), 0.4) !important;
    text-shadow: 0 0 10px var(--accent-tertiary), 0 0 20px var(--accent-tertiary), var(--text-shadow-strong) !important;
}

#date-range-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.date-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.date-input-prefix {
    padding: 0 8px 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
}

.date-input-wrap input[type="date"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 10px 10px 0;
    font-size: 15px;
    min-width: 0;
    outline: none;
}

.date-input-wrap:focus-within {
    border-color: var(--accent-primary);
}

.exercise {
    position: relative;
    background: var(--bg-surface) !important;
    border: none !important;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 2px 5px rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
}

.exercise::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: var(--brand-gradient-135);
    z-index: -1;
}

.exercise-collapsed {
    padding: 12px 16px;
}

.exercise-collapsed::before {
    background: var(--brand-gradient-dim);
    opacity: 0.7;
}

.set {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}

input[type="number"], input[type="text"], select, textarea {
    padding: 12px;
    border: 1px solid var(--border-subtle) !important;
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border-radius: 10px;
    font-size: 16px;
    width: 100%;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

input[type="number"]:focus, input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border: 1px solid var(--accent-secondary) !important;
    background: var(--bg-surface) !important;
    box-shadow: 0 0 12px rgba(var(--accent-secondary-rgb), 0.4) !important;
}

textarea {
    width: 100%;
    max-width: 400px;
}

.tab-container {
    display: flex;
    background-color: var(--bg-surface);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}

.report-tab {
    flex: 1;
    border: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    border-radius: 10px;
    padding: 12px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: center;
    background-color: transparent !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.tab-active {
    background: linear-gradient(145deg, var(--accent-secondary), var(--accent-secondary-dark)) !important;
    border: 1px solid var(--accent-secondary-dark) !important;
    border-bottom: 3px solid var(--accent-secondary-dark) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-secondary-rgb), 0.4) !important;
    text-shadow: var(--text-outline) !important;
}
.tab-active:active {
    transform: scale(0.98) translateY(2px);
    border-bottom: 1px solid var(--accent-secondary-dark) !important;
}

.tab-inactive {
    background-color: transparent !important;
    color: var(--text-muted) !important;
}

/* ==================================================
   AUTOMATIC INLINE STYLE OVERRIDES FOR DARK THEMES
   (Not applied in Arctic where light colors are correct)
   ================================================== */
html:not([data-theme="arctic"]) [style*="color: black"],
html:not([data-theme="arctic"]) [style*="color: #333"],
html:not([data-theme="arctic"]) [style*="color:#333"],
html:not([data-theme="arctic"]) [style*="color: #1c1c1e"] {
    color: var(--text-primary) !important;
}
html:not([data-theme="arctic"]) [style*="color: #666"],
html:not([data-theme="arctic"]) [style*="color:#666"],
html:not([data-theme="arctic"]) [style*="color: #555"],
html:not([data-theme="arctic"]) [style*="color: #888"],
html:not([data-theme="arctic"]) [style*="color:#888"],
html:not([data-theme="arctic"]) [style*="color: #444"] {
    color: var(--text-muted) !important;
}
html:not([data-theme="arctic"]) [style*="background: #fff"],
html:not([data-theme="arctic"]) [style*="background:#fff"],
html:not([data-theme="arctic"]) [style*="background: white"],
html:not([data-theme="arctic"]) [style*="background:white"] {
    background-color: var(--bg-surface) !important;
}
html:not([data-theme="arctic"]) [style*="background: #f0f0f5"],
html:not([data-theme="arctic"]) [style*="background:#f0f0f5"],
html:not([data-theme="arctic"]) [style*="background: #f4f4f4"],
html:not([data-theme="arctic"]) [style*="background:#f4f4f4"],
html:not([data-theme="arctic"]) [style*="background: #f9f9f9"],
html:not([data-theme="arctic"]) [style*="background:#fcfcfc"],
html:not([data-theme="arctic"]) [style*="background:#fff5f0"],
html:not([data-theme="arctic"]) [style*="background: #fff3e0"],
html:not([data-theme="arctic"]) [style*="background: #fff9f0"] {
    background-color: var(--bg-input) !important;
    border-color: var(--border-mid) !important;
}
html:not([data-theme="arctic"]) [style*="border: 1px solid #ddd"],
html:not([data-theme="arctic"]) [style*="border:1px solid #eee"],
html:not([data-theme="arctic"]) [style*="border-bottom:1px solid #eee"] {
    border-color: var(--border-mid) !important;
}
::placeholder {
    color: var(--text-faint2) !important;
}

/* ==================================================
   DASHBOARD STAT CARDS
   ================================================== */
#report-summary > div:nth-child(1) {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary)) !important;
    border: 1px solid var(--stat-1) !important;
    box-shadow: 0 4px 15px rgba(var(--stat-1-rgb), 0.2) !important;
    color: var(--stat-1-text) !important;
    text-shadow: var(--text-shadow-strong) !important;
}
#report-summary > div:nth-child(2) {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary)) !important;
    border: 1px solid var(--stat-2) !important;
    box-shadow: 0 4px 15px rgba(var(--stat-2-rgb), 0.2) !important;
    color: var(--stat-2-text) !important;
    text-shadow: var(--text-shadow-strong) !important;
}
#report-summary > div:nth-child(3) {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary)) !important;
    border: 1px solid var(--stat-3) !important;
    box-shadow: 0 4px 15px rgba(var(--stat-3-rgb), 0.2) !important;
    color: var(--stat-3-text) !important;
    text-shadow: var(--text-shadow-strong) !important;
}
#report-summary > div:nth-child(4) {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-secondary)) !important;
    border: 1px solid var(--stat-4) !important;
    box-shadow: 0 4px 15px rgba(var(--stat-4-rgb), 0.2) !important;
    color: var(--stat-4-text) !important;
    text-shadow: var(--text-shadow-strong) !important;
}
#report-summary > div > div {
    color: inherit !important;
    text-shadow: inherit !important;
}

/* =============================================
   WORKOUT CALENDAR
   ============================================= */
#workout-calendar-wrap {
    position: relative;
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#workout-calendar-wrap::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: var(--brand-gradient-135);
    z-index: -1;
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cal-nav-btn {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-mid) !important;
    border-bottom: 2px solid var(--border-faint) !important;
    color: var(--accent-secondary) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    padding: 4px 14px !important;
    border-radius: 8px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
    font-weight: bold;
}

.cal-month-title {
    font-weight: 800;
    font-size: 1.05em;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.cal-day-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.cal-day-label {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-faint3);
    padding: 4px 0;
    letter-spacing: 0.5px;
}

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

.cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--border-mid);
    user-select: none;
}

.cal-day.cal-empty {
    pointer-events: none;
}

.cal-day.cal-has-workout {
    color: var(--text-secondary);
    cursor: pointer;
    background: rgba(var(--accent-primary-rgb), 0.07);
}

.cal-day.cal-has-workout:active {
    transform: scale(0.88);
}

.cal-day.cal-today {
    border: 1px solid var(--accent-secondary);
    color: var(--stat-2-text);
}

.cal-day.cal-selected {
    background: rgba(var(--accent-primary-rgb), 0.18) !important;
    color: var(--accent-primary) !important;
    box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.35);
}

.cal-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cal-lift);
    box-shadow: 0 0 6px rgba(var(--cal-lift-rgb), 0.9);
    margin-top: 2px;
}

.cal-day.cal-cardio {
    background: rgba(var(--cal-cardio-rgb), 0.1);
}

.cal-day.cal-cardio .cal-dot {
    background: var(--cal-cardio);
    box-shadow: 0 0 6px rgba(var(--cal-cardio-rgb), 0.9);
}

.cal-day.cal-mixed {
    background: rgba(var(--cal-both-rgb), 0.12);
}

.cal-day.cal-mixed .cal-dot {
    background: var(--cal-both);
    box-shadow: 0 0 6px rgba(var(--cal-both-rgb), 0.9);
}

.cal-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-bg-faint);
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

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

.cal-legend-dot.lift   { background: var(--cal-lift);   box-shadow: 0 0 5px rgba(var(--cal-lift-rgb), 0.8); }
.cal-legend-dot.cardio { background: var(--cal-cardio); box-shadow: 0 0 5px rgba(var(--cal-cardio-rgb), 0.8); }
.cal-legend-dot.both   { background: var(--cal-both);   box-shadow: 0 0 5px rgba(var(--cal-both-rgb), 0.8); }

/* Day summary panel */
#cal-day-summary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-faint);
}

.cal-summary-date {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--accent-secondary);
    text-shadow: 0 0 8px rgba(var(--accent-secondary-rgb), 0.4);
    margin-bottom: 10px;
}

.cal-summary-workout {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--border-subtle);
}

.cal-summary-name {
    font-weight: 700;
    font-size: 0.95em;
    color: var(--accent-tertiary);
    text-shadow: 0 0 8px rgba(var(--accent-tertiary-rgb), 0.4);
    margin-bottom: 6px;
}

.cal-summary-meta {
    font-size: 0.82em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cal-summary-ex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-faint);
    font-size: 0.83em;
}

.cal-summary-ex:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cal-ex-name {
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
}

.cal-ex-sets {
    color: var(--text-faint);
    text-align: right;
}

/* =============================================
   WORKOUT START MODALS
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-box {
    background: var(--bg-surface-elevated);
    border-radius: 20px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px var(--overlay-bg-deep);
}

.modal-title {
    margin: 0 0 18px;
    text-align: center;
    color: var(--text-primary) !important;
    font-size: 18px;
    font-weight: 700;
    -webkit-text-fill-color: var(--text-primary);
}

/* Floating completed-exercises counter badge */
#completed-counter-btn {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: rgba(var(--accent-tertiary-rgb), 0.25) !important;
    color: var(--text-primary) !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    border: 1px solid rgba(var(--accent-tertiary-rgb), 0.6) !important;
    border-bottom: 1px solid rgba(var(--accent-tertiary-rgb), 0.6) !important;
    box-shadow: inset 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.3), 0 0 22px rgba(var(--accent-tertiary-rgb), 0.55) !important;
    z-index: 500;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 8px var(--accent-tertiary), var(--text-shadow-strong) !important;
    cursor: pointer;
    line-height: 1;
}

#workout-action-bar {
    gap: 10px;
    margin-top: 20px;
}

/* =============================================
   EFFORT RATING MODAL
   ============================================= */
.effort-modal-box {
    max-width: 360px;
}

.effort-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 12px;
    border-radius: 14px;
    background: var(--glass-bg-faint);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    box-shadow: none;
    text-shadow: none;
}

.effort-btn:active {
    background: rgba(var(--accent-tertiary-rgb), 0.18);
}

.effort-btn-selected {
    border-color: var(--accent-tertiary) !important;
    background: rgba(var(--accent-tertiary-rgb), 0.18) !important;
    box-shadow: 0 0 14px rgba(var(--accent-tertiary-rgb), 0.35) !important;
}

.effort-btn-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 3px;
    line-height: 1.2;
}

.effort-btn-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* =============================================
   SHARE CONFIRMATION MODAL
   ============================================= */

#share-confirm-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

#share-confirm-box {
    background: var(--bg-surface-elevated);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px var(--overlay-bg-deep);
    width: 100%;
    max-width: 360px;
    overflow: hidden;
}

#share-confirm-header {
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--glass-bg-faint);
}

#share-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

#share-confirm-body {
    padding: 16px 22px;
}

#share-confirm-body p {
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0;
}

#share-confirm-footer {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--glass-bg-faint);
    display: flex;
    gap: 10px;
}

#share-cancel-btn {
    flex: 1;
    padding: 13px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: var(--glass-bg-faint) !important;
    color: var(--text-soft) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

#share-go-btn {
    flex: 1;
    padding: 13px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-tertiary), var(--accent-pink)) !important;
    color: var(--text-primary) !important;
    border: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

#share-go-btn:active {
    opacity: 0.85;
}

/* =============================================
   TEMPLATE GROUPS (collapsible sections)
   ============================================= */

.templates-group {
    margin-bottom: 20px;
}

.templates-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    user-select: none;
}

.templates-group-header:active {
    background: var(--bg-input);
}

.templates-chevron {
    font-size: 0.8em;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.templates-chevron.collapsed {
    transform: rotate(-90deg);
}

.templates-group-body {
    overflow: hidden;
}

.templates-group-body.collapsed {
    display: none;
}

/* =============================================
   COMMUNITY TEMPLATE CARDS
   ============================================= */

.community-template-card {
    position: relative;
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.community-template-author {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.community-template-name {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.community-template-exercises {
    font-size: 0.9em;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.community-exercise-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-faint);
}

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

.community-exercise-note {
    font-size: 0.8em;
    color: var(--text-faint2);
    font-style: italic;
    margin-top: 2px;
}

/* =============================================
   USER AGREEMENT MODAL
   ============================================= */

#agreement-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

#agreement-box {
    background: var(--bg-surface-elevated);
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px var(--overlay-bg-deep);
    width: 100%;
    max-width: 520px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#agreement-header {
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--glass-bg-faint);
    flex-shrink: 0;
}

#agreement-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

#agreement-version {
    font-size: 12px;
    color: var(--text-muted);
}

#agreement-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    -webkit-overflow-scrolling: touch;
}

#agreement-body h3 {
    color: var(--accent-tertiary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 20px 0 6px;
}

#agreement-body h3:first-child {
    margin-top: 0;
}

#agreement-body p {
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 0 0 10px;
}

#agreement-body strong {
    color: var(--text-secondary);
}

#agreement-footer {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--glass-bg-faint);
    flex-shrink: 0;
}

#agreement-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

#agreement-check-label input[type="checkbox"] {
    margin-top: 2px;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    accent-color: var(--accent-tertiary);
    cursor: pointer;
}

#agreement-btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: var(--brand-gradient-135);
    color: var(--text-primary);
    transition: opacity 0.15s;
}

#agreement-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#agreement-btn:not(:disabled):active {
    opacity: 0.8;
}

/* =============================================
   THEME PICKER
   ============================================= */

.theme-picker {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.theme-swatch {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.theme-swatch:active {
    transform: scale(0.94) !important;
}

.theme-swatch-preview {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.theme-swatch-name {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 7px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.theme-swatch-active .theme-swatch-name {
    color: var(--text-primary);
}

/* =============================================
   MIDNIGHT THEME — STRUCTURAL OVERRIDES
   Calm, premium, refined — less is more
   ============================================= */

/* Header / nav: thin 1px borders, whisper-quiet shadows */
[data-theme="midnight"] header {
    border-bottom: 1px solid rgba(var(--accent-secondary-rgb), 0.50);
    box-shadow: 0 1px 14px rgba(var(--accent-secondary-rgb), 0.07);
}
[data-theme="midnight"] #bottom-nav {
    border-top: 1px solid rgba(var(--accent-secondary-rgb), 0.40);
    box-shadow: 0 -1px 14px rgba(var(--accent-secondary-rgb), 0.05);
}

/* Exercise / calendar cards: thin 1px gradient border — refined, not bold */
[data-theme="midnight"] .exercise::before,
[data-theme="midnight"] .exercise-collapsed::before {
    inset: -1px;
    border-radius: 17px;
}
[data-theme="midnight"] #workout-calendar-wrap::before {
    inset: -1px;
    border-radius: 17px;
}

/* Buttons: half the glow of Synthwave — restrained */
[data-theme="midnight"] button {
    box-shadow: inset 0 1px 6px rgba(var(--accent-tertiary-rgb), 0.18),
                0 2px 10px rgba(var(--accent-tertiary-rgb), 0.12) !important;
}
[data-theme="midnight"] button:active {
    box-shadow: inset 0 1px 4px rgba(var(--accent-tertiary-rgb), 0.28),
                0 1px 4px rgba(var(--accent-tertiary-rgb), 0.10) !important;
}

/* Active section tabs: inward glow only, no outer bloom */
[data-theme="midnight"] .neon-tab-active {
    box-shadow: inset 0 1px 8px rgba(var(--accent-tertiary-rgb), 0.28),
                0 0 8px rgba(var(--accent-tertiary-rgb), 0.14) !important;
    text-shadow: 0 0 8px var(--accent-tertiary) !important;
}

/* Stat cards: dark shadow only, no colored bloom */
[data-theme="midnight"] #report-summary > div:nth-child(1),
[data-theme="midnight"] #report-summary > div:nth-child(2),
[data-theme="midnight"] #report-summary > div:nth-child(3),
[data-theme="midnight"] #report-summary > div:nth-child(4) {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.55) !important;
}

/* Counter FAB: quieter glow */
[data-theme="midnight"] #completed-counter-btn {
    box-shadow: inset 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.20),
                0 0 14px rgba(var(--accent-tertiary-rgb), 0.28) !important;
}

/* ALL 5 active nav tabs: consistent steel-blue accent label */
[data-theme="midnight"] #bottom-nav button.nav-active .nav-label {
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.45);
}

/* Input focus: tight ring shadow instead of spread glow */
[data-theme="midnight"] input[type="number"]:focus,
[data-theme="midnight"] input[type="text"]:focus,
[data-theme="midnight"] select:focus,
[data-theme="midnight"] textarea:focus {
    box-shadow: 0 0 0 2px rgba(var(--accent-secondary-rgb), 0.35),
                0 0 8px rgba(var(--accent-secondary-rgb), 0.12) !important;
}

/* =============================================
   ARCTIC THEME — LIGHT MODE CORRECTIONS
   Clean, open, friendly, breathable
   ============================================= */

/* Header / nav: clean 1px border, no glow — fresh and light */
[data-theme="arctic"] header {
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}
[data-theme="arctic"] #bottom-nav {
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.04);
}

/* Cards: rounder corners (friendly, open) + soft elevation shadow */
[data-theme="arctic"] .exercise {
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="arctic"] .exercise::before,
[data-theme="arctic"] .exercise-collapsed::before {
    inset: -1px;
    border-radius: 21px;
    opacity: 0.40;
}
[data-theme="arctic"] #workout-calendar-wrap {
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="arctic"] #workout-calendar-wrap::before {
    inset: -1px;
    border-radius: 21px;
    opacity: 0.30;
}

/* Remove neon glows from calendar dots and legend */
[data-theme="arctic"] .cal-dot { box-shadow: none; }
[data-theme="arctic"] .cal-legend-dot { box-shadow: none; }

/* Remove neon text glows */
[data-theme="arctic"] h2 { text-shadow: none; }
[data-theme="arctic"] .cal-summary-date { text-shadow: none; }
[data-theme="arctic"] .cal-summary-name { text-shadow: none; }

/* Buttons: rounder, clean drop shadows — zero neon */
[data-theme="arctic"] button {
    border-radius: 16px !important;
    text-shadow: none !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="arctic"] button:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Nav action buttons: clean */
[data-theme="arctic"] nav button {
    text-shadow: none !important;
    box-shadow: 0 1px 5px rgba(var(--accent-primary-rgb), 0.10) !important;
}

/* Active section tabs: flat, no glow */
[data-theme="arctic"] .neon-tab-active {
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.16) !important;
}

/* Report tabs */
[data-theme="arctic"] .tab-active { text-shadow: none !important; }

/* Active nav label: accent blue, no glow */
[data-theme="arctic"] #bottom-nav button.nav-active .nav-label {
    color: var(--accent-primary);
}
[data-theme="arctic"] #bottom-nav button[data-section="log"].nav-active .nav-label {
    text-shadow: none;
}

/* Stat cards: clean shadow, no colored bloom, no text-shadow */
[data-theme="arctic"] #report-summary > div:nth-child(1),
[data-theme="arctic"] #report-summary > div:nth-child(2),
[data-theme="arctic"] #report-summary > div:nth-child(3),
[data-theme="arctic"] #report-summary > div:nth-child(4) {
    border-radius: 16px !important;
    text-shadow: none !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07) !important;
}

/* Counter FAB: soft shadow, no neon */
[data-theme="arctic"] #completed-counter-btn {
    box-shadow: 0 4px 14px rgba(var(--accent-tertiary-rgb), 0.14) !important;
}

/* Input focus: clean focus ring — no spread glow */
[data-theme="arctic"] input[type="number"]:focus,
[data-theme="arctic"] input[type="text"]:focus,
[data-theme="arctic"] select:focus,
[data-theme="arctic"] textarea:focus {
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.14) !important;
}

/* =============================================
   CARBON THEME — STRUCTURAL OVERRIDES
   Heavy, industrial, powerful — maximum presence
   ============================================= */

/* Header: thick amber border, strong shadow */
[data-theme="carbon"] header {
    border-bottom: 3px solid var(--accent-primary);
    box-shadow: 0 4px 24px rgba(var(--accent-primary-rgb), 0.22);
}

/* Nav: thick amber border, strong underlight */
[data-theme="carbon"] #bottom-nav {
    border-top: 3px solid var(--accent-primary);
    box-shadow: 0 -4px 24px rgba(var(--accent-primary-rgb), 0.25);
}

/* Nav: ALL 5 active tabs get amber icon glow + amber label */
[data-theme="carbon"] #bottom-nav button.nav-active .nav-icon {
    filter: var(--nav-icon-active-filter);
}
[data-theme="carbon"] #bottom-nav button.nav-active .nav-label {
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.6);
}

/* Exercise cards: tight corners + thick 3px gradient border */
[data-theme="carbon"] .exercise {
    border-radius: 10px;
}
[data-theme="carbon"] .exercise::before {
    inset: -3px;
    border-radius: 13px;
    background: linear-gradient(135deg, #f59e0b, #f97316, #dc2626);
}
[data-theme="carbon"] .exercise-collapsed::before {
    inset: -3px;
    border-radius: 13px;
    background: linear-gradient(135deg, #3a2000, #2a0e00, #200500);
    opacity: 0.85;
}

/* Calendar card: same treatment */
[data-theme="carbon"] #workout-calendar-wrap {
    border-radius: 10px;
}
[data-theme="carbon"] #workout-calendar-wrap::before {
    inset: -3px;
    border-radius: 13px;
    background: linear-gradient(135deg, #f59e0b, #f97316, #dc2626);
}

/* Buttons: tighter corners, heavier presence */
[data-theme="carbon"] button {
    border-radius: 10px !important;
    font-weight: 700 !important;
    box-shadow: inset 0 2px 10px rgba(var(--accent-tertiary-rgb), 0.38),
                0 5px 18px rgba(var(--accent-tertiary-rgb), 0.28) !important;
}

/* Inputs: 2px border + tighter corners — heavier outline */
[data-theme="carbon"] input[type="number"],
[data-theme="carbon"] input[type="text"],
[data-theme="carbon"] select,
[data-theme="carbon"] textarea {
    border-width: 2px !important;
    border-radius: 8px;
}

/* Stat cards: 2px border + heavy dark shadow */
[data-theme="carbon"] #report-summary > div:nth-child(1),
[data-theme="carbon"] #report-summary > div:nth-child(2),
[data-theme="carbon"] #report-summary > div:nth-child(3),
[data-theme="carbon"] #report-summary > div:nth-child(4) {
    border-width: 2px !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65) !important;
}

/* Counter FAB: stronger glow — maximum presence */
[data-theme="carbon"] #completed-counter-btn {
    box-shadow: inset 0 2px 8px rgba(var(--accent-tertiary-rgb), 0.35),
                0 0 28px rgba(var(--accent-tertiary-rgb), 0.60) !important;
}

/* ========== ADVANCED REPORTS ========== */

.adv-report-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.adv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-primary);
    cursor: pointer;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    user-select: none;
}

.adv-card-header:active { opacity: 0.7; }

.adv-chevron {
    font-size: 0.8em;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.adv-chevron.collapsed { transform: rotate(-90deg); }

#adv-settings-body,
#adv-range-body {
    padding: 16px;
}

.adv-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.adv-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.adv-setting-hint {
    font-size: 0.78em;
    color: var(--text-muted);
    font-weight: 400;
}

/* Toggle switch */
.adv-toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

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

.adv-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border-radius: 26px;
    border: 1px solid var(--border-mid);
    transition: background 0.2s;
    cursor: pointer;
}

.adv-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.adv-toggle-switch input:checked + .adv-toggle-slider {
    background: var(--accent-primary-dark);
    border-color: var(--accent-primary);
}

.adv-toggle-switch input:checked + .adv-toggle-slider::before {
    transform: translateX(20px);
    background: var(--accent-primary);
}

/* Cycle slot inputs */
.adv-cycle-slot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adv-cycle-slot-num {
    width: 20px;
    font-size: 0.8em;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.adv-cycle-slot input {
    flex: 1;
    margin-bottom: 0 !important;
}

/* Small action buttons */
.adv-sm-btn {
    width: auto !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}

.adv-sm-btn-danger {
    background: transparent !important;
    border-color: var(--border-mid) !important;
    color: var(--text-muted) !important;
}
