/* ==========================================================================
   BnB HEALTH OS - MASTER STYLESHEET (Basitism Design System)
   Version: 3.0.0 | Architecture: Vanilla CSS | Theme: Clinical Wellness
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES (THEMING & TOKENS)
   -------------------------------------------------------------------------- */
   :root {
    /* -- Semantic Health Colors -- */
    --accent-meds: #10b981;       /* Emerald Green (Vitality/Success) */
    --accent-move: #f59e0b;       /* Amber/Gold (Energy/Action) */
    --accent-mind: #8b5cf6;       /* Amethyst (Calm/Focus) */
    --accent-water: #06b6d4;      /* Cyan (Hydration) */
    --accent-clinical: #3b82f6;   /* Clinical Blue (Medical/Primary) */
    --accent-intimacy: #f43f5e;   /* Rose (Connection/Love) */
    --danger: #ef4444;            /* Soft Crimson (Alerts/Missed) */
    
    /* -- Animation & Easing -- */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-zen: 4s ease-in-out;

    /* -- Spacing System -- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* -- Border Radius -- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* -- Z-Index Layers -- */
    --z-base: 1;
    --z-glider: 5;
    --z-above: 10;
    --z-overlay: 100;
    --z-modal: 150;
    --z-toast: 200;
}

/* --- Dark Theme (Obsidian Wellness) --- */
body.theme-dark {
    --bg-main: #09090b;
    --bg-surface: rgba(24, 24, 27, 0.7);
    --bg-surface-hover: rgba(39, 39, 42, 0.85);
    --bg-surface-active: rgba(63, 63, 70, 0.9);
    
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.12);
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.03);
    
    --heatmap-empty: #18181b;
}

/* --- Light Theme (Clean Clinic) --- */
body.theme-light {
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(255, 255, 255, 0.95);
    --bg-surface-active: rgba(241, 245, 249, 1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-highlight: rgba(0, 0, 0, 0.15);
    
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --shadow-glow: 0 4px 20px rgba(0, 0, 0, 0.02);
    
    --heatmap-empty: #e2e8f0;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100vw;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    min-height: 100vh;
}

::selection {
    background-color: var(--accent-clinical);
    color: #fff;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --------------------------------------------------------------------------
   3. UTILITY & GLASSMORPHISM
   -------------------------------------------------------------------------- */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    position: relative;
    transform: translateZ(0); /* Hardware acceleration for blur performance */
}

/* Edge Highlight */
.glass-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
    z-index: 1;
    pointer-events: none;
}

.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }

/* View State Management */
.view-state {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    width: 100%;
}
.view-state.active {
    display: block;
    opacity: 1;
    animation: fadeInView 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeInView {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   4. ICONS & BUTTONS (LUCIDE FIX)
   -------------------------------------------------------------------------- */
/* Target the SVG class directly, as Lucide strips the <i> tag */
.lucide {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: all var(--transition-fast);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
    background: transparent;
}
button:active { transform: scale(0.96); }
button:focus-visible { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-main);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-icon {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-above);
}
.btn-icon:hover {
    background: var(--bg-surface-active);
    color: var(--accent-clinical);
    border-color: var(--accent-clinical);
}

.btn-text {
    color: var(--accent-clinical);
    font-weight: 600;
    font-size: 0.95rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
}
.btn-text:hover { background: rgba(59, 130, 246, 0.1); }

/* --------------------------------------------------------------------------
   5. LOADERS & AUTHENTICATION
   -------------------------------------------------------------------------- */
#sso-loader {
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, var(--bg-surface) 0%, var(--bg-main) 100%);
}
.loader-content h2 { font-size: 1.5rem; margin-bottom: var(--space-2); }
.loader-content p { color: var(--text-secondary); }
#sso-loader.active {
    display: flex; /* Only flex when active */
}

.pulse-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-clinical);
    animation: heartbeat 1.5s infinite ease-in-out;
    margin-bottom: var(--space-4);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}
