/* ============================================
   P'WEE - Soft Neumorphic Theme
   Copyright (c) 2024-2026 Gridnorth®. All rights reserved.
   Unauthorised copying, modification, or distribution is strictly prohibited.
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }


/* Splash Screen */
#splash-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg, #E8EBF3); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10000; transition: opacity 0.4s ease; }
#splash-screen.fade-out { opacity: 0; pointer-events: none; }
.splash-logo { width: 200px; max-width: 60vw; }
.splash-logo-dark { display: none; }
body.night-mode .splash-logo-light { display: none; }
body.night-mode .splash-logo-dark { display: block; }
.splash-spinner { width: 28px; height: 28px; margin-top: 24px; border: 3px solid rgba(0,0,0,0.08); border-top-color: var(--accent, #F5B041); border-radius: 50%; animation: splash-spin 0.8s linear infinite; }
body.night-mode .splash-spinner { border-color: rgba(255,255,255,0.1); border-top-color: var(--accent, #F5B041); }
@keyframes splash-spin { to { transform: rotate(360deg); } }
.splash-version { margin-top: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; color: var(--fg-light, #718096); letter-spacing: 0.5px; }
.splash-copyright { margin-top: 6px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 10px; color: var(--fg-light, #718096); opacity: 0.7; letter-spacing: 0.3px; }
body.night-mode #splash-screen { background: var(--bg, #1a1a2e); }
body.night-mode .splash-version { color: var(--fg-light, #a0aec0); }

:root {
    --primary: #8B5CF6;
    --secondary: #A8B5E0;
    --accent: #8B5CF6;
    --bg: #E8EBF3;
    --bg-rgb: 232, 235, 243;
    --bg-dark: #D1D9E6;
    --fg: #4A5568;
    --fg-light: #718096;
    --white: #FFFFFF;
    --shadow-out: 6px 6px 12px #C5CAD475, -6px -6px 12px #FFFFFF25;
    --shadow-out-sm: 3px 3px 6px #C5CAD4, -3px -3px 6px #FFFFFF;
    --shadow-in: inset 4px 4px 8px #C5CAD4, inset -4px -4px 8px #FFFFFF;
    --shadow-in-sm: inset 2px 2px 4px #C5CAD4, inset -2px -2px 4px #FFFFFF;
    --card-border: 1px solid rgba(255, 255, 255, 0.5);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Activity Colors (predictions card) */
    --color-feed: #06B6D4;
    --color-sleep: #8B5CF6;
    --color-diapers: #F5B041;
    --color-pumping: #EC4899;

    /* Fluid Typography - Metric Cards (Mobile: 320px → 430px) */
    /* Title: 10px (320px) → 12px (430px) */
    --font-metric-title: clamp(0.625rem, 0.261rem + 1.818vw, 0.75rem);
    /* Hero: 18px (320px) → 24px (430px) */
    --font-metric-hero: clamp(1.125rem, 0.034rem + 5.455vw, 1.5rem);
    /* Sub: 12px (320px) → 14px (430px) */
    --font-metric-sub: clamp(0.75rem, 0.386rem + 1.818vw, 0.875rem);

    /* Animation System - Smooth, GSAP-like timing */
    --anim-fast: 200ms;
    --anim-normal: 300ms;
    --anim-enter: 400ms;
    --anim-exit: 250ms;
    --anim-slow: 1800ms;
    --ease-spring: linear(0, 0.34 4.7%, 1.14 12.1%, 1.25 14.3%, 1.27 16.6%, 1.2 19.8%, 1.0 24.3%, 0.94, 0.9 31.7%, 0.91, 0.94 38.2%, 1.0 44.8%, 1.0);
    --ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ============================================
   Ambient Activity Glow (Siri-style edge glow for live timers)
   ============================================ */
@property --glow-color {
    syntax: '<color>';
    inherits: false;
    initial-value: transparent;
}

#activity-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease, --glow-color 1.2s ease-in-out;
    will-change: opacity;
}

/* Match iPhone rounded screen corners when safe-area is present */
@supports (padding: env(safe-area-inset-top)) {
    #activity-glow { border-radius: 47px; }
}

#activity-glow.active {
    opacity: 1;
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 12px 2px var(--glow-color, transparent),
            inset 0 0 20px 0 color-mix(in srgb, var(--glow-color, transparent) 30%, transparent);
    }
    50% {
        box-shadow:
            inset 0 0 18px 3px var(--glow-color, transparent),
            inset 0 0 30px 0 color-mix(in srgb, var(--glow-color, transparent) 35%, transparent);
    }
}

/* Night Mode */
body.night-mode {
    --bg: #1a1a2e;
    --bg-rgb: 26, 26, 46;
    --bg-dark: #32324d;
    --fg: #e2e8f0;
    --fg-light: #a0aec0;
    --shadow-out: 6px 6px 12px #121220, -6px -6px 12px #22223c;
    --shadow-out-sm: 3px 3px 6px #121220, -3px -3px 6px #22223c;
    --shadow-in: inset 4px 4px 8px #121220, inset -4px -4px 8px #22223c;
    --shadow-in-sm: inset 2px 2px 4px #121220, inset -2px -2px 4px #22223c;
    --card-border: 1px solid rgba(0, 0, 0, 0.25);
}

body.night-mode .message-error { background: #3d1f1f; color: #f87171; }
body.night-mode .message-success { background: #1f3d2a; color: #4ade80; }
body.night-mode .today-badge { background: var(--bg-dark); color: var(--accent); }
body.night-mode .timezone-select {
    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='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
/* Ring backgrounds — translucent metric colours for night mode */
body.night-mode .ring-bg-feeding { stroke: rgba(6, 182, 212, 0.2); }
body.night-mode .ring-bg-sleep { stroke: rgba(139, 92, 246, 0.2); }
body.night-mode .ring-bg-diapers { stroke: rgba(245, 176, 65, 0.2); }
/* History mini-ring bg circles: 1st=feeding, 2nd=sleep, 3rd=diapers */
body.night-mode .history-mini-ring circle:nth-child(1) { stroke: rgba(6, 182, 212, 0.2); }
body.night-mode .history-mini-ring circle:nth-child(2) { stroke: rgba(139, 92, 246, 0.2); }
body.night-mode .history-mini-ring circle:nth-child(3) { stroke: rgba(245, 176, 65, 0.2); }
/* Day-group ring bg circles */
body.night-mode .day-ring circle:nth-child(1) { stroke: rgba(6, 182, 212, 0.2); }
body.night-mode .day-ring circle:nth-child(2) { stroke: rgba(139, 92, 246, 0.2); }
body.night-mode .day-ring circle:nth-child(3) { stroke: rgba(245, 176, 65, 0.2); }
/* Night mode tick marks */
body.night-mode .time-ticks line { stroke: rgba(255, 255, 255, 0.3); }
body.night-mode .time-ticks .tick-current { stroke: var(--accent); }
body.night-mode .time-ticks .tick-current-1 { stroke: color-mix(in srgb, var(--accent) 50%, rgba(255, 255, 255, 0.1)); }
body.night-mode .time-ticks .tick-current-2 { stroke: color-mix(in srgb, var(--accent) 25%, rgba(255, 255, 255, 0.1)); }
body.night-mode #activity-glow.active {
    animation-name: glowPulseNight;
}
@keyframes glowPulseNight {
    0%, 100% {
        box-shadow:
            inset 0 0 14px 3px var(--glow-color, transparent),
            inset 0 0 20px 0 color-mix(in srgb, var(--glow-color, transparent) 40%, transparent);
    }
    50% {
        box-shadow:
            inset 0 0 20px 4px var(--glow-color, transparent),
            inset 0 0 30px 0 color-mix(in srgb, var(--glow-color, transparent) 45%, transparent);
    }
}

/* Accent Colors - Primary follows Accent */
body.theme-purple { --accent: #8B5CF6; --primary: #8B5CF6; }
body.theme-aqua { --accent: #06B6D4; --primary: #06B6D4; }
body.theme-green { --accent: #00d28f; --primary: #00d28f; }
body.theme-yellow { --accent: #F5B041; --primary: #F5B041; }
body.theme-blue { --accent: #3B82F6; --primary: #3B82F6; }
body.theme-pink { --accent: #EC4899; --primary: #EC4899; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
    display: flex;
    justify-content: center;
}

#app-wrapper {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    position: relative;
}

/* Status-bar frosted gradient — default, fades out when pills take over */
#app-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top, 20px) + 32px);
    background: linear-gradient(to bottom, rgba(var(--bg-rgb), 0.9), rgba(var(--bg-rgb), 0.5) 60%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-mask: linear-gradient(to bottom, black, black 50%, rgba(0,0,0,0.7) 75%, transparent 100%);
    mask: linear-gradient(to bottom, black, black 50%, rgba(0,0,0,0.7) 75%, transparent 100%);
    z-index: 40;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}
#app-wrapper.pills-active::before {
    opacity: 0;
}
/* Status-bar frosted gradient — for when pills are visible (separate element, not inside pill bar) */
.status-frost {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top, 20px) + 49px);
    background: linear-gradient(to bottom, rgba(var(--bg-rgb), 0.9), rgba(var(--bg-rgb), 0.5) 60%, transparent);
    backdrop-filter: blur(10px);
    mask: linear-gradient(to top, transparent 0%, black 15px, black 100%);
    z-index: 49;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.status-frost.visible {
    opacity: 1;
}

/* Layout */
.screen { display: none !important; min-height: 100vh; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); position: relative; z-index: 1; }
.screen.active { display: flex !important; flex-direction: column; animation: screenSlideIn 800ms ease; }
@keyframes screenSlideIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pillSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pillSlideOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-6px); } }
/* Dashboard accent gradient — JS sets --gradient-height to end 25% into the feed card */
#dashboard-screen::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: var(--gradient-height, 0px); background: linear-gradient(to top, color-mix(in srgb, var(--gradient-color, var(--accent)) 25%, transparent) 0%, transparent 50%); z-index: -1; pointer-events: none; -webkit-mask-image: radial-gradient(51% 30px at 50% 100%, transparent 99%, #000 100%); mask-image: radial-gradient(50% 15px at 50% 100%, transparent 99%, #000 100%); transition: background 1.2s ease-in-out; }
#dashboard-screen.activity-active::before { animation: gradientPulse 3s ease-in-out infinite; }
@keyframes gradientPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
#login-screen { z-index: 10; }
#login-screen.active { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); animation: none; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    margin: 0 -16px 8px -16px;
    margin-top: calc(-1 * env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 50;
    background: transparent;
    transition: all 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}
.header.scrolled {
    background: linear-gradient(to bottom, var(--bg), transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
body.night-mode .header.scrolled {
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
.header.header-with-date {
    position: relative;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 0;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Child Selector */
.child-selector-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 10px;
}
.child-selector {
    appearance: none;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    box-shadow: var(--shadow-out-sm);
    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='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    max-width: 150px;
    text-overflow: ellipsis;
}
.child-selector:focus {
    outline: none;
    box-shadow: var(--shadow-in-sm);
}
body.night-mode .child-selector {
    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='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
.header h1 { font-size: 22px; font-weight: 700; color: var(--fg); display: flex; align-items: center; gap: 10px; }
.header h1 i { color: var(--accent); }
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 43px; width: auto; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.current-user { font-size: 18px; font-weight: 500; color: var(--fg); }

/* Date Navigation — in-flow, scrolls with page */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    width: 100%;
}

/* Fixed pill bar — completely independent of scroll flow */
.sticky-pill-bar {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 0 16px;
    box-sizing: border-box;
    pointer-events: none;
    opacity: 0;
}
.sticky-pill-bar.visible {
    opacity: 1;
    pointer-events: auto;
    animation: pillSlideIn 0.3s ease-out both;
}
.sticky-pill-bar.hiding {
    animation: pillSlideOut 0.15s ease-in both;
    pointer-events: none;
}

/* Frosted date pill */
.sticky-date-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    gap: 4px;
    white-space: nowrap;
    will-change: transform;
}
body.night-mode .sticky-date-pill {
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.3));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* Frosted hamburger pill */
.sticky-menu-pill {
    position: absolute;
    right: 16px;
    top: 0;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.5);
    background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    color: var(--fg);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}
body.night-mode .sticky-menu-pill {
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.3));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.date-nav-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    text-align: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.date-nav-display
.date-nav-display:active { background: var(--bg-dark); }

.btn-date-arrow {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 18px;
    color: var(--accent);
    cursor: pointer;
    transition: color 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.btn-date-arrow:active { color: var(--accent); opacity: 1; }



.btn-xs { padding: 6px 10px; font-size: 12px; }

/* Navigation — Glassmorphic Floating Pill */
.nav-wrapper { position: fixed; bottom: max(0px, calc(env(safe-area-inset-bottom, 0px) - 12px)); left: 0; right: 0; display: none; align-items: stretch; justify-content: center; gap: 8px; z-index: 100; padding: 0 16px; box-sizing: border-box; max-width: 440px; margin: 0 auto; }
.nav-wrapper.visible { display: flex; }
.nav {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 6px;
    gap: 4px;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}
.nav-item { flex: 1; padding: 12px 16px; text-align: center; background: transparent; border: none; border-radius: 9999px; font-size: 20px; color: var(--fg-light); cursor: pointer; transition: background 300ms ease, color 300ms ease, transform 200ms ease; -webkit-tap-highlight-color: transparent; position: relative; overflow: visible; }
.nav-item:active { transform: scale(0.92); }
.nav-notify-dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: var(--accent); pointer-events: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.8); z-index: 1; }
.nav-item.active { background: rgba(255, 255, 255, 0.35); color: var(--accent); }
/* Nav action buttons — flush right, match nav pill height */
.nav-actions { display: flex; gap: 6px; flex-shrink: 0; }
.nav-action-btn { width: 60.5px; height: 60.5px; padding: 0; border-radius: 50%; background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 2px 12px rgba(0,0,0,0.06); color: var(--accent); font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 200ms ease; flex-shrink: 0; }
.nav-action-btn:active { transform: scale(0.9); }
/* Night mode glass tinting */
body.night-mode .nav { background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.3)); border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2); }
body.night-mode .nav-item.active { background: rgba(255, 255, 255, 0.1); }
body.night-mode .nav-notify-dot { box-shadow: 0 0 0 2px rgba(0,0,0,0.6); }
body.night-mode .nav-action-btn { background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.3)); border-color: rgba(255,255,255,0.08); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) { .nav { background: rgba(232, 235, 243, 0.92); } body.night-mode .nav { background: rgba(26, 26, 46, 0.92); } }

/* Forms */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; color: var(--fg-light); }
.label-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; margin-top: -2px; }
.rec-icon { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; margin-top: -2px; }
input, select, textarea { width: 100%; padding: 14px 16px; font-size: 16px; border: none; border-radius: var(--radius); background: var(--bg); font-family: inherit; color: var(--fg); box-shadow: var(--shadow-in); transition: all 0.2s ease; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--shadow-in), 0 0 0 2px var(--primary); }
input::placeholder { color: var(--fg-light); }
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; text-align: left; min-height: 48px; box-sizing: border-box; }