@keyframes heartbeat {
    0%, 30%, 100% { transform: scale(1); }
    15%, 45% { transform: scale(1.15); }
}

/* Manual Login Screen */
#login-view {
    height: 100vh;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(244, 63, 94, 0.05), transparent);
}

#login-view.active {
    display: flex; /* Only flex when active */
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--space-8) var(--space-6);
    text-align: center;
}
.login-header { margin-bottom: var(--space-8); }
.login-header h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: var(--space-2); }
.login-header p { font-size: 0.95rem; color: var(--text-secondary); }

.avatar-selector {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.avatar-selector input { display: none; }
.avatar-card {
    flex: 1;
    background: var(--bg-surface-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}
.avatar-icon { font-size: 2.5rem; }
.avatar-name { font-weight: 600; color: var(--text-secondary); }

#login-basit:checked ~ label[for="login-basit"],
#login-bano:checked ~ label[for="login-bano"] {
    border-color: var(--accent-clinical);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}
#login-basit:checked ~ label[for="login-basit"] .avatar-name,
#login-bano:checked ~ label[for="login-bano"] .avatar-name {
    color: var(--accent-clinical);
}

.pin-group input {
    width: 100%;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.8rem;
    font-weight: 800;
    color: var(--text-primary);
}
.pin-group input:focus {
    border-color: var(--accent-clinical);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* --------------------------------------------------------------------------
   6. VITALITY HEADER (FLUSH TOP DESIGN)
   -------------------------------------------------------------------------- */
.vitality-center {
    width: 100%;
    margin: 0; 
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    padding: calc(env(safe-area-inset-top) + 24px) var(--space-5) var(--space-8) var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, var(--bg-surface-hover), var(--bg-surface));
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}

.header-top-row {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}
.greeting-box h2 { font-size: 1rem; color: var(--text-secondary); font-weight: 500;}
.greeting-box p { font-size: 1.4rem; color: var(--text-primary); font-weight: 800; letter-spacing: -0.5px;}
.header-actions { display: flex; gap: var(--space-2); }

/* Profile Switcher */
.profile-switcher {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-pill);
    padding: 6px;
    width: 100%;
    max-width: 280px; /* Fluid max-width instead of fixed */
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}
.theme-light .profile-switcher { background: rgba(0, 0, 0, 0.05); }

.profile-switcher input { display: none; }
.profile-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-weight: 700;
    font-size: 0.95rem;
    z-index: var(--z-above);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.switcher-glider {
    position: absolute;
    top: 6px; left: 6px;
    width: calc(50% - 6px); height: calc(100% - 12px);
    background: var(--bg-surface-hover);
    border-radius: var(--radius-pill);
    z-index: var(--z-glider);
    transition: transform var(--transition-bounce);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid var(--border-highlight);
}
.theme-light .switcher-glider { background: #fff; }

#profile-basit:checked ~ .profile-tab[for="profile-basit"],
#profile-bano:checked ~ .profile-tab[for="profile-bano"] { color: var(--text-primary); }
#profile-bano:checked ~ .switcher-glider { transform: translateX(100%); }

.hero-quote {
    font-style: italic;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: var(--space-8);
    max-width: 400px;
}

/* SVG Trio Rings (Fluid Scaling) */
.trio-rings-container {
    position: relative;
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1;
    margin-bottom: var(--space-8);
}
.trio-svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.2));
}
.ring-track { fill: none; stroke: var(--border-color); stroke-width: 14; }
.ring-progress {
    fill: none; stroke-width: 14; stroke-linecap: round;
    transition: stroke-dashoffset 1.5s var(--transition-bounce);
}
.ring-meds { stroke: var(--accent-meds); stroke-dasharray: 502; stroke-dashoffset: 502; }
.ring-move { stroke: var(--accent-move); stroke-dasharray: 377; stroke-dashoffset: 377; }
.ring-mind { stroke: var(--accent-mind); stroke-dasharray: 251; stroke-dashoffset: 251; }

.ring-labels {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    margin-top: -15px;
}
.ring-labels .label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 600;
}
.ring-labels .dot {
    width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}
.dot-meds { background: var(--accent-meds); color: var(--accent-meds); }
.dot-move { background: var(--accent-move); color: var(--accent-move); }
.dot-mind { background: var(--accent-mind); color: var(--accent-mind); }

/* Hydration Wave */
.hydration-module { 
    width: 100%; 
    max-width: 380px;
    background: var(--bg-surface-active);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-highlight);
}
.hydration-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-3);
}
.hydration-header h3 { font-size: 1rem; }
.hydration-header span { font-size: 0.95rem; font-weight: 700; color: var(--accent-water); }

.hydration-wave {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.droplet {
    flex: 1;
    max-width: 36px;
    aspect-ratio: 1;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.droplet .lucide { transition: all var(--transition-bounce); }
.droplet:hover .lucide { color: var(--text-primary); }

/* LUCIDE SVG INJECTION FIX */
.droplet.filled .lucide {
    color: var(--accent-water);
    fill: var(--accent-water);
    stroke: var(--accent-water);
    filter: drop-shadow(0 0 6px var(--accent-water));
    transform: scale(1.2);
}

/* --------------------------------------------------------------------------
   7. MODULE SYSTEM ARCHITECTURE
   -------------------------------------------------------------------------- */
.modules-container { 
    padding: 0 var(--space-4); 
    padding-bottom: 120px; /* Space for scrolling past bottom */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}
.os-module {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
}
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
}
.module-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex; align-items: center; gap: var(--space-2);
}
.module-header h2 .lucide { color: var(--accent-clinical); }

/* --------------------------------------------------------------------------
   8. THE APOTHECARY (MEDICAL TIMELINE)
   -------------------------------------------------------------------------- */
.timeline-container { display: flex; flex-direction: column; gap: var(--space-5); }
.timeline-slot {
    border-left: 2px solid var(--border-highlight);
    padding-left: var(--space-5);
    position: relative;
}
.timeline-slot::before {
    content: ''; position: absolute; left: -7px; top: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg-main); border: 3px solid var(--accent-clinical);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.slot-title {
    font-size: 1.05rem; font-weight: 700;
    display: flex; align-items: center; gap: var(--space-2);
    margin-bottom: var(--space-3); margin-top: -6px;
}
.slot-title .lucide { color: var(--accent-meds); width: 18px; height: 18px;}
.slot-title span { font-size: 0.8rem; color: var(--text-muted); font-weight: normal; margin-left: auto;}

.pill-card {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-3);
    transition: all 0.3s ease;
}
.pill-card.status-missed { border-color: var(--danger); background: rgba(239, 68, 68, 0.05); }
.pill-card.status-taken { opacity: 0.5; filter: grayscale(100%); }

.pill-info h4 { font-size: 1.05rem; margin-bottom: 2px; }
.pill-info .pill-freq { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: var(--space-2); }