/* Timezone Select */
.timezone-select {
    width: auto;
    min-width: 150px;
    padding: 10px 30px 10px 12px;
    font-size: 14px;
    appearance: none;
    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='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--bg); color: var(--accent); cursor: pointer; font-family: inherit; transition: all 0.2s ease; }
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: 0.875rem; border-radius: var(--radius-sm); }
.btn-icon { padding: 10px 14px; font-size: 0.875rem; border-radius: var(--radius-sm); }
.btn-action { width: 44px; height: 44px; padding: 0; font-size: 18px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; }
.btn-logout { font-size: 12px; padding: 10px 14px; border-radius: var(--radius-sm); }

/* Login */
#login-screen { display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { width: 200px; height: auto; }
.login-subtitle { text-align: center; color: var(--fg-light); margin-bottom: 40px; font-size: 14px; }
.login-form { max-width: 320px; margin: 0 auto; width: 100%; }
.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-input-wrapper input { padding-right: 48px; }
.password-toggle { position: absolute; right: 12px; background: none; border: none; color: var(--fg-light); cursor: pointer; padding: 8px; font-size: 16px; }
.password-toggle

/* Cards */
.card { background: var(--bg); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-out); }
.card-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.card-title i { font-size: 16px; color: var(--primary); }

.stats-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

/* Metric Cards - New Layout */
.metric-card { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-out); border-radius: var(--radius-lg); flex-wrap: wrap; border: var(--card-border); }