.streak-dots { display: flex; gap: 6px; }
.s-dot { 
    width: 8px; height: 8px; border-radius: 50%; 
    background: var(--border-color); 
}
.s-dot.success { background: var(--accent-meds); box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.s-dot.missed { background: var(--danger); }

.btn-log-pill {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--bg-main); border: 2px solid var(--border-color);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
}
.status-taken .btn-log-pill { background: var(--accent-meds); border-color: var(--accent-meds); color: #fff; }

/* --------------------------------------------------------------------------
   9. WEIGHT & BMI LAB
   -------------------------------------------------------------------------- */
.bmi-dashboard {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: var(--space-6);
}
.weight-primary .current-weight {
    font-size: 3rem; font-weight: 800; line-height: 1;
    display: block; margin-bottom: var(--space-2); letter-spacing: -1px;
}
.weight-deltas { display: flex; align-items: center; gap: var(--space-3); font-size: 0.9rem; font-weight: 600;}
.delta-badge {
    padding: 6px 10px; border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.15); color: var(--accent-meds);
}
.delta-badge.trend-up { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.goal-text { color: var(--text-secondary); }

/* SVG Gauge */
.bmi-gauge-wrapper { width: 110px; text-align: center; position: relative; }
.bmi-gauge { width: 100%; height: auto; overflow: visible;}
.gauge-bg { stroke: var(--border-color); stroke-width: 8; stroke-linecap: round; }
.gauge-value {
    stroke: var(--accent-clinical); stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 125; stroke-dashoffset: 125;
    transition: stroke-dashoffset 1.5s var(--transition-bounce);
    filter: drop-shadow(0 0 4px currentColor);
}
.bmi-readout {
    position: absolute; bottom: -10px; width: 100%;
    display: flex; flex-direction: column;
}
#display-bmi-val { font-weight: 800; font-size: 1.2rem; line-height: 1;}
#display-bmi-cat { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;}

/* Linear Progress Bar */
.goal-progress-container { margin-bottom: var(--space-6); }
.progress-bar-bg {
    height: 10px; background: var(--bg-surface-hover);
    border-radius: var(--radius-pill); overflow: hidden;
    margin-bottom: var(--space-2); border: 1px solid var(--border-color);
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent-clinical), var(--accent-mind));
    border-radius: var(--radius-pill); transition: width 1.5s var(--transition-smooth);
}
.progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }

/* Trend Chart */
.trend-chart-container {
    height: 140px; background: var(--bg-surface-hover);
    border-radius: var(--radius-md); padding: var(--space-4);
    position: relative; border: 1px solid var(--border-color);
}
.chart-title { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: var(--space-2); text-transform: uppercase;}
.trend-svg { width: 100%; height: 80px; overflow: visible; }
.trend-line { fill: none; stroke: var(--accent-clinical); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;}
.trend-area { fill: rgba(59, 130, 246, 0.15); }

/* --------------------------------------------------------------------------
   10. MIND & MOVEMENT (ZEN & GYM)
   -------------------------------------------------------------------------- */
.split-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); padding: 0; background: transparent; border: none; box-shadow: none; }
.zen-suite, .gym-suite { padding: var(--space-5); }

.pacer-container { height: 180px; display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-6); }
.breathing-circle {
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(139, 92, 246, 0.05); border: 3px solid var(--accent-mind);
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition-zen);
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.2), 0 0 20px rgba(139, 92, 246, 0.2);
}
.breathing-circle.active { animation: breatheAnim 8s infinite ease-in-out; }
@keyframes breatheAnim {
    0%, 100% { transform: scale(1); border-color: var(--accent-mind); }
    50% { transform: scale(1.6); background: rgba(139, 92, 246, 0.3); border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);}
}
.timer-display { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums;}
.zen-instruction { text-align: center; color: var(--text-secondary); margin-bottom: var(--space-4); min-height: 24px; font-size: 1.1rem;}

.btn-checkin-massive {
    width: 100%; padding: var(--space-6);
    background: rgba(245, 158, 11, 0.05); border: 2px dashed var(--accent-move);
    color: var(--accent-move); border-radius: var(--radius-lg);
    font-size: 1.2rem; font-weight: 700; margin-bottom: var(--space-6);
    display: flex; align-items: center; justify-content: center; gap: var(--space-2);
}
.btn-checkin-massive.checked-in { background: var(--accent-move); color: #fff; border-style: solid; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3); }

/* --- Monthly Streak Calendar --- */
.github-calendar-wrapper { 
    padding-top: var(--space-4); 
    border-top: 1px solid var(--border-color); 
}
.calendar-title { 
    font-size: 0.9rem; 
    font-weight: 700; 
    color: var(--text-primary); 
    margin-bottom: var(--space-3); 
    text-transform: uppercase; 
    letter-spacing: 1px;
}
.github-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 6px; 
    text-align: center;
}
.cal-header-day {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cal-day { 
    aspect-ratio: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--heatmap-empty); 
    color: var(--text-secondary);
    border-radius: var(--radius-sm); 
    transition: all var(--transition-smooth); 
}
.cal-day.empty { background: transparent; }
.cal-day.future { opacity: 0.15; color: var(--text-muted); }