/* Metric card type backgrounds */
.metric-feeding { background: linear-gradient(135deg, #e0e8f1 0%, #e6ecf3 100%); --card-color: var(--color-feed); }
.metric-sleep { background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%); --card-color: var(--color-sleep); }
.metric-diapers { background: linear-gradient(135deg, rgba(245, 176, 65, 0.08) 0%, rgba(245, 176, 65, 0.02) 100%); --card-color: var(--color-diapers); }
.metric-pumping { background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(236, 72, 153, 0.02) 100%); --card-color: var(--color-pumping); }
.metric-play { background: linear-gradient(135deg, rgba(0, 210, 143, 0.08) 0%, rgba(0, 210, 143, 0.02) 100%); }
.metric-bath { background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%); }
body.night-mode .metric-feeding { background: #1c1f33; }

.metric-icon { width: 72px; height: 72px; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: transparent; flex-shrink: 0; }
.metric-icon img { width: 100%; height: 100%; object-fit: cover; }
.metric-content { flex: 1; }
.metric-title { font-size: var(--font-metric-title); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 4px; }

.metric-hero { display: flex; align-items: center; gap: 6px; margin-bottom: 0; flex-wrap: wrap; }
.metric-hero i { font-size: var(--font-metric-hero); }
.metric-hero-value { font-size: var(--font-metric-hero); font-weight: 700; }
.metric-hero-label { font-size: var(--font-metric-sub); color: var(--fg-light); }
.metric-hero-detail { font-size: var(--font-metric-sub); color: var(--fg-light); font-weight: 500; }
/* Metric colors */
.metric-diapers .metric-hero i, .metric-diapers .metric-hero-value { color: #F5B041; }
.metric-feeding .metric-hero i, .metric-feeding .metric-hero-value { color: #06B6D4; }
.metric-sleep .metric-hero i, .metric-sleep .metric-hero-value { color: #8B5CF6; }
.metric-pumping .metric-hero i, .metric-pumping .metric-hero-value { color: #EC4899; }
.metric-play .metric-hero i, .metric-play .metric-hero-value { color: #00d28f; }
.metric-bath .metric-hero i, .metric-bath .metric-hero-value { color: #3B82F6; }

.metric-secondary { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.metric-total { font-size: var(--font-metric-sub); color: var(--fg-light); }
.metric-total > span:not([id$="-label"]):not([data-field$="-label"]):not(.metric-target) { font-weight: 700; }
.metric-target { font-weight: 400; color: var(--fg-light); }
.metric-details { font-size: var(--font-metric-sub); color: var(--fg-light); }
.metric-details > span { font-weight: 700; }
#stat-night-wakings { font-weight: 400; }
#stat-night-wakings > span { font-weight: 700; }

/* Metric Icon Wrapper with Action Button */
.metric-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon-wrapper:active .metric-icon-circle {
    transform: scale(0.88);
}

.metric-icon-wrapper:active .metric-action-btn {
    transform: scale(0.85);
}

.metric-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.3s ease, transform var(--anim-fast) var(--ease-out-back);
}

.metric-icon-circle img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* Light accent backgrounds for each type */
.feeding-circle { background: rgba(6, 182, 212, 0.15); }
.sleep-circle { background: rgba(139, 92, 246, 0.15); }
.diapers-circle { background: rgba(245, 176, 65, 0.15); }
.pumping-circle { background: rgba(236, 72, 153, 0.15); }
.play-circle { background: rgba(0, 210, 143, 0.15); }
.bath-circle { background: rgba(59, 130, 246, 0.15); }

/* Active tracking states - full opacity */
.sleep-circle.active { background: rgba(139, 92, 246, 0.35); }
.pumping-circle.active { background: rgba(236, 72, 153, 0.35); }
.play-circle.active { background: rgba(0, 210, 143, 0.35); }

/* Action Buttons (now divs, click handled by wrapper) */
.metric-action-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 12px;
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Click passes through to wrapper */
}
#sleep-card .metric-action-btn {
    background: rgba(139, 92, 246, 0.7);
}
.metric-pumping .metric-action-btn {
     background: rgba(236, 72, 153, 0.7);
}

.feeding-action { background: rgba(6, 182, 212, 0.7); }

.sleep-action { background: rgba(139, 92, 246, 0.7); }
.sleep-action.active { background: rgba(139, 92, 246, 1); }

.diapers-action { background: rgba(245, 176, 65, 0.7); }

.pumping-action { background: rgba(236, 72, 153, 0.7); pointer-events: auto; }
.pumping-action.active { background: rgba(236, 72, 153, 1); }

.play-action { background: rgba(0, 210, 143, 0.7); pointer-events: auto; }
.play-action.active { background: rgba(0, 210, 143, 1); }

.bath-action { background: rgba(59, 130, 246, 0.7); }

/* Play circle icon styling */
.play-circle i { font-size: 32px; color: #00d28f; }
.bath-circle i { font-size: 32px; color: #3B82F6; }

/* Secondary action button (for stop when pumping/playing) */
.metric-action-btn-secondary {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
}

.play-stop { background: #00d28f; }
.pumping-stop { background: #EC4899; }

/* ============================================
   LINE CHART
   ============================================ */
.chart-container { background: var(--bg); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-out); border: var(--card-border); margin-bottom: 16px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.chart-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); display: flex; align-items: center; gap: 8px; }
.chart-title i { color: var(--primary); }

.chart-header-right { display: flex; align-items: center; gap: 8px; }
.chart-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); }
.chart-tab { padding: 8px 12px; font-size: 11px; font-weight: 600; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--fg-light); cursor: pointer; transition: all 0.2s ease; }
.chart-tab.active { background: var(--accent); color: var(--white); }
.chart-gantt-btn { width: 36px; height: 36px; border: none; border-radius: var(--radius-sm); background: var(--bg); color: var(--fg-light); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all 0.2s ease; box-shadow: var(--shadow-in-sm); }
.chart-gantt-btn:hover { color: var(--fg); }
.chart-gantt-btn.active { background: var(--accent); color: var(--white); }
.chart-legend-filter { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.legend-btn { display: flex; align-items: center; justify-content: center; padding: 4px; border: none; border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; box-shadow: var(--shadow-out-sm); transition: all 0.2s ease; }
.legend-btn.active { box-shadow: var(--shadow-in-sm); }
.legend-btn:not(.active) { opacity: 0.4; }
.legend-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.legend-dot i { font-size: 9px; color: white; }
.day-totals-btn { margin-left: auto; padding: 6px 12px; font-size: 11px; font-weight: 600; border: none; border-radius: var(--radius-sm); background: var(--bg); color: var(--fg-light); cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); }
.day-totals-btn.active { background: var(--accent); color: var(--white); box-shadow: none; }
.legend-dot.feeding { background: #06B6D4; }
.legend-dot.diapers { background: #F5B041; }
.legend-dot.sleep { background: #8B5CF6; }
.legend-dot.pumping { background: #EC4899; }
.legend-dot.play { background: #00d28f; }
.legend-dot.bath { background: #3B82F6; }

/* Line Chart Canvas */
.line-chart-wrapper {
    position: relative;
    height: 150px;
    margin-bottom: 8px;
}

.line-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-labels { display: flex; justify-content: space-between; overflow: hidden; }
.chart-label { font-size: 9px; color: var(--fg-light); font-weight: 500; text-align: center; flex: 1; min-width: 0; }

/* Chart Detail Bottom Sheet */
.chart-detail-body { padding: 0; }
.chart-detail-stat { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--bg-dark); }
.chart-detail-stat:last-child { border-bottom: none; }
.chart-detail-label { color: var(--fg-light); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.chart-detail-value { font-weight: 700; color: var(--fg); font-size: 16px; }
.chart-detail-sub { padding-left: 20px; }

/* Day Groups — styled like metric-card */
.day-group { margin-bottom: 8px; overflow: hidden; background: linear-gradient(to bottom, rgba(255,255,255,.25), rgba(255,255,255,0)); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.9); transition: background 0.3s ease; }
.day-group.collapsed { background: linear-gradient(to bottom, rgba(255, 255, 255, .5), rgba(255, 255, 255, .25)); }
body.night-mode .day-group { background: linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0)); border-color: rgba(0,0,0,0.5); }
body.night-mode .day-group.collapsed { background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0)); }
.day-header { color: var(--fg); padding: 16px 16px 12px; display: flex; justify-content: space-between; align-items: flex-start; cursor: pointer; transition: all 0.2s linear, padding 0.2s linear; gap: 12px; }
.day-group.collapsed .day-header { padding: 14px 16px; }
.day-header:active { opacity: 0.9; }
.day-header-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.day-header-date { font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.day-header-summary { font-size: 12px; font-weight: 600; display: flex; gap: 10px; color: var(--accent); flex-wrap: wrap; }
.day-header-summary span { display: flex; align-items: center; gap: 3px; }
.day-header-ring { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.day-ring { display: block; width: 42px; height: 42px; }
/* Entries wrapper */
.day-entries { margin: 0 10px 10px; padding: 0; max-height: 10000px; overflow: hidden; opacity: 1; transition: max-height 500ms linear, opacity 500ms linear; background: rgba(255,255,255,0.6); border-radius: var(--radius); }
body.night-mode .day-entries { background: rgba(255,255,255,0.05); }
.day-group.collapsed .day-entries { max-height: 0; opacity: 0; pointer-events: none; transition: max-height 400ms linear, opacity 400ms linear; margin: 0 10px; }

/* Filter Info */
.filter-info { display: none; padding: 12px 16px; background: var(--accent); color: var(--white); border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.filter-info.active { display: flex; justify-content: space-between; align-items: center; }
.filter-info button { background: rgba(255,255,255,0.2); border: none; color: var(--white); padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; }

/* Filter Presets Grid */
.filter-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.filter-preset-btn {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-out-sm);
    text-align: center;
}

.filter-preset-btn:active {
    box-shadow: var(--shadow-in);
}

.filter-preset-btn.active {
    background: var(--accent);
    color: var(--white);
    box-shadow: var(--shadow-in-sm);
}

/* Date Range Row */
.date-range-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.date-range-block {
    flex: 1;
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-in-sm);
}

.date-range-block label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-light);
    margin-bottom: 8px;
}

.date-range-block input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    box-shadow: var(--shadow-out-sm);
}

/* Entry — flat row with swipe-to-delete */
.entry-swipe-wrap { position: relative; overflow: hidden; }
.entry-delete-bg { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 13px; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.entry-swipe-wrap:has(.entry-inner.swiping) .entry-delete-bg { opacity: 1; pointer-events: auto; }
.entry-inner { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: transparent; cursor: pointer; transition: border-radius 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; z-index: 1; touch-action: pan-y; }
.entry-inner::after { content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 1px; background: rgba(0,0,0,0.06); transition: opacity 0.2s ease; }
body.night-mode .entry-inner::after { background: rgba(255,255,255,0.08); }
.entry-swipe-wrap:last-child .entry-inner::after { display: none; }
.entry-inner.swiping { border-radius: var(--radius-sm); background: #e6e8ef; padding:14px }
body.night-mode .entry-inner.swiping { background: rgba(255,255,255,0.08); }
.entry-inner.swiping::after { opacity: 0; }
.entry-swipe-wrap.prev-swiping .entry-inner::after { opacity: 0; }
.entry-inner:active { opacity: 0.95; }
.entry-who { display: flex; flex-direction: column; flex-shrink: 0; gap: 1px; }
.entry-time { font-size: 14px; font-weight: 700; color: var(--fg); white-space: nowrap; flex-shrink: 0; }
.entry-by { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; flex-shrink: 0; }
.entry-summary-details { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent); overflow: hidden; white-space: nowrap; flex: 1; min-width: 0; }
.entry-summary-details span { display: inline-flex; align-items: center; gap: 3px; }
.entry-summary-details i { font-size: 15px; }
.summary-volume, .summary-feeding-mixed, .summary-pumping { font-weight: 600; }
.summary-memory { cursor: pointer; }
.summary-waking { opacity: 0.85; }
.summary-waking-badge { font-size: 10px; opacity: 0.7; }

/* Night waking button (circular, top-right of sleep icon wrapper) */
.sleep-waking-action {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.85);
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
}
.sleep-waking-action:active { background: rgba(139, 92, 246, 1); }

/* Night waking sheet options */
.night-waking-options { display: flex; flex-direction: column; gap: 10px; }
.night-waking-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-out);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: transform 0.1s;
}
.night-waking-option:active { transform: scale(0.98); }
.night-waking-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.night-waking-option-text { display: flex; flex-direction: column; gap: 2px; }
.night-waking-option-label { font-weight: 600; color: var(--fg); font-size: 15px; }
.night-waking-option-desc { font-size: 12px; color: var(--text-secondary); }

/* Regenerate Routine Sheet */
.regen-options { display: flex; flex-direction: column; gap: 10px; }
.regen-option {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--bg); border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius); text-align: left; cursor: pointer; transition: background 0.15s;
}
body.night-mode .regen-option { border-color: rgba(255,255,255,0.08); }
.regen-option:active { background: rgba(0,0,0,0.04); }
body.night-mode .regen-option:active { background: rgba(255,255,255,0.06); }
.regen-option-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.regen-option-text { flex: 1; }
.regen-option-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 15px; font-weight: 600; color: var(--fg);
}
.regen-option-desc { display: block; font-size: 12px; color: var(--fg-light); margin-top: 2px; }
.regen-newborn-notice {
    margin-top: 14px; padding: 10px 12px; border-radius: var(--radius);
    background: rgba(245,158,11,0.08); color: var(--fg-light); font-size: 12px; line-height: 1.4;
}
.regen-newborn-notice i { color: #F59E0B; margin-right: 4px; }

/* Sleeping Block (ML-generated nap blocks) */
.routine-sleeping-block {
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.5);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.routine-sleeping-block.routine-sleeping-active {
    border-color: rgba(139,92,246,0.6);
    background: rgba(139,92,246,0.1);
}
body.night-mode .routine-sleeping-block {
    background: rgba(139,92,246,0.08);
    border-color: rgba(139,92,246,0.5);
}
body.night-mode .routine-sleeping-block.routine-sleeping-active {
    border-color: rgba(139,92,246,0.6);
    background: rgba(139,92,246,0.12);
}
.routine-sleeping-header {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
}
.routine-sleeping-block.no-expand .routine-sleeping-header { cursor: default; }
.routine-sleeping-icon {
    width: 32px; height: 32px; background: rgba(139,92,246,0.15); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #8B5CF6; font-size: 14px; flex-shrink: 0;
}
body.night-mode .routine-sleeping-icon { background: rgba(139,92,246,0.25); }
.routine-sleeping-info { flex: 1; }
.routine-sleeping-name { display: block; font-size: 14px; font-weight: 600; color: #8B5CF6; }
.routine-sleeping-time { display: block; font-size: 12px; color: var(--fg-light); margin-top: 1px; }
.sleeping-block-tasks { padding: 0 16px 12px; }
.routine-sleeping-block.collapsed .routine-section-body { display: none; }
.routine-sleeping-block.collapsed .routine-section-chevron i { transform: rotate(-90deg); }

/* Memories Card */
.memories-card { padding: 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-out); border: var(--card-border); overflow: visible; margin-bottom: 16px; }
.memories-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; height: 240px; }
.memories-featured { position: relative; overflow: hidden; border-radius: 12px; cursor: pointer; }
.memories-right { display: flex; flex-direction: column; gap: 12px; }
.memories-side-slot { position: relative; overflow: hidden; border-radius: 12px; flex: 1; min-height: 0; cursor: pointer; }
.memories-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.6s ease; visibility: hidden; }
.memories-loaded .memories-img { visibility: visible; }
.memories-img-b { opacity: 0; }
.memories-title-row { position: absolute; bottom: 8px; left: 8px; z-index: 2; display: flex; gap: 6px; align-items: center; }
.memories-title { background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; pointer-events: none; }
.memories-title-add { background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; width: 32px; height: 32px; border-radius: 999px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }

/* ============================================ */
/* MEMORIES FEED                                */
/* ============================================ */
.memories-feed-count { font-size: 13px; color: var(--fg-light); font-weight: 400; }
.memories-feed { display: flex; flex-direction: column; gap: 20px; }

/* Feed Card */
.feed-card { background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-out); border: var(--card-border); overflow: hidden; }
.feed-card-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.feed-card-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-card-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.feed-card-author { font-size: 14px; font-weight: 600; color: var(--fg); line-height: 1.2; }
.feed-card-time { font-size: 12px; color: var(--fg-light); line-height: 1.3; }

/* Photo image container */
.feed-card-image { position: relative; width: 100%; cursor: pointer; background: var(--bg-dark); -webkit-tap-highlight-color: transparent; }
.feed-card-image img { display: block; width: 100%; height: auto; max-height: 500px; object-fit: cover; }
.feed-card-image video, .feed-card-carousel-slide video { display: block; width: 100%; height: auto; max-height: 500px; object-fit: cover; }
.feed-card-video { position: relative; }
.feed-video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; pointer-events: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.feed-video-play i { margin-left: 3px; }

/* Action bar */
.feed-card-actions { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; }
.feed-card-social { display: flex; align-items: center; gap: 16px; }
.feed-card-heart,
.feed-card-comment-btn,
.feed-card-share { background: none; border: none; color: var(--fg-light); font-size: 20px; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 2px; -webkit-tap-highlight-color: transparent; transition: color 200ms ease, transform 200ms ease; }
.feed-card-heart span,
.feed-card-comment-btn span { font-size: 14px; font-weight: 500; min-width: 0; }
.feed-card-heart:active,
.feed-card-comment-btn:active,
.feed-card-share:active { transform: scale(0.9); }
.feed-card-heart-count { font-size: 14px; font-weight: 500; color: var(--fg-light); cursor: pointer; padding: 6px 2px; -webkit-tap-highlight-color: transparent; margin-left: -10px; }
.feed-card-heart.hearted { color: #EC4899; }
.feed-card-heart.hearted i { animation: heartPop 500ms var(--ease-spring); }
@keyframes heartPop { 0% { transform: scale(1); } 15% { transform: scale(1.35); } 100% { transform: scale(1); } }
.feed-card-heart.hearted i.burst { animation: heartBurst 600ms var(--ease-spring); }
@keyframes heartBurst { 0% { transform: scale(0.5); } 20% { transform: scale(1.5); } 100% { transform: scale(1); } }
.feed-card-share { font-size: 18px; }

/* Feed card scroll reveal */
.feed-card { opacity: 0; transform: translateY(24px); transition: opacity var(--anim-enter) ease, transform var(--anim-enter) var(--ease-out-expo); }
.feed-card.revealed { opacity: 1; transform: translateY(0); }
.feed-card--skeleton { opacity: 1; transform: none; }

.feed-card-date { font-size: 11px; color: var(--fg-light); flex-shrink: 0; align-self: flex-start; margin-top: 2px; }

/* Skeleton loader */
.feed-card--skeleton { pointer-events: none; }
.feed-card--skeleton .skel-bone { display: block; }
.feed-card--skeleton .feed-card-header { padding: 12px 16px; }

/* Empty state */
.memories-feed-empty { text-align: center; padding: 60px 20px; color: var(--fg-light); }
.memories-feed-empty i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.memories-feed-empty p { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.memories-feed-empty-sub { font-size: 13px; font-weight: 400; opacity: 0.7; }


/* Infinite scroll sentinel */
.memories-feed-sentinel { height: 1px; width: 100%; }

/* Night mode feed adjustments */
body.night-mode .feed-card-image { background: #111; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .feed-card-heart.hearted i,
    .feed-card-heart.hearted i.burst { animation: none; }
    .nav-item { transition: none !important; }
    .feed-card { opacity: 1; transform: none; transition: none; }
    .lightbox-comment.entering { opacity: 1; transform: none; }
    .lightbox-comment { transition: none; }
    .heart-burst { animation: none; display: none; }
}

/* Create Memory sheet */
.create-memory-photos { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; }
.create-memory-thumb { position: relative; width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; }
.create-memory-thumb img, .create-memory-thumb video { width: 100%; height: 100%; object-fit: cover; }
.create-memory-thumb.is-video .video-thumb-badge { position: absolute; bottom: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 8px; }
.create-memory-thumb.is-video .video-thumb-badge i { margin-left: 1px; }
.video-thumb-loading { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg-dark); color: var(--fg-light); font-size: 16px; }
.create-memory-thumb-remove { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.create-memory-thumb.done::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; }
.create-memory-thumb.done::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #fff; font-size: 20px; z-index: 1; }
.create-memory-thumb.existing { border: 2px solid var(--accent); box-sizing: border-box; }
.create-memory-add-btn { width: 100%; padding: 14px; border: 2px dashed var(--fg-light); border-radius: var(--radius); background: none; color: var(--fg-light); font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; transition: border-color 200ms, color 200ms; }
.create-memory-add-btn:active { border-color: var(--accent); color: var(--accent); }
.create-memory-progress { padding: 8px 0 16px; }
.create-memory-progress-bar { width: 100%; height: 4px; background: var(--bg-dark); border-radius: 2px; overflow: hidden; }
.create-memory-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; transition: width 300ms ease; }
.create-memory-progress-text { font-size: 12px; color: var(--fg-light); display: block; margin-top: 6px; text-align: center; }
.create-memory-save { width: 100%; margin-top: 8px; }
.create-memory-save:disabled { opacity: 0.5; pointer-events: none; }
#create-memory-body { padding: 0 20px 20px; }
#create-memory-caption { width: 100%; resize: none; font-size: 14px; }

/* Feed card carousel */
.feed-card-carousel { position: relative; width: 100%; overflow: hidden; background: var(--bg-dark); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.feed-card-carousel-track { display: flex; transition: transform 300ms ease; will-change: transform; }
.feed-card-carousel-track.dragging { transition: none; }
.feed-card-carousel-slide { flex: 0 0 100%; min-width: 0; }
.feed-card-carousel-slide img { display: block; width: 100%; height: auto; max-height: 500px; object-fit: cover; }
.feed-card-carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: background 200ms, transform 200ms; }
.carousel-dot.active { background: #fff; transform: scale(1.3); }

/* Feed card caption */
.feed-card-caption { padding: 4px 16px 8px; font-size: 14px; color: var(--fg); line-height: 1.4; }

/* Clickable likes toggle */
.liked-by-toggle { cursor: pointer; text-decoration: underline; color: var(--fg); -webkit-tap-highlight-color: transparent; }

/* Entry Details (legacy — kept for custom entry compatibility) */
.entry-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-metric { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--fg-light); }
.entry-metric i { font-size: 14px; }

/* Bottom Sheet */
body.scroll-locked { position: fixed; width: 100%; overflow: hidden; overscroll-behavior: none; }
.bottom-sheet { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0); z-index: 200; align-items: flex-end; justify-content: center; transition: background 400ms ease-out; }
.bottom-sheet.active { display: flex; background: rgba(0, 0, 0, 0.4); }
.bottom-sheet.closing { background: rgba(0, 0, 0, 0); transition: all 300ms linear; }
.bottom-sheet-content { background: var(--bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 20px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; animation: slideUp 400ms ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); will-change: transform; }
.bottom-sheet.closing .bottom-sheet-content { animation: slideDown 500ms ease; }
.bottom-sheet-compact { max-height: 60vh; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
.bottom-sheet-handle { width: 40px; height: 5px; background: var(--bg-dark); border-radius: 3px; margin: 0 auto 20px; cursor: grab; touch-action: none; }
.bottom-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--bg-dark); }
.bottom-sheet-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--fg); }
.bottom-sheet-title i { color: var(--primary); }

/* Metric buttons */
.metric-selector { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.metric-btn { padding: 14px 4px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); color: var(--fg-light); }
.metric-btn.selected { box-shadow: var(--shadow-in); color: var(--accent); }
.metric-btn-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.metric-btn-label { font-size: 9px; font-weight: 600; text-transform: uppercase; text-align: center; }

/* Metric sub-type selector */
.metric-subtype-row { margin-bottom: 12px; animation: fadeIn 0.2s ease; }
.metric-subtype-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); display: block; margin-bottom: 6px; padding-left: 2px; }
.metric-subtype-btns { display: flex; gap: 8px; }
.metric-subtype-btns .metric-btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Date/Time inline row */
.entry-datetime-row { display: flex; gap: 12px; margin-bottom: 0; }
.entry-date-col { flex: 1; }
.entry-time-col { flex: 1; }

/* Context chip */
.entry-context-chip { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--bg); cursor: pointer; box-shadow: var(--shadow-out-sm); transition: all 0.2s ease; }
.context-chip-label { font-size: 15px; font-weight: 700; color: var(--fg); flex: 1; }
.entry-context-chip i { color: var(--fg-light); font-size: 12px; }
.context-chip-hint { font-size: 11px; color: var(--fg-light); }

/* Volume stepper */
.volume-stepper { display: flex; gap: 8px; align-items: center; }
.volume-stepper input { flex: 1; }
.stepper-btn { width: 44px; height: 44px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--fg-light); box-shadow: var(--shadow-out-sm); transition: all 0.15s ease; flex-shrink: 0; }
.stepper-btn:active { box-shadow: var(--shadow-in); color: var(--accent); }
.stepper-minus { color: var(--fg-light); }
.stepper-plus { color: var(--accent); }
.ml-vol-hint { display: inline; color: var(--accent); font-size: 12px; opacity: 0.6; margin-left: 4px; }

/* Batch night logging */
.batch-night-rows { display: flex; flex-direction: column; gap: 10px; }
.batch-night-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-out-sm); }
.batch-time-input { width: 90px; padding: 8px; border: 1px solid var(--bg-dark); border-radius: var(--radius-sm); background: var(--bg); color: var(--fg); font-size: 14px; font-family: inherit; }
.batch-type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 50px; font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(139, 92, 246, 0.08); white-space: nowrap; }
.batch-vol-input { width: 65px; padding: 8px; border: 1px solid var(--bg-dark); border-radius: var(--radius-sm); background: var(--bg); color: var(--fg); font-size: 14px; font-family: inherit; text-align: center; }
.batch-remove-btn { width: 32px; height: 32px; border: none; border-radius: 50%; background: none; cursor: pointer; color: var(--fg-light); font-size: 14px; display: flex; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; }
.batch-remove-btn:active { color: #ef4444; }

/* Play type grid */
.play-type-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.play-type-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; box-shadow: var(--shadow-out-sm); transition: all 0.2s ease; color: var(--fg-light); min-width: 70px; flex: 0 0 calc(25% - 6px); }
.play-type-btn i { font-size: 18px; }
.play-type-btn span { font-size: 8px; font-weight: 600; text-transform: uppercase; text-align: center; line-height: 1.2; }
.play-type-btn.selected { box-shadow: var(--shadow-in); color: var(--accent); }
.help-text-inline { font-size: 11px; font-weight: 400; color: var(--fg-light); }

/* Size selector */
.size-selector { display: flex; gap: 10px; }
.size-btn { flex: 1; padding: 14px; border: none; border-radius: var(--radius); background: var(--bg); cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); color: var(--fg-light); }
.size-btn.selected { box-shadow: var(--shadow-in); color: var(--accent); }

/* User list */
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--bg); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow-out-sm); }
.user-name { font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--fg); }
.user-name i { color: var(--primary); }
.user-role-badge { font-size: 11px; padding: 2px 8px; border-radius: 12px; background: var(--bg-inset); color: var(--fg-light); font-weight: 400; }
.user-actions { display: flex; gap: 8px; }
.friend-hidden { display: none !important; }

@keyframes fabBounceIn {
    0% { opacity: 0; transform: translateY(80px) scale(0.3); }
    50% { opacity: 1; transform: translateY(-8px) scale(1.05); }
    70% { opacity: 1; transform: translateY(4px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Messages */
.message { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-in-sm); }
.message-error { background: #FEE2E2; color: #DC2626; }
.message-success { background: #D1FAE5; color: #059669; }

/* Section */
.section { margin-bottom: 0; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 12px; margin-bottom: 16px; color: var(--fg-light); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }

/* Field groups */
.field-group { display: none; padding: 16px; background: var(--bg); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow-in-sm); }
.field-group.active { display: block; }
.field-group-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--fg); }
.field-group-title i { color: var(--primary); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--fg-light); display: flex; flex-direction: column; align-items: center; gap: 20px; }
.empty-state-icon { font-size: 64px; opacity: 0.4; color: var(--primary); }
.empty-state-logo { width: 120px; height: auto; }
.empty-state p { font-size: 14px; line-height: 1.2; }
.empty-state-welcome h3 { font-size: 20px; color: var(--fg); font-weight: 600; }
.empty-state-welcome > p { max-width: 280px; }
.empty-state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.empty-state-tips { background: var(--bg-dark); padding: 16px; border-radius: var(--radius); max-width: 320px; }
.empty-state-tips p { font-size: 12px; margin: 0; color: var(--fg-light); }
.empty-state-tips i { color: var(--accent); margin-right: 6px; }

/* Badges */
.today-badge { background: var(--white); color: var(--accent); padding: 4px 10px; font-size: 10px; font-weight: 700; border-radius: var(--radius-sm); margin-left: 8px; }

/* Form actions */
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.form-actions .btn { flex: 1; }

/* Help text */
.help-text { color: var(--fg-light); font-size: 11px; margin-top: 6px; }
.help-text i { margin-right: 4px; }


/* Settings */
.settings-card { margin-bottom: 16px; background: var(--bg); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-out); border: var(--card-border); }
.settings-card .card-title { cursor: pointer; margin-bottom: 0; -webkit-tap-highlight-color: transparent; }
.settings-card.expanded .card-title { margin-bottom: 16px; }
.settings-chevron { margin-left: auto; font-size: 12px; color: var(--fg-light); transition: transform 0.3s ease; }
.settings-card.expanded .settings-chevron { transform: rotate(180deg); }
.settings-card-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.settings-card.expanded .settings-card-body { max-height: 1200px; }
.settings-divider { border-top: 1px solid var(--bg-dark); margin: 16px 0; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; }
.settings-row:not(:last-child) { border-bottom: 1px solid var(--bg-dark); }
.settings-label { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--fg); }
.settings-label i { font-size: 20px; color: var(--primary); }

/* Theme Toggle */
.theme-toggle { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); box-shadow: var(--shadow-in-sm); }
.theme-btn { width: 40px; height: 32px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--fg-light); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s ease; }
.theme-btn.active { background: var(--accent); color: var(--white); }