/* The Rest Day (Sunday) */
.cal-day.rest-day {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px dashed var(--border-highlight);
}
.theme-light .cal-day.rest-day { background: rgba(0, 0, 0, 0.02); }

/* The Streak Intensity Levels (Amber/Gold) */
.cal-day.level-1 { background: rgba(245, 158, 11, 0.3); color: #fff; }
.cal-day.level-2 { background: rgba(245, 158, 11, 0.55); color: #fff; }
.cal-day.level-3 { background: rgba(245, 158, 11, 0.8); color: #fff; }
.cal-day.level-4 { 
    background: rgba(245, 158, 11, 1); 
    color: #fff; 
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6); 
    transform: scale(1.05);
}

/* Current Day Highlight */
.cal-day.today {
    border: 2px solid var(--text-primary);
}


/* --------------------------------------------------------------------------
   11. THE LOUNGE & CLINICAL VAULT
   -------------------------------------------------------------------------- */
/* --- 11. COUPLES SYNC & INTIMACY --- */
.blur-protected { position: relative; overflow: hidden; }
.protected-content { filter: blur(12px); opacity: 0.4; pointer-events: none; transition: all 0.5s ease; user-select: none; }
.blur-protected.unlocked .protected-content { filter: blur(0); opacity: 1; pointer-events: auto; user-select: auto; }

.sync-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.sync-card {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.sync-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-2);
}

.sync-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.energy-selector {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.energy-btn {
    flex: 1;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.energy-btn[data-level="low"].active { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); color: var(--danger); }
.energy-btn[data-level="med"].active { background: rgba(245, 158, 11, 0.2); border-color: var(--accent-move); color: var(--accent-move); }
.energy-btn[data-level="high"].active { background: rgba(16, 185, 129, 0.2); border-color: var(--accent-meds); color: var(--accent-meds); }

.mood-select {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.partner-status-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), transparent);
    border-color: rgba(59, 130, 246, 0.2);
}

.partner-readout {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.readout-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.readout-item .lucide { color: var(--accent-clinical); }

.intimacy-action-row {
    margin-bottom: var(--space-6);
}

.btn-intimacy {
    width: 100%;
    padding: 16px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all var(--transition-bounce);
}
.btn-intimacy:hover {
    background: rgba(244, 63, 94, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}

/* (Leave your existing .love-note-board and .sticky-note CSS exactly as they are here) */

.love-note-board { perspective: 1000px; }
.sticky-note {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(244, 63, 94, 0.02));
    border: 1px solid rgba(244, 63, 94, 0.2); border-radius: var(--radius-lg);
    padding: var(--space-5); transform: rotate(-1deg); box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
}
.note-author { font-size: 0.9rem; font-weight: 700; color: var(--accent-intimacy); }
.note-input {
    width: 100%; background: transparent; border: none; color: var(--text-primary);
    font-family: inherit; font-size: 1.1rem; line-height: 1.4; resize: none; height: 80px; outline: none;
}
.note-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(244, 63, 94, 0.1); padding-top: var(--space-2); }
.char-count { font-size: 0.8rem; color: var(--text-muted); }

@media (min-width: 768px) {
    .sync-grid { grid-template-columns: 1fr 1fr; }
}