/* Color picker */
.color-picker { display: flex; gap: 10px; justify-content: center; padding: 16px 0; flex-wrap: wrap; }
.color-option { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow-out-sm); }
.color-option
.color-option.selected { border-color: var(--fg); box-shadow: var(--shadow-in); }
.color-option.purple { background: #8B5CF6; }
.color-option.aqua { background: #06B6D4; }
.color-option.green { background: #00d28f; }
.color-option.yellow { background: #F5B041; }
.color-option.blue { background: #3B82F6; }
.color-option.pink { background: #EC4899; }

/* Admin buttons */
.admin-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-buttons .btn { flex: 1; min-width: 140px; }
.file-input-wrapper { position: relative; overflow: hidden; display: inline-block; flex: 1; min-width: 140px; border-radius: var(--radius); }
.file-input-wrapper input[type=file] { position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-input-wrapper .btn { width: 100%; pointer-events: none; border-radius: var(--radius);}

/* Install App Instructions */
.install-option { background: var(--bg); padding: 12px; border-radius: var(--radius); margin-bottom: 12px; }
.install-option strong { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--fg); }
.install-option i { color: var(--primary); }
.install-steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--fg-light); }
.install-steps li { margin-bottom: 4px; }
.install-steps i { font-size: 12px; color: var(--fg); }

/* Loading */
.loading { display: none; text-align: center; padding: 40px; color: var(--fg-light); }
.loading.active { display: block; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--bg-dark); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Summary Target Display */
.summary-value-row { display: flex; align-items: baseline; gap: 6px; }

/* Progress Rings Card — edge-to-edge, no neumorphic shadow */
.progress-card { background: transparent; border-radius: 0; padding: 20px 0; box-shadow: none; margin: 0 -16px 0 -16px; overflow: hidden; }
.progress-main { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 0 20px; }
.progress-rings { width: clamp(140px, calc(23.64px + 36.36vw), 180px); height: clamp(140px, calc(23.64px + 36.36vw), 180px); transform: rotate(-90deg); flex-shrink: 0; }
.ring-bg { fill: none; stroke-width: 10; }
.ring-bg-feeding { stroke: rgba(6, 182, 212, 0.15); }
.ring-bg-sleep { stroke: rgba(139, 92, 246, 0.15); }
.ring-bg-diapers { stroke: rgba(245, 176, 65, 0.15); }
.ring-progress { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease, stroke-dasharray 0.5s ease; }
.ring-feeding { stroke: #06B6D4; }
.ring-feeding-solids { stroke: #058299; } /* color-mix(in srgb, #06B6D4 72%, #000 28%) */
.ring-sleep { stroke: #8B5CF6; }
.ring-diapers { stroke: #F5B041; }
body.night-mode .ring-feeding-solids { stroke: #3CC4D8; } /* color-mix(in srgb, #06B6D4 80%, #fff 20%) */

/* Hour tick marks (progressively appear as day passes - every 15 mins) */
.time-ticks line { stroke: #06B6D4; stroke-linecap: round; opacity: 0; transform-origin: center; transform: scale(0); }
.time-ticks line.animate-in { animation: tickFadeIn 100ms ease-out forwards; }
@keyframes tickFadeIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.time-ticks .tick-current { stroke-width: 2.25; stroke: var(--accent); }
.time-ticks .tick-current-1 { stroke-width: 1.9; stroke: color-mix(in srgb, var(--accent) 50%, #06B6D4); }
.time-ticks .tick-current-2 { stroke-width: 1.6; stroke: color-mix(in srgb, var(--accent) 25%, #06B6D4); }
.time-ticks .tick-major { stroke-width: 1.3; }
.time-ticks .tick-minor { stroke-width: 0.75; }
.time-ticks .tick-minor.animate-in { animation: tickFadeIn 100ms ease-out forwards; opacity: 0.7; }

.progress-metrics { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.progress-metric { display: flex; flex-direction: column; }
.progress-metric-label { font-size: clamp(0.625rem, calc(0.261rem + 1.818vw), 0.75rem); color: var(--fg-light); text-transform: uppercase; letter-spacing: 0.3px; }
.progress-metric-value { font-size: clamp(1.25rem, calc(0.159rem + 5.455vw), 1.625rem); font-weight: 700; }
.unit-sm { font-size: 0.66em; font-weight: 700; } /* v7.33.1 — shrink unit characters (ml, g, h, m, d) next to big coloured numbers */
.progress-metric-value.feeding { color: #06B6D4; }
.progress-metric-value.sleep { color: #8B5CF6; }
.progress-metric-value.diapers { color: #F5B041; }

.progress-history-wrapper { overflow: hidden; }
.progress-history { display: flex; touch-action: pan-x; user-select: none; will-change: transform; }
.history-week { display: flex; justify-content: space-between; padding: 8px 20px 12px; min-width: 100%; flex-shrink: 0; }
.progress-history-day { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity 0.2s; flex: 1; gap: 4px; }
.history-day-label { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--fg-light); text-transform: uppercase; border-radius: 50%; transition: all 0.2s; }
.progress-history-day.has-data .history-day-label { color: var(--fg); }
.progress-history-day.active .history-day-label { background: var(--accent); color: #fff !important; }
.progress-history-day.future { pointer-events: none; }
.progress-history-day.future .history-day-label { opacity: 0.4; }
.history-ring-container { display: flex; align-items: center; justify-content: center; }
.history-mini-ring { display: block; }

/* Settings Note */
.settings-note { font-size: 12px; color: var(--fg-light); margin-bottom: 16px; font-style: italic; }
.settings-hint { font-size: 11px; color: var(--primary); font-weight: 400; margin-left: 8px; }

/* Pumping Schedule Page */
.pump-day { border-bottom: 1px solid var(--bg-dark); }
.pump-day:last-child { border-bottom: none; }
.pump-day-header { display: flex; align-items: center; padding: 12px 0; cursor: pointer; }
.pump-day-name { font-weight: 600; font-size: 14px; min-width: 40px; color: var(--fg); }
.pump-day-summary { flex: 1; font-size: 12px; color: var(--fg-light); padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pump-day-toggle { font-size: 12px; color: var(--primary); font-weight: 600; padding: 4px 0; white-space: nowrap; }
.pump-day-blocks { padding: 4px 0 12px 40px; display: none; }
.pump-day.expanded .pump-day-blocks { display: block; }
.pump-day.expanded .pump-day-summary { display: none; }
.pump-block { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
.pump-block input[type="time"] {
    width: 120px; padding: 8px; border-radius: 10px;
    border: 1px solid var(--bg-dark); background: var(--bg);
    color: var(--fg); font-size: 14px;
}
.pump-block-sep { color: var(--fg-light); font-size: 13px; }
.pump-block-remove { color: var(--fg-light); font-size: 18px; padding: 4px 8px; cursor: pointer; margin-left: auto; }
.pump-add-block { font-size: 13px; color: var(--primary); padding: 8px 0; cursor: pointer; font-weight: 500; }
.pump-copy-all { font-size: 12px; color: var(--fg-light); padding: 4px 0; cursor: pointer; text-decoration: underline; }

/* Baby Age Display */
.baby-age { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 8px; }

/* Recommended Targets */
.recommended-targets { margin: 16px 0px; padding: 12px; background: var(--bg-dark); border-radius: var(--radius-sm); }
.recommended-title { font-size: 11px; font-weight: 600; color: var(--fg-light); text-transform: uppercase; margin-bottom: 8px; }
.recommended-values { font-size: 13px; color: var(--fg); line-height: 1.6; }
.rec-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rec-row span { flex: 1; }
.rec-row strong { color: var(--primary); }
.btn-apply-rec { padding: 4px 10px; font-size: 11px; background: var(--primary); color: white; border: none; border-radius: 12px; cursor: pointer; }
.btn-apply-rec:hover { background: var(--primary-dark); }
/* Link recommendation button - unlinked state shows "LINK" text */
.btn-link-rec { padding: 4px 10px; font-size: 11px; background: var(--primary); color: white; border: none; border-radius: 12px; cursor: pointer; min-width: 44px; transition: all 0.2s; }
.btn-link-rec:hover { background: var(--primary-dark); }
/* Linked state - shows accent-colored link icon */
.btn-link-rec.linked { background: transparent; color: var(--accent, #F5B041); padding: 4px 8px; }
.btn-link-rec.linked:hover { background: rgba(var(--accent-rgb, 245, 176, 65), 0.1); }
.btn-link-rec.linked i { font-size: 14px; }
.rec-detail { font-size: 11px; color: var(--fg-light); margin-top: 4px; }

/* Version Info */
.version-info { text-align: center; padding: 20px; color: var(--fg-light); font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.settings-copyright { font-size: 11px; font-weight: 600; margin-top: 4px; }
.settings-legal-links { font-size: 11px; margin-top: 2px; }
.settings-legal-links a { color: var(--primary); text-decoration: none; }
.settings-licenses { font-size: 10px; margin-top: 8px; text-align: left; color: var(--fg-light); }
.settings-licenses summary { cursor: pointer; text-align: center; color: var(--primary); font-size: 11px; }
.settings-licenses ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.settings-licenses li { line-height: 1.3; }
.source-ref { font-size: 10px; margin-top: 4px; }
.source-ref a { color: var(--primary); text-decoration: none; }

/* Privacy Policy */
.privacy-section { margin-bottom: 16px; }
.privacy-section h4 { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.privacy-section p { font-size: 12px; line-height: 1.5; color: var(--fg-light); margin-bottom: 6px; }
.privacy-section ul { font-size: 12px; line-height: 1.5; color: var(--fg-light); padding-left: 20px; margin-bottom: 6px; }
.privacy-section li { margin-bottom: 4px; }
.privacy-section code { background: var(--bg-dark); padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* Chart Detail Modal */
.chart-detail-body { max-height: 300px; overflow-y: auto; }
.chart-detail-entry { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--bg-dark); }
.chart-detail-entry:last-child { border-bottom: none; }
.chart-detail-time { font-weight: 600; color: var(--fg); }
.chart-detail-desc { flex: 1; margin-left: 12px; color: var(--fg-light); font-size: 14px; }
.chart-detail-edit { padding: 8px; color: var(--primary); cursor: pointer; }

/* Settings Action Row (Updates + Logout) */
.settings-action-row { display: flex; gap: 10px; margin-bottom: 16px; }
.settings-action-btn { flex: 1; }
.btn-outline { background: transparent; color: var(--fg); border: 1.5px solid var(--bg-dark); }
.btn-outline:active { background: var(--bg-dark); }

/* Settings Hamburger Button — frosted glass pill on all screens */
.btn-settings-hamburger { width: 42px; height: 42px; padding: 0; border-radius: 999px; background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 2px 12px rgba(0,0,0,0.06); color: var(--fg); font-size: 16px; display: flex; align-items: center; justify-content: center; }
body.night-mode .btn-settings-hamburger { background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.3)); border-color: rgba(255,255,255,0.08); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }

/* Plan Page */
.plan-header { margin-bottom: 16px; }
.plan-title { font-size: 20px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.plan-context { font-size: 13px; color: var(--fg-light); font-style: italic; }

.plan-card { margin-bottom: 16px; }

/* Coming Soon Page */
.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 400px;
}

.coming-soon-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.coming-soon-icon i {
    font-size: 40px;
    color: var(--primary);
}

.coming-soon-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.coming-soon-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.coming-soon-desc {
    font-size: 14px;
    color: var(--fg-light);
    max-width: 280px;
    line-height: 1.5;
}

/* Pumping Session Summary */
.pumping-session-summary {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.pumping-session-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pumping-session-label {
    font-size: 12px;
    color: var(--fg-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pumping-session-value {
    font-size: 32px;
    font-weight: 700;
    color: #EC4899;
}

.plan-events { display: flex; flex-direction: column; gap: 12px; }
.plan-event { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-dark); border-radius: var(--radius); border-left: 3px dashed var(--fg-light); }
.plan-event-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.plan-event-icon.feeding { background: rgba(6, 182, 212, 0.15); color: #06B6D4; }
.plan-event-icon.sleep { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.plan-event-icon.diapers { background: rgba(245, 176, 65, 0.15); color: #F5B041; }
.plan-event-icon.pumping { background: rgba(236, 72, 153, 0.15); color: #EC4899; }

/* Plan Accordions - Accordion Animation */
.plan-accordions { display: flex; flex-direction: column; gap: 8px; }
.plan-accordion { background: var(--bg-dark); border-radius: var(--radius); overflow: hidden; }
.plan-accordion-header { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.plan-accordion-summary { flex: 1; }
.plan-accordion-arrow { color: var(--fg-light); transition: transform 400ms linear; }
.plan-accordion.expanded .plan-accordion-arrow { transform: rotate(180deg); transition: transform 500ms ease; }
.plan-accordion-content { max-height: 0; overflow: hidden; transition: max-height 400ms linear; }
.plan-accordion.expanded .plan-accordion-content { max-height: 500px; transition: max-height 500ms ease; }
.plan-accordion-list { padding: 0 12px 12px 12px; display: flex; flex-direction: column; gap: 8px; }

/* Schedule Items with Log Button */
.plan-schedule-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 13px; }
.plan-schedule-item .schedule-time { font-weight: 600; color: var(--fg); min-width: 65px; }
.plan-schedule-item .schedule-expected { font-size: 12px; color: var(--fg-light); flex: 1; }
.plan-schedule-item .schedule-expected.size-small { color: #22C55E; }
.plan-schedule-item .schedule-expected.size-medium { color: #EAB308; }
.plan-schedule-item .schedule-expected.size-large { color: #EC4899; }
.plan-schedule-item.current { border-left: 3px solid var(--primary); background: rgba(var(--primary-rgb), 0.05); }

/* Single Log Button */
.schedule-log-btn { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    padding: 6px 12px; 
    border-radius: 16px; 
    border: none; 
    background: var(--primary); 
    color: white; 
    font-size: 12px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s; 
    white-space: nowrap;
}
.schedule-log-btn
.schedule-log-btn:active { transform: scale(0.98); }
.schedule-log-btn i { font-size: 10px; }

/* Schedule item main row */
.schedule-main { display: flex; align-items: center; gap: 8px; }

/* Schedule formula toggle */
.schedule-formula-toggle {
    font-size: 10px;
    color: var(--fg-light);
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.schedule-formula-toggle
.schedule-formula-toggle i { font-size: 9px; }

/* Schedule formula detail - hidden by default */
.schedule-formula-detail {
    display: none;
    background: var(--bg);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 6px;
    font-size: 10px;
}
.plan-schedule-item.show-formula .schedule-formula-detail { display: block; }

.formula-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    color: var(--fg-light);
}
.formula-row span:last-child { font-weight: 500; color: var(--fg); }
.formula-calc {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--bg-dark);
    font-family: monospace;
    font-size: 9px;
    color: var(--primary);
}

/* Goals Progress on Plan Page */
.goals-progress-list { display: flex; flex-direction: column; gap: 10px; }
.goal-progress-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg-dark); border-radius: var(--radius); }
.goal-progress-item .goal-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.goal-progress-item .goal-icon.achieved { background: rgba(34, 197, 94, 0.15); color: #22C55E; }
.goal-progress-item .goal-icon.close { background: rgba(234, 179, 8, 0.15); color: #EAB308; }
.goal-progress-item .goal-icon.far { background: var(--bg); color: var(--fg-light); }
.goal-progress-item .goal-info { flex: 1; }
.goal-progress-item .goal-name { font-size: 13px; font-weight: 500; color: var(--fg); }
.goal-progress-item .goal-status { font-size: 12px; color: var(--fg-light); }
.goals-progress-note { font-size: 12px; color: var(--fg-light); display: flex; align-items: center; gap: 6px; padding-top: 8px; }

/* Settings Goals Divider */
.goals-targets-divider { height: 1px; background: var(--bg-dark); margin: 16px 0; }
.goals-targets-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 12px; }

/* Toast Notification */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg); padding: 12px 24px; border-radius: 24px; font-size: 14px; font-weight: 500; opacity: 0; transition: all 0.3s; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Stacked Trends View Container - Full Screen Overlay */
.gantt-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    background: var(--bg);
    border-bottom: 1px solid var(--bg-dark);
}
.gantt-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gantt-header h2 i { color: var(--primary); }
.gantt-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-out-sm);
}
.gantt-close-btn:active { box-shadow: var(--shadow-in-sm); }
.gantt-header-actions { display: flex; align-items: center; gap: .5rem; }
.gantt-days-select {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    box-shadow: var(--shadow-out-sm);
    appearance: none;
    -webkit-appearance: none;
    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='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.gantt-days-select:active { box-shadow: var(--shadow-in-sm); }
body.night-mode .gantt-days-select {
    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='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
.gantt-timeline { padding: 16px; display: flex; flex-direction: column; overflow-y: auto; flex: 1; }

/* Skeleton Shimmer System */
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-bone { display: none; background: linear-gradient(100deg, var(--bg-dark) 0%, var(--bg-dark) 40%, var(--bg) 50%, var(--bg-dark) 60%, var(--bg-dark) 100%); background-size: 200% 100%; background-attachment: fixed; border-radius: 4px; animation: skeleton-shimmer 1.8s ease-in-out infinite; }
.card-prediction--skeleton { cursor: progress; }
.card-prediction--skeleton .skel-bone { display: block; }
.card-prediction--skeleton .card-pred-chip,
.card-prediction--skeleton .card-pred-label,
.card-prediction--skeleton .card-pred-countdown,
.card-prediction--skeleton .card-pred-fill,
.card-prediction--skeleton .card-pred-accordion { display: none !important; }
.skel-chip { width: 24px; height: 14px; border-radius: 6px; flex-shrink: 0; }
.skel-label { flex: 1; height: 12px; max-width: 55%; }
.skel-countdown { width: 60px; height: 12px; margin-left: auto; }
.skel-bar { width: 100%; height: 3px; border-radius: 2px; }
.card-prediction--loaded { animation: pred-fadeIn 300ms ease forwards; }
@keyframes pred-fadeIn { from { opacity: 0.4; } to { opacity: 1; } }

/* Hide prediction skeletons on routine/plan page (predictions are dashboard-only) */
#plan-screen .card-prediction { display: none !important; }

/* Embedded Card Predictions */
.card-prediction { flex-basis: 100%; margin-top: 0; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; background: rgba(255, 255, 255, 0.5); border-radius: 16px; padding: 14px; }
body.night-mode .card-prediction { background: rgba(255, 255, 255, 0.06); }
.card-pred-info { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.card-pred-chip { font-size: 9px; font-weight: 700; color: var(--card-color); background: color-mix(in srgb, var(--card-color) 12%, transparent); padding: 2px 6px; border-radius: 6px; letter-spacing: 0.5px; flex-shrink: 0; }
.card-pred-label { font-size: 11px; font-weight: 600; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-pred-countdown { font-size: 11px; font-weight: 600; color: var(--card-color); white-space: nowrap; }
.card-pred-countdown.overdue { font-weight: 700; animation: pulse-pred 1.5s ease-in-out infinite; }
@keyframes pulse-pred { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
/* Progress bar — card color, never red */
.card-pred-progress { width: 100%; height: 3px; background: var(--bg-dark); border-radius: 2px; overflow: hidden; }
.card-pred-fill { height: 100%; border-radius: 2px; background: var(--card-color); transition: width 1s ease; }
.card-pred-fill.bar-overdue { animation: pulse-bar 1.5s ease-in-out infinite; }
@keyframes pulse-bar { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
/* Accordion panel */
.card-pred-accordion { max-height: 0; overflow: hidden; transition: max-height 400ms ease; }
.card-pred-accordion.expanded { max-height: 350px; overflow-y: auto; -webkit-overflow-scrolling: touch; transition: max-height 500ms ease; }
/* Accordion items */
.card-pred-future { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 11px; }
.card-pred-future:first-child { padding-top: 6px; }
.card-pred-future-num { font-weight: 700; color: var(--card-color); min-width: 20px; }
.card-pred-future-time { color: var(--fg); font-weight: 600; }
.card-pred-future-vol { color: var(--fg-light); font-weight: 500; white-space: nowrap; }
.card-pred-future-range { color: var(--fg-light); margin-left: auto; white-space: nowrap; }
/* Actual/completed entries in accordion */
.card-pred-actual .card-pred-future-num { color: var(--fg-light); font-weight: 600; }
.card-pred-actual .card-pred-future-time { color: var(--fg-light); }
/* Variance coloring for historical comparison */
.var-good { color: var(--card-color) !important; font-weight: 600; }
.var-fair { color: var(--fg-light) !important; }
.var-wide { color: var(--fg-light) !important; opacity: 0.7; }
/* Divider between actuals and predictions */
.card-pred-divider { border-top: 1px dashed var(--bg-dark); margin: 4px 0; }
/* Night mode */
body.night-mode .card-pred-chip { background: color-mix(in srgb, var(--card-color) 20%, transparent); }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) { .card-pred-accordion { transition: none; } .card-pred-countdown.overdue, .card-pred-fill.bar-overdue { animation: none; } .skel-bone { animation: none; } .card-prediction--loaded { animation: none; } }

.plan-event-title { font-size: 13px; color: var(--fg-light); margin-bottom: 2px; }
.plan-event-time { font-size: 16px; font-weight: 600; color: var(--fg); }
.plan-event-desc { font-size: 11px; color: var(--fg-light); margin-top: 2px; font-style: italic; }

.plan-rhythm { display: flex; flex-direction: column; gap: 16px; }
.rhythm-section { display: flex; flex-direction: column; gap: 6px; }
.rhythm-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fg-light); margin-bottom: 2px; }
.rhythm-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg); }
.rhythm-item i { width: 20px; color: var(--primary); }

.plan-adjust { display: flex; flex-direction: column; gap: 12px; }
.plan-adjust .form-group { margin-bottom: 0; }
.plan-adjust select { width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--bg-dark); background: var(--bg-dark); color: var(--fg); font-size: 14px; }

.plan-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; background: var(--bg-dark); border-radius: var(--radius); font-size: 12px; color: var(--fg-light); margin-top: 8px; }
.plan-note i { color: var(--primary); margin-top: 2px; }

/* Logbook Grid View */
.logbook-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
}
.grid-day { 
    background: #F6F8FC; 
    border-radius: var(--radius); 
    padding: 6px 12px 12px; 
    cursor: pointer; 
    border: 1px solid var(--bg-dark);
    transition: transform 0.15s, border-color 0.15s;
}
.grid-day
.grid-day:active { transform: scale(0.98); }
.grid-day-today { 
    border: 2px solid var(--accent);
}
.grid-day-today .grid-day-num {
    color: var(--accent);
}
.grid-day-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: baseline; 
    margin-bottom: 6px; 
}
.grid-day-name { 
    font-size: 14px; 
    font-weight: 400; 
    color: var(--fg); 
}
.grid-day-num { 
    font-size: 24px; 
    font-weight: 700; 
    color: var(--fg); 
}
.grid-day-stats { display: flex; flex-direction: column; gap: 5px; }

.grid-stat-row { display: flex; flex-direction: column; gap: 1px; }
.grid-stat-row.feeding { color: #06B6D4; }
.grid-stat-row.sleep { color: #8B5CF6; }
.grid-stat-row.diapers { color: #F5B041; }

.grid-stat-main { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.grid-stat-main i { 
    font-size: 13px; 
}
.grid-stat-total { 
    font-size: 13px; 
    font-weight: 600; 
}
.grid-stat-breakdown { 
    font-size: 11px; 
    color: var(--fg-light); 
    font-weight: 400;
    line-height: 1.1em;
}
.grid-stat-breakdown .stat-item {
    white-space: nowrap;
    display: inline;
}
.grid-stat-breakdown strong {
    font-weight: 600;
}

/* Night mode grid adjustments */
body.night-mode .grid-day {
    background: var(--bg-dark);
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.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: var(--bg-dark); border-radius: 28px; transition: 0.3s; }
.toggle-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: var(--fg-light); border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); background-color: white; }

/* Form Row */
.form-row { display: flex; gap: 12px; }

/* Stacked Trends View */
.trends-header { padding: 8px 0; margin-bottom: 8px; }

/* Color circle metric toggles */
.trends-metric-toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.metric-toggle { display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg-light);
    cursor: pointer;
    box-shadow: var(--shadow-in-sm);
    transition: all 0.2s ease;
    opacity: 0.5;
}
.metric-toggle.active { opacity: 1; }
.metric-dot { display: block; width: 14px; height: 14px; border-radius: 50%; }
.metric-dot.feeding { background: #06B6D4; }
.metric-dot.sleep { background: #8B5CF6; }
.metric-dot.diapers { background: #F5B041; }
.metric-dot.pumping { background: #EC4899; }
.metric-dot.play { background: #00d28f; }
.metric-dot.bath { background: #3B82F6; }

.trends-stack { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; padding-bottom: 16px; }

.trend-day { background: var(--bg); border-radius: var(--radius); padding: 10px 12px; border: 1px solid var(--bg-dark); }

.trend-day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.trend-day-label { font-weight: 600; font-size: 13px; color: var(--fg); }
.trend-day-totals { display: flex; gap: 10px; font-size: 11px; }
.trend-total { display: flex; align-items: center; gap: 3px; color: var(--fg-light); font-weight: 500; }
.trend-total.feeding { color: #06B6D4; }
.trend-total.sleep { color: #8B5CF6; }
.trend-total.diapers { color: #F5B041; }
.trend-total.pumping { color: #EC4899; }
.trend-total.play { color: #00d28f; }
.trend-total.bath { color: #3B82F6; }

.trend-day-chart { position: relative; }
.trend-canvas { width: 100%; height: 60px; display: block; }
.trend-time-labels { display: flex; justify-content: space-between; padding: 0 5px; }
.trend-label { font-size: 9px; color: var(--fg-light); }

.loading-indicator { text-align: center; padding: 20px; color: var(--fg-light); }

/* Gantt button active state */
#logbook-gantt-btn.active { background: var(--primary); color: var(--bg); }

/* Sleep Merge Modal */
.merge-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: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.merge-modal.visible { opacity: 1; }

.merge-modal-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.merge-modal.visible .merge-modal-content {
    transform: translateY(0);
}

.merge-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.merge-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.merge-modal-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 16px;
}

.merge-modal-message strong {
    color: var(--fg);
    display: block;
    margin-top: 4px;
}

.merge-modal-suggestion {
    margin-bottom: 20px;
}

.merge-preview {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: inline-block;
}

.merge-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-light);
    margin-bottom: 4px;
}

.merge-preview-time {
    font-size: 16px;
    font-weight: 600;
    color: #8B5CF6;
}

.merge-modal-actions {
    display: flex;
    gap: 12px;
}

.merge-modal-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.merge-btn-extend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Sleep Warning Modal */
.sleep-warning-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: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.sleep-warning-modal.visible { opacity: 1; }

/* Split Sleep Modal */
.split-sleep-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: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}
.split-sleep-modal.visible { opacity: 1; }

.split-sleep-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}
.split-sleep-modal.visible .split-sleep-content {
    transform: translateY(0);
}

.split-sleep-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.split-sleep-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.split-sleep-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.split-sleep-timeline {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.timeline-icon.sleep {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
}

.timeline-icon.entry {
    background: rgba(6, 182, 212, 0.2);
    color: #06B6D4;
}

.timeline-text {
    font-size: 13px;
    color: var(--fg);
}

.timeline-text strong {
    color: var(--fg);
    font-weight: 600;
}

.timeline-connector {
    width: 2px;
    height: 16px;
    background: var(--fg-light);
    opacity: 0.3;
    margin: 4px 0 4px 15px;
}

.split-sleep-actions {
    display: flex;
    gap: 12px;
}

.split-sleep-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.split-btn-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sleep-warning-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.sleep-warning-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.sleep-warning-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 8px;
}

.sleep-warning-message {
    font-size: 14px;
    color: var(--fg-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.sleep-warning-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sleep-warning-actions .btn {
    flex: 1;
    max-width: 130px;
}

/* Sleep card with warning */
.metric-card.warning-shown {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: var(--shadow-out); }
    50% { box-shadow: var(--shadow-out), 0 0 0 3px rgba(245, 158, 11, 0.3); }
}

/* Split Sleep Option Groups */
.split-sleep-option-group {
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    text-align: left;
}

.split-option-label {
    font-size: 12px;
    color: var(--fg-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.split-option-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-option-value i {
    color: var(--accent);
}

.split-resume-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.split-resume-btn {
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.split-resume-btn:hover {
    border-color: var(--accent);
}

.split-resume-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.split-custom-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.split-custom-input input {
    width: 70px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
}

.split-custom-input span {
    color: var(--fg-light);
    font-size: 13px;
}

.split-sleep-preview {
    margin-bottom: 16px;
}

/* End Sleep Time Modal */
.end-sleep-time-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: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.end-sleep-time-modal.visible {
    opacity: 1;
}

.end-sleep-time-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.end-sleep-time-modal.visible .end-sleep-time-content {
    transform: translateY(0);
}

.end-sleep-time-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: white;
}

.end-sleep-time-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 16px;
}

.end-sleep-time-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    background: var(--bg);
    color: var(--fg);
    font-size: 16px;
    margin-bottom: 20px;
}

.end-sleep-time-actions {
    display: flex;
    gap: 12px;
}

.end-sleep-time-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

/* ============================================
   SLEEP CONFLICT RESOLUTION MODALS
   ============================================ */

/* Active sleep conflict modal */
.conflict-sleep-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-dark);
}

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

.conflict-sleep-date {
    font-weight: 600;
    color: var(--fg);
    font-size: 14px;
}

.conflict-sleep-time {
    color: var(--fg-light);
    font-size: 13px;
}

/* Reduced Motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .screen { opacity: 1 !important; transform: none !important; }
    .metric-card { opacity: 1 !important; transform: none !important; transition-delay: 0ms !important; }
    .bottom-sheet-content { animation: none !important; }
    #activity-glow.active { animation: none !important; opacity: 0.6 !important; }
}

/* ============================================ */
/* ROUTINE PAGE - Session 6                    */
/* ============================================ */

/* Schedule Label */
.routine-schedule-label {
    display: block;
    text-align: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Schedule Day Pills */
.routine-schedule-days {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.routine-day-pill {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--shadow-out);
    color: var(--fg-light);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.routine-day-pill.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-in-sm);
}

/* Loading State */
.routine-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--fg-light);
    gap: 16px;
}

.routine-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-dark);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Sleep Status Banner */
.routine-sleep-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-out);
}

.routine-sleep-banner-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.routine-sleep-banner-text {
    flex: 1;
}

.routine-sleep-banner-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.routine-sleep-banner-time {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}
.routine-sleep-banner-waking {
    background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px; padding: 6px 12px; font-size: 12px; font-weight: 600;
    white-space: nowrap; flex-shrink: 0;
}
.routine-sleep-banner-waking:active { background: rgba(255,255,255,0.3); }

/* Routine Section Cards */
.routine-section {
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-out);
    overflow: hidden;
}

/* Active routine - no special border, just uses .routine-now class for JS targeting */

.routine-section-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    gap: 10px;
    background: var(--bg);
    transition: background 0.15s ease;
}

.routine-section-header:active {
    background: var(--bg-dark);
}

.routine-section-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.routine-section-time {
    font-size: 13px;
    color: var(--fg-light);
}

.routine-section-chevron {
    color: var(--fg-light);
    font-size: 14px;
    transition: transform 0.3s ease;
}

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

.routine-section-body {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.routine-section.collapsed .routine-section-body {
    display: none;
}

/* Now/Next Badges */
.routine-now-badge {
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.routine-next-badge {
    background: var(--fg-light);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Routine Action Buttons */
.btn-routine-sleep {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border: none;
}

.btn-routine-sleep:active {
    opacity: 0.9;
}

.btn-routine-begin {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-routine-begin:active {
    opacity: 0.9;
}

/* Compact Activity Row (non-active routines) */
.routine-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

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

.routine-compact-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.routine-compact-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    flex: 1;
}

.routine-compact-stat {
    font-size: 12px;
    color: var(--fg-light);
    font-weight: 500;
    white-space: nowrap;
}

/* Active custom activity card (routine page) */
.routine-custom-active {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-out-sm);
    cursor: pointer;
    overflow: visible;
}
.routine-custom-active:active { transform: scale(0.98); }
.routine-custom-active-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.routine-custom-active-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}
.routine-custom-active-status {
    font-size: 12px;
    color: var(--fg-light);
}
.routine-custom-active-status.custom-logged {
    color: var(--accent);
    font-weight: 600;
}
.routine-custom-active-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Custom timer card — play/pause/stop actions */
.routine-custom-timer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.routine-custom-timer-stop {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #DC2626;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.routine-custom-active.timer-tracking {
    border-left: 3px solid var(--accent);
}
.routine-custom-active.timer-tracking .routine-custom-active-status {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--accent);
}
.custom-timer-note {
    display: block;
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    font-weight: 600;
}

/* Custom entry form — toggle switch */
.custom-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}
.custom-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.custom-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.custom-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-raised);
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.15);
    border-radius: 24px;
    transition: background 0.2s;
}
.custom-toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.custom-toggle input:checked + .custom-toggle-slider {
    background: var(--accent);
}
.custom-toggle input:checked + .custom-toggle-slider::before {
    transform: translateX(20px);
}

/* Custom entry form — checkbox group */
.custom-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--fg);
    cursor: pointer;
}
.custom-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Custom entry in logbook */
.summary-custom {
    color: var(--accent);
    font-weight: 500;
}
.entry-custom .entry-inner {
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

/* Compact custom activity — clickable */
.routine-compact[onclick] {
    cursor: pointer;
}
.routine-compact[onclick]:active {
    opacity: 0.7;
}

/* Metric cards in routine (active routine only) */
.routine-section .metric-card {
    margin-bottom: 0;
}

/* Night mode routine overrides */
body.night-mode .routine-section {
    background: var(--bg);
}

body.night-mode .routine-section-header {
    background: var(--bg);
}

body.night-mode .routine-section-header:active {
    background: var(--bg-dark);
}


/* ============================================ */
/* CUSTOMISE MODE - R5 Phase                   */
/* ============================================ */

/* Schedule Tabs (Weekday/Weekend) */
.customise-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.customise-tab {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.customise-tab.active {
    background: var(--accent);
    color: white;
}

/* Day Override Pills */
.customise-day-pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.customise-day-pill {
    width: 36px;
    height: 36px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--bg);
    color: var(--fg-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 0;
}

.customise-day-pill.override {
    border-color: var(--accent);
    color: var(--accent);
}

.customise-day-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Override Label Banner */
.customise-override-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
}

.customise-override-label .btn-sm {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
}

/* Routine Cards in Edit Mode */
.customise-routine {
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-out);
    overflow: visible;
}

.customise-routine-header {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 8px;
}
.customise-sleeping-block {
    background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(124,58,237,0.02) 100%);
    border-color: rgba(139,92,246,0.2);
}
.customise-sleeping-badge {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(139,92,246,0.15); color: #8B5CF6; font-size: 11px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Drag handles */
.customise-drag-handle {
    width: 28px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-light);
    cursor: grab;
    flex-shrink: 0;
    font-size: 14px;
    opacity: 0.6;
    touch-action: none;
}

.customise-drag-handle:active {
    cursor: grabbing;
    opacity: 1;
}

.activity-drag-handle {
    height: 32px;
    font-size: 12px;
}

/* Sortable animation classes */
.sortable-ghost {
    opacity: 0.3;
    background: var(--accent);
}

.sortable-chosen {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: scale(1.02);
    z-index: 10;
}

.sortable-drag {
    opacity: 1;
}

.customise-routine.sortable-chosen {
    border-radius: var(--radius);
}

.customise-activity-row.sortable-chosen {
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.customise-routine-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.customise-routine-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
}

.customise-routine-time {
    display: block;
    font-size: 12px;
    color: var(--fg-light);
    margin-top: 2px;
}

.customise-routine-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.customise-routine-action:active {
    background: var(--bg-dark);
}

.customise-routine-delete:active {
    color: #EC4899;
}

.customise-routine-body {
    padding: 0 12px 12px;
    border-top: 1px solid var(--bg-dark);
}

/* Activity rows in edit mode */
.customise-activity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-dark);
}

.customise-activity-row:last-of-type {
    border-bottom: none;
}

.customise-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customise-activity-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.customise-activity-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    min-width: 0;
}

.customise-activity-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    padding: 0;
    transition: color 0.15s ease;
}

.customise-activity-remove:active {
    color: #EC4899;
}

/* Add buttons */
.customise-add-activity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 2px dashed var(--bg-dark);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--fg-light);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.customise-add-activity:active {
    border-color: var(--accent);
    color: var(--accent);
}

/* Bottom actions */
.customise-bottom-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding-bottom: 20px;
}

.customise-add-routine {
    width: 100%;
    background: var(--accent);
    color: white;
}

.customise-action-btn {
    width: 100%;
    background: var(--bg);
    color: var(--fg);
}

/* Empty State */
.customise-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--fg-light);
}

/* Activity Picker Grid */
.activity-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 8px 0;
}

.activity-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    font-family: inherit;
}

.activity-picker-item:active {
    transform: scale(0.96);
}

.activity-picker-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.activity-picker-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.activity-picker-custom-icon {
    font-size: 24px;
}

.activity-picker-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg);
    text-align: center;
}

.activity-picker-check {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--accent);
    font-size: 12px;
}

/* Custom Activity List */
.custom-activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-activity-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.custom-activity-list-icon {
    font-size: 20px;
}

.custom-activity-list-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
}

/* Custom Activity Builder */
.custom-builder-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.custom-builder-icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--bg-dark);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.custom-builder-icon-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.custom-builder-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.custom-builder-field-type {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--bg-dark);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    font-family: inherit;
}

.custom-builder-field-label {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--bg-dark);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    font-family: inherit;
}

.custom-builder-field-options {
    width: 120px;
    padding: 8px;
    border: 1px solid var(--bg-dark);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    font-family: inherit;
}

/* Night mode customise overrides */
body.night-mode .customise-tab {
    background: var(--bg);
    color: var(--fg-light);
}

body.night-mode .customise-tab.active {
    background: var(--accent);
    color: white;
}

body.night-mode .customise-day-pill {
    background: var(--bg);
}

body.night-mode .customise-routine {
    background: var(--bg);
}

body.night-mode .customise-routine-body {
    border-top-color: var(--bg-dark);
}

body.night-mode .customise-activity-row {
    border-bottom-color: var(--bg-dark);
}

body.night-mode .customise-add-activity {
    border-color: var(--bg-dark);
}

body.night-mode .activity-picker-item {
    background: var(--bg);
}

body.night-mode .custom-activity-list-item {
    background: var(--bg);
}

body.night-mode .custom-builder-icon-btn {
    background: var(--bg);
}

/* ============================================ */
/* PHOTO UPLOADS — R8                          */
/* ============================================ */

/* Photo field in entry form */
.photo-upload-area {
    position: relative;
    border: 2px dashed var(--bg-dark);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.photo-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--fg-light);
    font-size: 13px;
    text-align: center;
}