/* Clinical Vault */
#clinical-timeline { border-left: 2px solid var(--border-color); margin-left: var(--space-2); padding-left: var(--space-5); }
.clinical-card {
    background: var(--bg-surface-hover); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); position: relative;
}
.clinical-card::before {
    content: ''; position: absolute; left: -27px; top: 16px;
    width: 12px; height: 12px; border-radius: 50%; background: var(--accent-clinical); box-shadow: 0 0 0 4px var(--bg-main);
}
.clin-date { font-size: 0.8rem; color: var(--accent-clinical); font-weight: 700; margin-bottom: 4px; display: block;}
.clin-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px;}
.clin-doc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: var(--space-3); display: flex; align-items: center; gap: 4px;}
.btn-drive-link {
    display: inline-flex; align-items: center; gap: var(--space-2);
    background: rgba(59, 130, 246, 0.1); color: var(--accent-clinical);
    padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; text-decoration: none;
}

/* --------------------------------------------------------------------------
   12. MODALS, FORMS & TOASTS
   -------------------------------------------------------------------------- */
.overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: var(--z-overlay); opacity: 1; transition: opacity var(--transition-smooth);
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.bottom-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-main);
    border-top-left-radius: var(--radius-xl); border-top-right-radius: var(--radius-xl);
    padding: var(--space-6); z-index: var(--z-modal);
    transform: translateY(0); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5); border-top: 1px solid var(--border-highlight);
    max-height: 90vh; overflow-y: auto; width: 100%;
}
.bottom-sheet.hidden { transform: translateY(100%); }

.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-color); }
.sheet-header h3 { font-size: 1.2rem; font-weight: 700;}
.btn-close-modal { background: var(--bg-surface-hover); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color);}

.standard-form .form-group { margin-bottom: var(--space-4); }
.standard-form label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.standard-form input, .standard-form select {
    width: 100%; padding: 16px; border-radius: var(--radius-md);
    background: var(--bg-surface-hover); border: 1px solid var(--border-color);
    color: var(--text-primary); 
    font-size: 16px; /* Prevents iOS Auto-Zoom */
    outline: none; transition: all var(--transition-fast);
}
.standard-form input:focus, .standard-form select:focus { border-color: var(--accent-clinical); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Numpad */
.numpad-display {
    text-align: center; font-size: 3.5rem; font-weight: 800; margin-bottom: var(--space-6);
    background: var(--bg-surface-hover); border-radius: var(--radius-lg); padding: var(--space-4) 0; border: 1px solid var(--border-color);
}
.numpad-display .unit { font-size: 1.5rem; color: var(--text-muted); margin-left: var(--space-2); }
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-5); }
.num-key {
    background: var(--bg-surface-hover); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 20px 0; font-size: 1.8rem; font-weight: 600;
}
.num-key.key-action { color: var(--danger); background: rgba(239, 68, 68, 0.05);}

/* Toasts */
.toast-wrapper { position: fixed; top: var(--space-4); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-2); width: 90%; max-width: 400px; pointer-events: none; }
.toast {
    background: var(--bg-surface-active); backdrop-filter: blur(10px); border: 1px solid var(--border-highlight);
    padding: 16px 20px; border-radius: var(--radius-md); font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    animation: toastSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, toastFadeOut 0.4s 2.6s ease forwards;
}
@keyframes toastSlideIn { from { opacity: 0; transform: translateY(-30px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastFadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* --------------------------------------------------------------------------
   13. DESKTOP & TABLET MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .modules-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
        align-items: start;
    }
    #module-apothecary, #module-weight { margin-bottom: 0; }
    .split-grid { grid-template-columns: repeat(2, 1fr); grid-column: 1 / -1; }

    .bottom-sheet {
        max-width: 450px; left: 50%; transform: translate(-50%, 0);
        border-radius: var(--radius-xl); bottom: var(--space-6);
    }
    .bottom-sheet.hidden { transform: translate(-50%, 120%); }
    
    .vitality-center {
        max-width: 1000px; margin: var(--space-6) auto;
        border-radius: var(--radius-xl); flex-direction: row; flex-wrap: wrap; justify-content: space-around;
        padding: var(--space-8);
    }
    
    .hero-quote { order: 3; width: 100%; margin-top: var(--space-6); margin-bottom: 0; }
}