.photo-upload-placeholder i {
    font-size: 24px;
    color: var(--accent);
}

.photo-preview-container {
    position: relative;
}

.photo-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
}

.photo-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    font-size: 14px;
}

/* Logbook photo thumbnail */
.entry-photo-thumb {
    cursor: pointer;
    padding: 4px !important;
}

.entry-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

/* Photo Lightbox */
/* ========== LIGHTBOX (Integrated Social View) ========== */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: background 300ms ease;
}

.photo-lightbox.active {
    background: var(--bg);
}
.photo-lightbox.closing {
    background: rgba(0, 0, 0, 0);
}
.photo-lightbox.closing .lightbox-scroll {
    transform: scale(0.92);
    opacity: 0;
    transition: transform var(--anim-exit) ease-in, opacity var(--anim-exit) ease-in;
}

/* Scrollable container */
.lightbox-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* Photo section — fills available space, covers with image */
.lightbox-photo-section {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.photo-lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 300ms ease, transform 300ms ease;
}

.photo-lightbox.active .photo-lightbox-img {
    opacity: 1;
    transform: scale(1);
}
video.photo-lightbox-img.lightbox-video { object-fit: contain; background: #000; max-height: 70vh; }

/* Top bar: close, counter, edit — over photo */
.lightbox-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.lightbox-counter {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
}

.lightbox-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: white;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    gap: 4px;
}

.lightbox-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Social section (below photo, always visible) */
.lightbox-social-section {
    background: var(--bg);
    flex-shrink: 0;
}

/* Action bar (heart, comment count, share, delete) */
.lightbox-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

.lightbox-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lightbox-action-btn {
    background: none;
    border: none;
    color: var(--fg-light);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 2px;
    -webkit-tap-highlight-color: transparent;
    transition: color 200ms ease, transform 200ms ease;
}

.lightbox-action-btn:active {
    transform: scale(0.9);
    transition-duration: 80ms;
}
.lightbox-action-btn,
.feed-card-heart,
.feed-card-comment-btn,
.feed-card-share,
.lightbox-btn { touch-action: manipulation; }

.lightbox-action-btn span {
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
}

.lightbox-comment-count-label {
    cursor: default;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lightbox-actions .lightbox-action-btn {
    font-size: 18px;
}

/* Heart animation */
.lightbox-heart-btn.hearted {
    color: #EC4899;
}

.lightbox-heart-btn.hearted i {
    animation: heartPop 500ms var(--ease-spring);
}

/* Heart burst overlay from double-tap */
.heart-burst {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    animation: heartBurstAnim 900ms var(--ease-spring) forwards;
}
.heart-burst svg { filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.5)); }
@keyframes heartBurstAnim {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.lightbox-delete-btn {
    color: var(--fg-light);
    opacity: 0.5;
    font-size: 15px;
}

/* Liked-by */
.lightbox-liked-by {
    padding: 0 16px 8px;
    font-size: 13px;
    color: var(--fg);
    line-height: 1.4;
}
.lightbox-liked-by i { color: #EC4899; margin-right: 4px; font-size: 12px; }
.lightbox-liked-by strong { color: var(--fg); font-weight: 600; }

/* Meta (author, date, time) */
.lightbox-meta {
    padding: 0 16px 10px;
    font-size: 13px;
    color: var(--fg-light);
    border-bottom: 1px solid var(--border);
}
.lightbox-caption { margin-top: 6px; font-size: 14px; color: var(--fg); line-height: 1.4; }

/* Comments list */
.lightbox-comments-list {
    padding: 0 16px;
}

.lightbox-comments-loading,
.lightbox-comments-empty {
    color: var(--fg-light);
    font-size: 13px;
    text-align: center;
    padding: 14px 0;
}

.lightbox-comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    transition: opacity var(--anim-normal) ease, transform var(--anim-normal) ease;
}
.lightbox-comment.entering {
    opacity: 0;
    transform: translateY(16px);
}

.lightbox-comment + .lightbox-comment {
    border-top: 1px solid var(--border);
}

.lightbox-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-comment-body {
    flex: 1;
    min-width: 0;
}

.lightbox-comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.lightbox-comment-name {
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
}

.lightbox-comment-time {
    color: var(--fg-light);
    font-size: 11px;
}

.lightbox-comment-text {
    color: var(--fg);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.lightbox-comment-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}

.lightbox-comment-heart {
    background: none;
    border: none;
    color: var(--fg-light);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-comment-heart span {
    font-size: 10px;
    min-height: 12px;
}

.lightbox-comment-heart.hearted {
    color: #EC4899;
}

.lightbox-comment-delete {
    background: none;
    border: none;
    color: var(--fg-light);
    opacity: 0.4;
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
    -webkit-tap-highlight-color: transparent;
}

/* Comment footer (reply link) */
.lightbox-comment-footer {
    margin-top: 4px;
}
.lightbox-comment-reply {
    background: none;
    border: none;
    color: var(--fg-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-comment-reply:active {
    color: var(--accent);
}

/* Nested replies */
.lightbox-replies {
    padding-left: 16px;
}

.lightbox-comment--reply .lightbox-comment-avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

/* Reply indicator */
.lightbox-reply-indicator {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--fg-light);
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-reply-indicator strong {
    color: var(--fg);
}

.lightbox-reply-cancel {
    background: none;
    border: none;
    color: var(--fg-light);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}

/* Comments input (sticky at bottom) */
.lightbox-comments-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.lightbox-comments-input input {
    flex: 1;
    background: var(--bg-dark);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--fg);
    font-size: 14px;
    outline: none;
}

.lightbox-comments-input input::placeholder {
    color: var(--fg-light);
}

.lightbox-comments-input .lightbox-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
    color: var(--fg-light);
}

/* Night mode adjustments */
body.night-mode .photo-upload-area {
    border-color: var(--bg-dark);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .photo-lightbox,
    .photo-lightbox-img,
    .photo-lightbox.closing .lightbox-scroll {
        transition: none;
    }
    .lightbox-heart-btn.hearted i,
    .heart-burst {
        animation: none;
    }
    .heart-burst { display: none; }
}

/* ============================================
   v7.33.0 — Solids transition: ring, chip, trend
   ============================================ */

/* Weekly trends card in the logbook — swipeable carousel with dots (v7.33.3). */
.food-trend-card {
    background: var(--bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    margin: 12px 0;
    box-shadow: var(--shadow-out);
    overflow: hidden;
}
.trends-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.trends-carousel::-webkit-scrollbar { display: none; }
.trends-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 14px 16px 10px;
    box-sizing: border-box;
}
.trends-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 4px 0 10px;
}
.trends-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-light);
    opacity: 0.4;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.trends-dot.active {
    opacity: 1;
    background: var(--accent);
    transform: scale(1.2);
}
.food-trend-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.food-trend-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.food-trend-note {
    font-size: 11px;
    color: var(--fg-light);
    line-height: 1.3;
    text-align: right;
    flex: 1;
}
.food-trend-spark {
    display: block;
    width: 100%;
    height: 60px;
    overflow: visible;
}
.food-trend-line {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.food-trend-line--milk { stroke: var(--color-feed, #06B6D4); }
.food-trend-line--solids { stroke: color-mix(in srgb, var(--color-feed, #06B6D4) 72%, #000 28%); }
.food-trend-line--sleep { stroke: var(--color-sleep, #8B5CF6); }
.food-trend-line--diapers-wet { stroke: var(--color-diapers, #F5B041); }
.food-trend-line--diapers-poo { stroke: color-mix(in srgb, var(--color-diapers, #F5B041) 70%, #000 30%); }
body.night-mode .food-trend-line--solids { stroke: color-mix(in srgb, var(--color-feed, #06B6D4) 80%, #fff 20%); }
body.night-mode .food-trend-line--diapers-poo { stroke: color-mix(in srgb, var(--color-diapers, #F5B041) 80%, #fff 20%); }
.food-trend-legend {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--fg-light);
    flex-wrap: wrap;
}
.food-trend-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.food-trend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.food-trend-swatch--milk { background: var(--color-feed, #06B6D4); }
.food-trend-swatch--solids { background: color-mix(in srgb, var(--color-feed, #06B6D4) 72%, #000 28%); }
.food-trend-swatch--sleep { background: var(--color-sleep, #8B5CF6); }
.food-trend-swatch--diapers-wet { background: var(--color-diapers, #F5B041); }
.food-trend-swatch--diapers-poo { background: color-mix(in srgb, var(--color-diapers, #F5B041) 70%, #000 30%); }
body.night-mode .food-trend-swatch--solids { background: color-mix(in srgb, var(--color-feed, #06B6D4) 80%, #fff 20%); }
body.night-mode .food-trend-swatch--diapers-poo { background: color-mix(in srgb, var(--color-diapers, #F5B041) 80%, #fff 20%); }

/* "Is my baby eating enough?" info link on Settings — clinical signals, not numbers */
.eating-enough-info {
    margin-top: 8px;
}
.eating-enough-info summary {
    list-style: none;
}
.eating-enough-info summary::-webkit-details-marker {
    display: none;
}
.eating-enough-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-feed, #06B6D4);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.eating-enough-link i {
    font-size: 12px;
}
.eating-enough-body {
    margin-top: 8px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--color-feed, #06B6D4) 8%, transparent);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg);
}
.eating-enough-body p {
    margin: 0 0 8px;
}
.eating-enough-body ul {
    margin: 0 0 8px;
    padding-left: 18px;
}
.eating-enough-body li {
    margin-bottom: 4px;
}
.eating-enough-cite {
    font-size: 11px;
    color: var(--fg-light);
    margin: 6px 0 0 !important;
}
