/* ==========================================================================
   Bloom — Fertility & Cycle Tracker
   Apple-inspired design system with micro-animations
   Privacy-first. Beautifully crafted.
   ========================================================================== */

/* Fonts loaded via <link> in HTML head for performance */

/* ==================== Design Tokens ==================== */
:root {
    /* Core palette — warm rose */
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-200: #fecdd3;
    --rose-300: #fda4af;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --rose-700: #be123c;

    /* Warm neutrals */
    --neutral-0: #ffffff;
    --neutral-50: #fafaf9;
    --neutral-100: #f5f3f1;
    --neutral-150: #edebe8;
    --neutral-200: #e7e0dc;
    --neutral-300: #d4cac4;
    --neutral-400: #a8998f;
    --neutral-500: #857468;
    --neutral-600: #6b5b50;
    --neutral-700: #4a3f38;
    --neutral-800: #332c27;
    --neutral-900: #1c1917;

    /* Accent colors */
    --lavender-50: #f5f3ff;
    --lavender-100: #ede9fe;
    --lavender-200: #ddd6fe;
    --lavender-400: #a78bfa;
    --lavender-500: #8b5cf6;

    --sage-50: #f0fdf4;
    --sage-100: #dcfce7;
    --sage-200: #bbf7d0;
    --sage-400: #4ade80;
    --sage-500: #22c55e;
    --sage-600: #16a34a;
    --sage-700: #15803d;

    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;

    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-400: #38bdf8;

    /* Phase system */
    --phase-menstrual: #fb7185;
    --phase-menstrual-bg: #fff1f2;
    --phase-menstrual-ring: #f43f5e;
    --phase-follicular: #a78bfa;
    --phase-follicular-bg: #f5f3ff;
    --phase-fertile: #4ade80;
    --phase-fertile-bg: #f0fdf4;
    --phase-fertile-ring: #22c55e;
    --phase-luteal: #fbbf24;
    --phase-luteal-bg: #fffbeb;
    --phase-ovulation: #22c55e;

    /* Fertility */
    --fertility-low: var(--neutral-300);
    --fertility-medium: var(--amber-400);
    --fertility-high: var(--sage-400);
    --fertility-peak: var(--sage-500);

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.07), 0 8px 10px -6px rgba(0,0,0,0.03);
    --shadow-glow-rose: 0 0 20px rgba(244,63,94,0.15);
    --shadow-glow-sage: 0 0 20px rgba(34,197,94,0.15);

    /* Radius */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-2xl: 36px;
    --r-full: 9999px;

    /* Motion — Apple-style spring curves */
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;

    /* Layout */
    --sidebar-width: 260px;
    --content-max: 640px;
    --desktop-max: 1200px;
    --nav-height: 64px;
    --bottom-nav-height: 72px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: var(--neutral-50);
    color: var(--neutral-700);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--neutral-900);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    color: var(--neutral-800);
    line-height: 1.3;
}

a {
    color: var(--rose-500);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover { color: var(--rose-600); }

::selection {
    background: var(--rose-100);
    color: var(--rose-700);
}

/* ==================== Responsive Layout Shell ==================== */

/* --- Mobile (default) --- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-sidebar {
    display: none;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0 20px;
    padding-top: env(safe-area-inset-top, 0);
    height: calc(var(--nav-height) + env(safe-area-inset-top, 0));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-main {
    flex: 1;
    padding: 20px 16px;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

.app-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-spacer {
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0) + 8px);
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
    .app-shell {
        flex-direction: row;
    }

    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-width);
        height: 100vh;
        height: 100dvh;
        position: fixed;
        left: 0;
        top: 0;
        background: linear-gradient(180deg, var(--neutral-0) 0%, var(--rose-50) 100%);
        border-right: 1px solid rgba(0,0,0,0.04);
        padding: 32px 20px 24px;
        z-index: 50;
    }

    .app-topbar {
        display: none;
    }

    .app-main {
        margin-left: var(--sidebar-width);
        padding: 40px 48px;
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .app-main-inner {
        max-width: 720px;
        width: 100%;
    }

    .app-bottomnav {
        display: none;
    }

    .bottom-spacer {
        display: none;
    }

    /* Desktop: 2-column dashboard */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .dashboard-grid .hero-section {
        grid-column: 1 / -1;
    }

    .dashboard-grid .calendar-section {
        grid-column: 1 / -1;
    }
}

/* --- Tablet (768-1023px) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    .app-main {
        padding: 24px 32px;
        max-width: 720px;
    }
}

/* ==================== Logo ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 2px 8px rgba(244,63,94,0.25);
    transition: transform var(--duration-normal) var(--ease-spring);
}

.logo:hover .logo-icon {
    transform: scale(1.08) rotate(-4deg);
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--neutral-900);
    letter-spacing: -0.02em;
}

/* ==================== Sidebar Navigation ==================== */
.sidebar-nav {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    color: var(--neutral-500);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--duration-normal) var(--ease-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--rose-50);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
    border-radius: var(--r-md);
}

.sidebar-link:hover {
    color: var(--rose-600);
}

.sidebar-link:hover::before {
    opacity: 1;
}

.sidebar-link.active {
    color: var(--rose-600);
    font-weight: 600;
}

.sidebar-link.active::before {
    opacity: 1;
    background: var(--rose-50);
}

.sidebar-link svg,
.sidebar-link span {
    position: relative;
    z-index: 1;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--neutral-150);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--rose-200), var(--lavender-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--rose-600);
}

.sidebar-username {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--neutral-700);
}

.sidebar-email {
    font-size: 0.7rem;
    color: var(--neutral-400);
}

/* ==================== Bottom Navigation ==================== */
.bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    min-height: 48px;
    min-width: 48px;
    color: var(--neutral-400);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottomnav-item svg {
    width: 24px;
    height: 24px;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.bottomnav-item.active {
    color: var(--rose-500);
}

.bottomnav-item.active svg {
    transform: scale(1.1);
}

.bottomnav-item:active svg {
    transform: scale(0.88);
}

/* Active indicator dot */
.bottomnav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rose-500);
    animation: dotAppear 0.4s var(--ease-spring);
}

@keyframes dotAppear {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ==================== Cards ==================== */
.card {
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow var(--duration-normal) var(--ease-smooth),
                transform var(--duration-normal) var(--ease-smooth);
    animation: cardEnter 0.5s var(--ease-out) backwards;
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.card + .card {
    margin-top: 16px;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neutral-400);
    margin-bottom: 12px;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.24s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.36s; }

/* ==================== Cycle Ring (Hero) ==================== */
.cycle-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0 24px;
    animation: heroEnter 0.7s var(--ease-out);
}

@keyframes heroEnter {
    from { opacity: 0; transform: scale(0.94); }
}

.cycle-ring-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
}

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

.cycle-ring-bg {
    fill: none;
    stroke: var(--neutral-150);
    stroke-width: 8;
}

.cycle-ring-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px var(--ring-glow, rgba(244,63,94,0.3)));
    animation: ringDraw 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes ringDraw {
    from { stroke-dashoffset: var(--ring-circumference, 553); }
    to { stroke-dashoffset: var(--ring-progress); }
}

.cycle-ring-progress.menstrual { stroke: var(--phase-menstrual-ring); --ring-glow: rgba(244,63,94,0.3); }
.cycle-ring-progress.follicular { stroke: var(--phase-follicular); --ring-glow: rgba(167,139,250,0.3); }
.cycle-ring-progress.fertile { stroke: var(--phase-fertile-ring); --ring-glow: rgba(34,197,94,0.3); }
.cycle-ring-progress.luteal { stroke: var(--phase-luteal); --ring-glow: rgba(251,191,36,0.3); }

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

.cycle-ring-day {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--neutral-900);
    animation: countUp 0.6s var(--ease-out);
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
}

.cycle-ring-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-400);
    margin-top: 2px;
}

.phase-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    animation: pillEnter 0.5s var(--ease-spring) 0.3s backwards;
}

@keyframes pillEnter {
    from { opacity: 0; transform: scale(0.85) translateY(8px); }
}

.phase-pill.menstrual { background: var(--phase-menstrual-bg); color: var(--rose-600); }
.phase-pill.follicular { background: var(--phase-follicular-bg); color: var(--lavender-500); }
.phase-pill.fertile { background: var(--phase-fertile-bg); color: var(--sage-700); }
.phase-pill.luteal { background: var(--phase-luteal-bg); color: var(--amber-500); }
.phase-pill.unknown { background: var(--neutral-100); color: var(--neutral-500); }

/* ==================== Fertility Meter ==================== */
.fertility-meter {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    border: 1px solid var(--neutral-150);
    box-shadow: var(--shadow-xs);
    animation: cardEnter 0.5s var(--ease-out) 0.15s backwards;
}

.fertility-track {
    flex: 1;
    height: 6px;
    background: var(--neutral-150);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.fertility-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s var(--ease-out), background 0.5s var(--ease-smooth);
    position: relative;
}

.fertility-fill.low { width: 15%; background: var(--neutral-300); }
.fertility-fill.medium { width: 45%; background: linear-gradient(90deg, var(--amber-400), var(--amber-500)); }
.fertility-fill.high { width: 75%; background: linear-gradient(90deg, var(--sage-400), var(--sage-500)); }
.fertility-fill.peak { width: 100%; background: linear-gradient(90deg, var(--sage-400), var(--sage-600)); }

.fertility-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s ease-in-out infinite;
}

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

.fertility-text {
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 80px;
    text-align: right;
}

.fertility-text.low { color: var(--neutral-400); }
.fertility-text.medium { color: var(--amber-500); }
.fertility-text.high { color: var(--sage-600); }
.fertility-text.peak { color: var(--sage-700); }

/* ==================== TTC Banner ==================== */
.ttc-banner {
    position: relative;
    padding: 20px 24px;
    border-radius: var(--r-xl);
    overflow: hidden;
    animation: cardEnter 0.5s var(--ease-out) 0.2s backwards;
}

.ttc-banner.peak,
.ttc-banner.high {
    background: linear-gradient(135deg, var(--sage-50), var(--sage-100));
    border: 1px solid var(--sage-200);
}

.ttc-banner.medium {
    background: linear-gradient(135deg, var(--amber-50), var(--amber-100));
    border: 1px solid var(--amber-100);
}

.ttc-banner.low {
    background: linear-gradient(135deg, var(--neutral-50), var(--neutral-100));
    border: 1px solid var(--neutral-200);
}

.ttc-banner::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.15;
}

.ttc-banner.peak::before,
.ttc-banner.high::before { background: var(--sage-400); }

.ttc-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ttc-banner.peak .ttc-title,
.ttc-banner.high .ttc-title { color: var(--sage-700); }
.ttc-banner.medium .ttc-title { color: var(--amber-500); }
.ttc-banner.low .ttc-title { color: var(--neutral-600); }

.ttc-desc {
    font-size: 0.8rem;
    line-height: 1.5;
}

.ttc-banner.peak .ttc-desc,
.ttc-banner.high .ttc-desc { color: var(--sage-600); }
.ttc-banner.medium .ttc-desc { color: var(--amber-500); }
.ttc-banner.low .ttc-desc { color: var(--neutral-500); }

/* ==================== Quick Actions ==================== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    animation: cardEnter 0.5s var(--ease-out) 0.2s backwards;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--neutral-0);
    border: 1px solid var(--neutral-150);
    border-radius: var(--r-xl);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    text-decoration: none;
    color: var(--neutral-600);
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
    font-size: inherit;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--rose-200);
    color: var(--rose-600);
}

.quick-action:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.quick-action:hover .quick-action-icon {
    transform: scale(1.1);
}

.quick-action-icon.rose { background: var(--rose-50); }
.quick-action-icon.sage { background: var(--sage-50); }
.quick-action-icon.lavender { background: var(--lavender-50); }
.quick-action-icon.amber { background: var(--amber-50); }

.quick-action-label {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==================== Predictions ==================== */
.predictions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.prediction-card {
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    padding: 20px;
    border: 1px solid var(--neutral-150);
    box-shadow: var(--shadow-xs);
    animation: cardEnter 0.5s var(--ease-out) backwards;
}

.prediction-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neutral-400);
    margin-bottom: 6px;
}

.prediction-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.prediction-sub {
    font-size: 0.72rem;
    color: var(--neutral-400);
    margin-top: 3px;
}

/* ==================== Calendar ==================== */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month-label {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--neutral-900);
}

.calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--neutral-100);
    border-radius: var(--r-full);
    cursor: pointer;
    color: var(--neutral-500);
    transition: all var(--duration-fast) var(--ease-smooth);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.calendar-nav-btn:hover {
    background: var(--rose-50);
    color: var(--rose-500);
}

.calendar-nav-btn:active {
    transform: scale(0.92);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--neutral-400);
    padding: 6px 0;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-spring);
    text-decoration: none;
    color: var(--neutral-600);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.calendar-day:active {
    transform: scale(0.95);
}

.calendar-day.today {
    font-weight: 800;
    color: var(--rose-600);
    box-shadow: inset 0 0 0 2px var(--rose-400);
}

.calendar-day.menstrual {
    background: var(--phase-menstrual);
    color: var(--neutral-0);
    font-weight: 600;
}

.calendar-day.follicular {
    background: var(--phase-follicular-bg);
    color: var(--lavender-500);
}

.calendar-day.fertile {
    background: var(--phase-fertile);
    color: var(--neutral-0);
    font-weight: 600;
}

.calendar-day.luteal {
    background: var(--phase-luteal-bg);
    color: var(--amber-500);
}

.calendar-day.has-log::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rose-400);
}

.calendar-day.menstrual.has-log::after,
.calendar-day.fertile.has-log::after {
    background: rgba(255,255,255,0.7);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-100);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--neutral-400);
}

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

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--r-full);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
    pointer-events: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: var(--neutral-0);
    box-shadow: 0 4px 14px rgba(244,63,94,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244,63,94,0.4);
    color: var(--neutral-0);
}

.btn-secondary {
    background: var(--neutral-0);
    color: var(--neutral-700);
    border: 1.5px solid var(--neutral-200);
}

.btn-secondary:hover {
    border-color: var(--rose-300);
    color: var(--rose-600);
    background: var(--rose-50);
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-500);
    padding: 10px 16px;
}

.btn-ghost:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 10px 20px; font-size: 0.8rem; }

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--neutral-700);
    margin-bottom: 8px;
}

.form-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--neutral-400);
    margin-top: 6px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--r-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--neutral-800);
    background: var(--neutral-0);
    transition: all var(--duration-normal) var(--ease-smooth);
    outline: none;
}

.form-input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 4px rgba(244,63,94,0.08);
}

.form-input::placeholder {
    color: var(--neutral-300);
}

textarea.form-input {
    resize: vertical;
    min-height: 88px;
    line-height: 1.6;
}

/* ==================== Pill Selectors (the star of the show) ==================== */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-option {
    position: relative;
}

.pill-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

fieldset.log-section {
    border: none;
    padding: 0;
    margin: 0;
}

.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    min-height: 44px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--r-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--neutral-500);
    background: var(--neutral-0);
    transition: all var(--duration-normal) var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.pill-label:hover {
    border-color: var(--rose-200);
    color: var(--rose-500);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pill-label:active {
    transform: scale(0.96);
}

.pill-option input:checked + .pill-label {
    background: var(--rose-50);
    border-color: var(--rose-400);
    color: var(--rose-600);
    font-weight: 600;
    box-shadow: var(--shadow-glow-rose);
    animation: pillSelect 0.4s var(--ease-spring);
}

@keyframes pillSelect {
    0% { transform: scale(1); }
    40% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Flow-specific checked states */
.pill-option input:checked + .pill-label.flow-spotting {
    background: var(--amber-50); border-color: var(--amber-400); color: var(--amber-500);
    box-shadow: 0 0 12px rgba(245,158,11,0.15);
}
.pill-option input:checked + .pill-label.flow-light {
    background: var(--rose-50); border-color: var(--rose-300); color: var(--rose-500);
}
.pill-option input:checked + .pill-label.flow-medium {
    background: var(--rose-100); border-color: var(--rose-400); color: var(--rose-600);
}
.pill-option input:checked + .pill-label.flow-heavy {
    background: var(--rose-200); border-color: var(--rose-500); color: var(--rose-700);
    box-shadow: 0 0 12px rgba(244,63,94,0.2);
}

/* CM-specific checked states */
.pill-option input:checked + .pill-label.cm-dry {
    background: var(--neutral-100); border-color: var(--neutral-300); color: var(--neutral-600);
    box-shadow: none;
}
.pill-option input:checked + .pill-label.cm-sticky {
    background: var(--amber-50); border-color: var(--amber-400); color: var(--amber-500);
    box-shadow: 0 0 12px rgba(245,158,11,0.1);
}
.pill-option input:checked + .pill-label.cm-creamy {
    background: #fff7ed; border-color: #fb923c; color: #c2410c;
    box-shadow: 0 0 12px rgba(251,146,60,0.12);
}
.pill-option input:checked + .pill-label.cm-watery {
    background: var(--sky-50); border-color: var(--sky-400); color: #0369a1;
    box-shadow: 0 0 12px rgba(56,189,248,0.12);
}
.pill-option input:checked + .pill-label.cm-egg-white {
    background: var(--sage-50); border-color: var(--sage-400); color: var(--sage-700);
    box-shadow: var(--shadow-glow-sage);
}

/* ==================== Log Sections ==================== */
.log-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--neutral-100);
    animation: cardEnter 0.5s var(--ease-out) backwards;
}

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

.log-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neutral-600);
    margin-bottom: 14px;
}

.log-section-icon {
    font-size: 1rem;
}

/* ==================== BBT Input ==================== */
.bbt-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bbt-input {
    width: 120px;
    padding: 14px 18px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--r-md);
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neutral-800);
    text-align: center;
    outline: none;
    transition: all var(--duration-normal) var(--ease-smooth);
    background: var(--neutral-0);
}

.bbt-input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 4px rgba(244,63,94,0.08);
}

.bbt-unit {
    font-size: 0.85rem;
    color: var(--neutral-400);
    font-weight: 500;
}

/* ==================== Stats / Insights ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    border-radius: var(--r-md);
    transition: background var(--duration-normal) var(--ease-smooth);
}

.stat-item:hover {
    background: var(--neutral-50);
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rose-500);
    line-height: 1;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--neutral-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}

/* Range bar */
.range-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
}

.range-end {
    text-align: center;
    min-width: 40px;
}

.range-end-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--neutral-700);
}

.range-end-label {
    font-size: 0.6rem;
    color: var(--neutral-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.range-track {
    flex: 1;
    height: 6px;
    background: var(--neutral-150);
    border-radius: 3px;
    overflow: hidden;
}

.range-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rose-300), var(--rose-500));
    border-radius: 3px;
    transition: width 1s var(--ease-out);
}

/* ==================== Cycle History ==================== */
.cycle-list {
    list-style: none;
}

.cycle-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-100);
    transition: background var(--duration-fast) var(--ease-smooth);
}

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

.cycle-item:hover {
    background: var(--neutral-50);
    margin: 0 -24px;
    padding: 16px 24px;
    border-radius: var(--r-md);
}

.cycle-dot {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    background: var(--rose-50);
    color: var(--rose-600);
    flex-shrink: 0;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.cycle-item:hover .cycle-dot {
    transform: scale(1.08);
}

.cycle-info { flex: 1; }

.cycle-dates {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--neutral-800);
}

.cycle-meta {
    font-size: 0.78rem;
    color: var(--neutral-400);
    margin-top: 2px;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: alertSlide 0.4s var(--ease-spring);
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-12px); }
}

.alert-success {
    background: var(--sage-50);
    color: var(--sage-700);
    border: 1px solid var(--sage-200);
}

.alert-error {
    background: var(--rose-50);
    color: var(--rose-700);
    border: 1px solid var(--rose-200);
}

.alert-warning {
    background: var(--amber-50);
    color: var(--amber-500);
    border: 1px solid var(--amber-100);
}

/* ==================== Modal / Bottom Sheet ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: overlayFade 0.3s var(--ease-smooth);
}

@keyframes overlayFade {
    from { opacity: 0; }
}

.modal-sheet {
    background: var(--neutral-0);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: 8px 24px calc(32px + env(safe-area-inset-bottom, 0));
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: sheetSlide 0.4s var(--ease-spring);
}

@keyframes sheetSlide {
    from { transform: translateY(100%); }
}

@media (min-width: 1024px) {
    .modal-overlay {
        align-items: center;
    }

    .modal-sheet {
        border-radius: var(--r-2xl);
        max-width: 440px;
        max-height: 70vh;
        animation: modalScale 0.3s var(--ease-spring);
    }

    @keyframes modalScale {
        from { opacity: 0; transform: scale(0.95); }
    }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    margin: 8px auto 20px;
}

@media (min-width: 1024px) {
    .modal-handle { display: none; }
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 24px;
}

/* ==================== Onboarding Wizard ==================== */
.onboard-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(170deg, var(--neutral-0) 0%, var(--rose-50) 40%, var(--lavender-50) 100%);
}

.onboard-card {
    background: var(--neutral-0);
    border-radius: var(--r-2xl);
    padding: 44px 36px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: onboardEnter 0.6s var(--ease-out);
}

@keyframes onboardEnter {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
}

.onboard-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral-200);
    transition: all var(--duration-normal) var(--ease-spring);
}

.step-dot.active {
    background: var(--rose-500);
    width: 24px;
    border-radius: 4px;
}

.step-dot.done {
    background: var(--rose-300);
}

.onboard-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.onboard-title {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.onboard-subtitle {
    text-align: center;
    color: var(--neutral-400);
    font-size: 0.9rem;
    margin-bottom: 36px;
    line-height: 1.5;
}

/* Step transitions */
.step-content {
    animation: stepFade 0.4s var(--ease-out);
}

@keyframes stepFade {
    from { opacity: 0; transform: translateX(20px); }
}

/* ==================== Auth Pages ==================== */
.auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(170deg, var(--neutral-0) 0%, var(--rose-50) 50%, var(--lavender-50) 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,63,94,0.05) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: orbFloat 8s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 15px); }
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,0.04) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: orbFloat 10s ease-in-out infinite reverse;
}

.auth-card {
    background: var(--neutral-0);
    border-radius: var(--r-2xl);
    padding: 44px 36px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: onboardEnter 0.6s var(--ease-out);
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
    border-radius: var(--r-lg);
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(244,63,94,0.3);
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 1.6rem;
    color: var(--neutral-900);
}

.auth-logo p {
    color: var(--neutral-400);
    font-size: 0.88rem;
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.85rem;
    color: var(--neutral-400);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-150);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--neutral-400);
    font-weight: 500;
}

/* ==================== Landing Page ==================== */
.landing {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(170deg, var(--neutral-0) 0%, var(--rose-50) 40%, var(--lavender-50) 100%);
    position: relative;
    overflow: hidden;
}

.landing-orb-1,
.landing-orb-2,
.landing-orb-3 {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.landing-orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(244,63,94,0.06) 0%, transparent 70%);
    top: -200px; right: -200px;
    animation: orbFloat 12s ease-in-out infinite;
}

.landing-orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    animation: orbFloat 15s ease-in-out infinite reverse;
}

.landing-orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(251,113,133,0.04) 0%, transparent 70%);
    top: 40%; left: 30%;
    animation: orbFloat 10s ease-in-out infinite 2s;
}

.landing-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Mobile landing */
.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    text-align: center;
    padding: 60px 0 40px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--neutral-150);
    border-radius: var(--r-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--neutral-500);
    margin-bottom: 24px;
    animation: cardEnter 0.5s var(--ease-out);
}

.landing-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--sage-400);
    animation: pulse 2s ease-in-out infinite;
}

.landing-title {
    font-size: 2.5rem;
    max-width: 500px;
    margin-bottom: 16px;
    animation: heroEnter 0.7s var(--ease-out) 0.1s backwards;
}

.landing-title em {
    font-style: italic;
    color: var(--rose-500);
}

.landing-subtitle {
    font-size: 1.05rem;
    color: var(--neutral-500);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 40px;
    animation: heroEnter 0.7s var(--ease-out) 0.2s backwards;
}

.landing-hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    animation: heroEnter 0.7s var(--ease-out) 0.3s backwards;
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 48px;
    animation: heroEnter 0.7s var(--ease-out) 0.25s backwards;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--r-lg);
    font-size: 0.88rem;
    color: var(--neutral-600);
    text-align: left;
    transition: all var(--duration-normal) var(--ease-spring);
}

.landing-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: rgba(255,255,255,0.85);
}

.landing-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.landing-feature-icon.rose { background: var(--rose-50); }
.landing-feature-icon.sage { background: var(--sage-50); }
.landing-feature-icon.lavender { background: var(--lavender-50); }
.landing-feature-icon.amber { background: var(--amber-50); }

.landing-feature strong {
    color: var(--neutral-700);
}

.landing-privacy {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--neutral-400);
    animation: heroEnter 0.7s var(--ease-out) 0.4s backwards;
}

.landing-privacy svg {
    width: 16px;
    height: 16px;
    color: var(--sage-500);
}

/* Desktop landing: side-by-side */
@media (min-width: 1024px) {
    .landing-hero {
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 80px;
        padding: 0;
    }

    .landing-hero-text {
        flex: 1;
        align-items: flex-start;
    }

    .landing-hero-visual {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .landing-title {
        font-size: 3.5rem;
        max-width: 600px;
    }

    .landing-actions {
        flex-direction: row;
        max-width: 400px;
    }

    .landing-features {
        max-width: 500px;
    }
}

.landing-phone-mockup {
    display: none;
}

@media (min-width: 1024px) {
    .landing-phone-mockup {
        display: block;
        width: 280px;
        height: 560px;
        background: var(--neutral-900);
        border-radius: 40px;
        padding: 12px;
        box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,0.08);
        animation: phoneFloat 6s ease-in-out infinite;
    }

    @keyframes phoneFloat {
        0%, 100% { transform: translateY(0) rotate(0deg); }
        50% { transform: translateY(-10px) rotate(1deg); }
    }

    .phone-screen {
        width: 100%;
        height: 100%;
        background: var(--neutral-0);
        border-radius: 30px;
        overflow: hidden;
        padding: 24px 16px;
    }

    .phone-demo-ring {
        width: 120px;
        height: 120px;
        margin: 20px auto;
        border: 6px solid var(--neutral-150);
        border-top-color: var(--rose-400);
        border-right-color: var(--rose-400);
        border-bottom-color: var(--rose-400);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: ringGrow 2s var(--ease-out) infinite;
    }

    @keyframes ringGrow {
        0% { border-top-color: var(--neutral-150); border-right-color: var(--neutral-150); border-bottom-color: var(--neutral-150); }
        33% { border-top-color: var(--rose-400); }
        66% { border-right-color: var(--rose-400); }
        100% { border-bottom-color: var(--rose-400); }
    }

    .phone-demo-day {
        font-family: 'Playfair Display', serif;
        font-size: 2rem;
        font-weight: 700;
        color: var(--neutral-900);
    }

    .phone-demo-bars {
        margin-top: 24px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .phone-demo-bar {
        height: 8px;
        border-radius: 4px;
        animation: barGrow 1.5s var(--ease-out) backwards;
    }

    .phone-demo-bar:nth-child(1) { background: var(--rose-200); width: 80%; animation-delay: 0.5s; }
    .phone-demo-bar:nth-child(2) { background: var(--lavender-200); width: 60%; animation-delay: 0.7s; }
    .phone-demo-bar:nth-child(3) { background: var(--sage-200); width: 90%; animation-delay: 0.9s; }

    @keyframes barGrow {
        from { width: 0; }
    }
}

/* ==================== Settings ==================== */
.settings-group {
    margin-bottom: 8px;
}

/* ==================== Insight Components ==================== */
.insight-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.insight-hero-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-hero-body {
    flex: 1;
}

.insight-hero-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--neutral-800);
    margin-bottom: 4px;
}

.insight-hero-text {
    font-size: 0.85rem;
    color: var(--neutral-500);
    line-height: 1.6;
}

.insight-tip {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    color: var(--neutral-600);
}

.dpo-counter {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dpo-badge {
    width: 72px;
    height: 72px;
    border-radius: var(--r-full);
    background: var(--sage-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dpo-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--sage-700);
}

.dpo-text {
    font-size: 0.85rem;
    color: var(--neutral-600);
    line-height: 1.6;
}

.dpo-test-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--sage-100);
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sage-700);
    margin-top: 8px;
}

.streak-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.streak-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.streak-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.streak-icon.active { background: var(--rose-50); }
.streak-icon.inactive { background: var(--neutral-100); }

.streak-title { font-weight: 700; font-size: 0.9rem; }
.streak-sub { font-size: 0.75rem; color: var(--neutral-400); }

.streak-count {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
}

.streak-count.active { color: var(--rose-500); }
.streak-count.inactive { color: var(--neutral-300); }

.event-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
}

.event-row + .event-row {
    border-top: 1px solid var(--neutral-100);
}

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

.event-label { font-weight: 600; font-size: 0.85rem; }
.event-date { font-size: 0.75rem; color: var(--neutral-400); }

.event-days {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-left: auto;
}

.phase-edu-hormones {
    font-size: 0.78rem;
    color: var(--neutral-500);
    margin-bottom: 12px;
}

.phase-edu-duration {
    font-size: 0.78rem;
    color: var(--neutral-400);
    margin-bottom: 12px;
}

.phase-edu-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.phase-edu-tag {
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 140px;
    padding-top: 8px;
}

.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neutral-700);
    margin-bottom: 4px;
}

.chart-bar-track {
    width: 100%;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    position: relative;
}

.chart-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.chart-bar-fill.cycle { background: var(--rose-100); }
.chart-bar-fill.period { background: var(--rose-400); }

.chart-bar-label {
    font-size: 0.65rem;
    color: var(--neutral-400);
    margin-top: 6px;
    font-weight: 600;
}

.mood-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding: 8px 0;
}

.mood-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.mood-emoji { font-size: 0.9rem; margin-bottom: 4px; }

.mood-bar {
    width: 100%;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    min-height: 4px;
}

.mood-bar.positive { background: var(--rose-100); }
.mood-bar.neutral { background: var(--rose-50); }
.mood-bar.negative { background: var(--rose-200); }

.mood-day { font-size: 0.55rem; color: var(--neutral-300); margin-top: 3px; }

.pattern-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-md);
}

.pattern-row + .pattern-row { margin-top: 10px; }

.pattern-row.high { background: var(--rose-50); }
.pattern-row.medium { background: var(--amber-50); }
.pattern-row.info { background: var(--neutral-50); }

.pattern-icon { font-size: 1.1rem; flex-shrink: 0; }
.pattern-title { font-weight: 700; font-size: 0.82rem; color: var(--neutral-800); }
.pattern-desc { font-size: 0.75rem; color: var(--neutral-500); line-height: 1.5; margin-top: 2px; }

.disclaimer {
    padding: 16px;
    background: var(--neutral-100);
    border-radius: var(--r-md);
    font-size: 0.72rem;
    color: var(--neutral-400);
    line-height: 1.6;
    margin-top: 16px;
}

.prediction-unit {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--neutral-400);
}

.phase-edu-card {
    padding: 16px 20px;
    border-radius: var(--r-xl);
    border: 1px solid var(--neutral-150);
}

.phase-edu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.phase-edu-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--neutral-700);
}

.phase-edu-link {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--neutral-400);
}

.phase-edu-body {
    font-size: 0.8rem;
    color: var(--neutral-500);
    line-height: 1.5;
}

/* Disabled form inputs */
.form-input:disabled {
    background: var(--neutral-100);
    color: var(--neutral-400);
    cursor: not-allowed;
    opacity: 1;
    border-color: var(--neutral-150);
}

/* Calendar legend dot variants */
.legend-dot.menstrual { background: var(--phase-menstrual); }
.legend-dot.fertile { background: var(--phase-fertile); }
.legend-dot.follicular { background: var(--phase-follicular); }
.legend-dot.luteal { background: var(--phase-luteal); border: 1px solid var(--amber-400); }

/* ==================== Settings ==================== */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--neutral-100);
    text-decoration: none;
    color: var(--neutral-700);
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.settings-row:last-child { border-bottom: none; }
.settings-row:hover {
    background: var(--neutral-50);
    margin: 0 -24px;
    padding: 14px 24px;
    border-radius: var(--r-md);
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-row-icon {
    font-size: 1.1rem;
}

.settings-row-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-row-sub {
    font-size: 0.75rem;
    color: var(--neutral-400);
}

.settings-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neutral-400);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ==================== Date Navigator ==================== */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.date-nav-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.date-nav-today {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rose-500);
    background: var(--rose-50);
    padding: 4px 10px;
    border-radius: var(--r-full);
}

/* ==================== Empty States ==================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    animation: cardEnter 0.5s var(--ease-out);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.empty-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-text {
    color: var(--neutral-400);
    font-size: 0.88rem;
    margin-bottom: 24px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ==================== Responsive Utilities ==================== */
.hide-mobile { display: none; }
.hide-desktop { display: block; }

@media (min-width: 1024px) {
    .hide-mobile { display: block; }
    .hide-desktop { display: none; }
}

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--rose-400);
    outline-offset: 2px;
}

/* Contain overscroll to main content (preserves native rubber-band feel) */
.app-main {
    overscroll-behavior-y: contain;
}

/* Spacing helpers */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.log-save-sticky {
    position: sticky;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0) + 8px);
    z-index: 30;
    padding: 16px 0 0;
    background: linear-gradient(to top, var(--neutral-50) 70%, transparent);
}

@media (min-width: 1024px) {
    .log-save-sticky {
        bottom: 0;
    }
}

/* ==================== In-App Premium Styles ==================== */

/* Ambient background for the app */
.app-shell {
    position: relative;
}

.app-shell::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(251,113,133,0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.app-shell::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: 200px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167,139,250,0.025) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.app-main {
    position: relative;
    z-index: 1;
}

/* Cycle ring hero section */
.cycle-ring-container {
    background: linear-gradient(160deg, var(--rose-50) 0%, var(--lavender-50) 40%, var(--neutral-0) 100%);
    border-radius: var(--r-2xl);
    margin: -4px -4px 0;
    padding: 36px 24px 28px;
    position: relative;
    overflow: hidden;
}

.cycle-ring-container::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(251,113,133,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.cycle-ring-container::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(167,139,250,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

/* Daily brief as premium featured card */
.daily-brief-card {
    background: linear-gradient(135deg, var(--neutral-0) 0%, var(--rose-50) 100%);
    border: 1px solid rgba(244,63,94,0.08);
    border-radius: var(--r-xl);
    padding: 24px;
    box-shadow: 0 2px 12px rgba(244,63,94,0.04);
    animation: cardEnter 0.5s var(--ease-out) backwards;
    position: relative;
    overflow: hidden;
}

.daily-brief-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top right, rgba(251,113,133,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.daily-brief-details {
    margin-top: 12px;
}

.daily-brief-summary {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rose-500);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.daily-brief-tips {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

/* Demo banner refined */
.demo-banner {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, rgba(244,63,94,0.06) 100%);
    border-radius: var(--r-xl);
    border: 1px solid rgba(251,191,36,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    backdrop-filter: blur(8px);
}

.demo-banner-text {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--neutral-800);
}

.demo-banner-sub {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* Enhanced sidebar active state */
.sidebar-link.active::before {
    opacity: 1;
    background: linear-gradient(135deg, var(--rose-50), rgba(251,113,133,0.08));
}

/* Phase pill enhancements */
.phase-pill {
    font-size: 0.9rem;
    padding: 10px 24px;
}

/* Dashboard greeting */
.dashboard-greeting {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--neutral-800);
    text-align: center;
    animation: greetFade 0.8s var(--ease-out);
}

@keyframes greetFade {
    from { opacity: 0; transform: translateY(-8px); }
}

.nudge-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--neutral-100);
    border-radius: var(--r-lg);
    font-size: 0.82rem;
    color: var(--neutral-500);
    margin-bottom: 20px;
    animation: cardEnter 0.5s var(--ease-out);
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.65rem;
    margin-bottom: 24px;
}

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

/* Show photo overlays on touch devices */
@media (hover: none) {
    .landing-photo-overlay {
        opacity: 1;
    }
}

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

/* ==================== Landing — Social Proof ==================== */
.landing-proof-section {
    padding: 48px 24px;
    background: var(--neutral-0);
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--neutral-100);
}

.landing-proof-inner {
    max-width: 700px;
    margin: 0 auto;
}

.proof-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

@media (max-width: 600px) {
    .proof-stats { gap: 20px; }
}

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

.proof-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--rose-500);
    line-height: 1;
}

@media (max-width: 600px) {
    .proof-stat-value { font-size: 1.2rem; }
}

.proof-stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--neutral-400);
    margin-top: 6px;
}

.proof-divider {
    width: 1px;
    height: 36px;
    background: var(--neutral-200);
}

/* ==================== Landing — Product Showcase ==================== */
.showcase-section {
    padding: 80px 24px 0;
    background: var(--neutral-0);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.showcase-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.showcase-header {
    text-align: center;
    margin-bottom: 64px;
}

.showcase-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rose-500);
    margin-bottom: 12px;
}

.showcase-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.showcase-title em {
    font-style: italic;
    color: var(--rose-500);
}

.showcase-subtitle {
    font-size: 1rem;
    color: var(--neutral-500);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Feature rows */
.showcase-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 0;
    padding: 64px 24px;
    border-radius: var(--r-2xl);
}

/* Alternating row backgrounds */
.showcase-feature:nth-child(1) {
    background: linear-gradient(135deg, var(--rose-50) 0%, rgba(254,205,211,0.15) 100%);
}

.showcase-feature:nth-child(2) {
    background: linear-gradient(135deg, var(--lavender-50) 0%, rgba(221,214,254,0.15) 100%);
}

.showcase-feature:nth-child(3) {
    background: linear-gradient(135deg, var(--sage-50) 0%, rgba(187,247,208,0.15) 100%);
}

@media (min-width: 768px) {
    .showcase-feature {
        flex-direction: row;
        gap: 64px;
    }

    .showcase-feature.reverse {
        flex-direction: row-reverse;
    }

    .showcase-phone {
        flex-shrink: 0;
    }

    .showcase-text {
        flex: 1;
    }
}

/* Phone mockup */
.showcase-phone {
    width: 280px;
    flex-shrink: 0;
}

.showcase-phone-frame {
    background: var(--neutral-900);
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        var(--shadow-xl),
        0 20px 60px rgba(0,0,0,0.08),
        inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: transform 0.5s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

/* Notch */
.showcase-phone-frame::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: var(--neutral-900);
    border-radius: 0 0 14px 14px;
    z-index: 2;
}

.showcase-phone-frame:hover {
    transform: translateY(-6px) scale(1.01);
}

.showcase-phone-frame img {
    width: 100%;
    height: auto;
    border-radius: 30px;
    display: block;
}

/* Feature text */
.showcase-text {
    max-width: 440px;
}

.showcase-number {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--rose-200);
    line-height: 1;
    margin-bottom: 8px;
}

/* Color-match the numbers to row gradients */
.showcase-feature:nth-child(1) .showcase-number { color: var(--rose-200); }
.showcase-feature:nth-child(2) .showcase-number { color: var(--lavender-200); }
.showcase-feature:nth-child(3) .showcase-number { color: var(--sage-200); }

/* Color-match the checkmarks */
.showcase-feature:nth-child(2) .showcase-list li::before {
    background-color: var(--lavender-50);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.showcase-feature:nth-child(3) .showcase-list li::before {
    background-color: var(--sage-50);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.showcase-text h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.showcase-text p {
    font-size: 0.92rem;
    color: var(--neutral-500);
    line-height: 1.7;
    margin-bottom: 20px;
}

.showcase-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.showcase-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--neutral-600);
    font-weight: 500;
}

.showcase-list li::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--rose-50);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f43f5e' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* Desktop preview */
.showcase-desktop-preview {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 24px;
    background: linear-gradient(135deg, var(--amber-50) 0%, rgba(254,243,199,0.15) 100%);
    border-radius: var(--r-2xl);
    margin-top: 24px;
}

.showcase-desktop-header {
    text-align: center;
    margin-bottom: 32px;
}

.showcase-desktop-header h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    margin-top: 8px;
}

.showcase-desktop-header p {
    font-size: 0.88rem;
    color: var(--neutral-500);
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.5;
}

.showcase-desktop-frame {
    background: var(--neutral-800);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 20px 60px rgba(0,0,0,0.1);
    transition: transform 0.5s var(--ease-spring);
}

.showcase-desktop-frame:hover {
    transform: translateY(-4px);
}

.showcase-browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--neutral-700);
}

.browser-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neutral-600);
}

.browser-dot:first-child { background: #ff5f56; }
.browser-dot:nth-child(2) { background: #ffbd2e; }
.browser-dot:nth-child(3) { background: #27c93f; }

.browser-url {
    margin-left: 12px;
    font-size: 0.7rem;
    color: var(--neutral-400);
    font-family: 'Inter', monospace;
    background: var(--neutral-800);
    padding: 3px 12px;
    border-radius: 4px;
}

.showcase-desktop-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile: phone mockups centered + smaller */
@media (max-width: 767px) {
    .showcase-phone {
        width: 220px;
    }

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

    .showcase-list {
        align-items: center;
    }

    .showcase-number {
        font-size: 2.5rem;
    }

    .showcase-title {
        font-size: 1.5rem;
    }

    .showcase-desktop-frame {
        border-radius: 8px;
    }
}

/* ==================== Landing — Photo Grid ==================== */
.landing-images-section {
    padding: 80px 24px;
    background: var(--neutral-0);
    position: relative;
    z-index: 1;
}

.landing-images-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    margin-bottom: 48px;
}

.landing-section-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.landing-section-title em {
    font-style: italic;
    color: var(--rose-500);
}

.landing-section-subtitle {
    font-size: 1rem;
    color: var(--neutral-500);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

.landing-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .landing-photo-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.landing-photo {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    aspect-ratio: 3/4;
    animation: cardEnter 0.6s var(--ease-out) backwards;
}

.landing-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-smooth);
}

.landing-photo:hover img {
    transform: scale(1.06);
}

.landing-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.4s var(--ease-smooth);
}

.landing-photo:hover .landing-photo-overlay {
    opacity: 1;
}

.landing-photo-overlay span {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.02em;
}

/* ==================== Landing — Trust Cards ==================== */
.landing-trust-section {
    padding: 80px 24px;
    background: linear-gradient(180deg, var(--neutral-0) 0%, var(--neutral-50) 100%);
    position: relative;
    z-index: 1;
}

.landing-trust-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.trust-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .trust-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

.trust-card {
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    padding: 32px 28px;
    border: 1px solid var(--neutral-150);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-spring);
}

.trust-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.trust-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.trust-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--neutral-800);
}

.trust-card p {
    font-size: 0.85rem;
    color: var(--neutral-500);
    line-height: 1.6;
}

/* ==================== Landing — CTA Section ==================== */
.landing-cta-section {
    position: relative;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.landing-cta-bg {
    position: absolute;
    inset: 0;
}

.landing-cta-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-cta-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(244,63,94,0.6) 0%, rgba(139,92,246,0.5) 100%);
}

.landing-cta-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
    max-width: 500px;
}

.landing-cta-content h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 12px;
}

.landing-cta-content p {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 28px;
    line-height: 1.6;
}

.landing-cta-content .btn-primary {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ==================== Landing — Footer ==================== */
.landing-footer {
    padding: 40px 24px;
    background: var(--neutral-0);
    border-top: 1px solid var(--neutral-150);
    position: relative;
    z-index: 1;
}

.landing-footer-inner {
    text-align: center;
}

/* ==================== Auth — Split Layout with Image ==================== */
.auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    position: relative;
    overflow: hidden;
    background: linear-gradient(170deg, var(--neutral-0) 0%, var(--rose-50) 50%, var(--lavender-50) 100%);
}

.auth-image-panel {
    display: none;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

@media (min-width: 1024px) {
    .auth-container {
        background: var(--neutral-0);
    }

    .auth-image-panel {
        display: block;
        width: 50%;
        position: relative;
        overflow: hidden;
    }

    .auth-image-panel img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        animation: imageZoom 20s ease-in-out infinite alternate;
    }

    @keyframes imageZoom {
        from { transform: scale(1); }
        to { transform: scale(1.08); }
    }

    .auth-image-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(244,63,94,0.2) 0%, rgba(139,92,246,0.4) 100%);
        display: flex;
        align-items: flex-end;
        padding: 48px;
    }

    .auth-image-overlay blockquote {
        font-family: 'Playfair Display', serif;
        font-size: 1.5rem;
        font-style: italic;
        color: white;
        line-height: 1.4;
        max-width: 380px;
        text-shadow: 0 2px 12px rgba(0,0,0,0.2);
    }

    .auth-form-panel {
        width: 50%;
    }
}

.auth-card {
    max-width: 400px;
    width: 100%;
    animation: onboardEnter 0.6s var(--ease-out);
}

.auth-container::before,
.auth-container::after {
    display: none;
}

@media (max-width: 1023px) {
    .auth-container::before {
        content: '';
        display: block;
        position: absolute;
        width: 500px;
        height: 500px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(244,63,94,0.05) 0%, transparent 70%);
        top: -200px;
        right: -200px;
        animation: orbFloat 8s ease-in-out infinite;
    }
}

/* ==========================================================================
   Marketing / SEO Pages Layout
   Premium, tranquil, blossom-themed
   ========================================================================== */

/* Ambient background orbs */
.mkt-bg-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.mkt-bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(251,113,133,0.04) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: orbFloat 15s ease-in-out infinite;
}

.mkt-bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(167,139,250,0.035) 0%, transparent 70%);
    bottom: -100px;
    left: -150px;
    animation: orbFloat 20s ease-in-out infinite reverse;
}

/* ---- Header ---- */
.mkt-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mkt-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mkt-nav {
    display: none;
    align-items: center;
    gap: 4px;
}

.mkt-nav-link {
    padding: 7px 14px;
    border-radius: var(--r-full);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--neutral-500);
    text-decoration: none;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.mkt-nav-link:hover {
    color: var(--rose-600);
    background: var(--rose-50);
}

.mkt-nav-link.active {
    color: var(--rose-600);
    background: var(--rose-50);
    font-weight: 600;
}

.mkt-header-actions {
    display: none;
    align-items: center;
    gap: 8px;
}

.mkt-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--neutral-500);
    border-radius: var(--r-full);
    transition: background var(--duration-fast) var(--ease-smooth);
    -webkit-tap-highlight-color: transparent;
}

.mkt-hamburger:hover {
    background: var(--neutral-100);
}

/* Mobile nav */
.mkt-mobile-nav {
    display: none;
    flex-direction: column;
    padding: 8px 24px 24px;
    border-top: 1px solid var(--neutral-100);
    animation: mktNavSlide 0.3s var(--ease-out);
}

.mkt-mobile-nav.open {
    display: flex;
}

@keyframes mktNavSlide {
    from { opacity: 0; transform: translateY(-8px); }
}

.mkt-mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.mkt-mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--neutral-600);
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-smooth);
}

.mkt-mobile-link:hover,
.mkt-mobile-link.active {
    background: var(--rose-50);
    color: var(--rose-600);
}

.mkt-mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-100);
}

/* Desktop breakpoint */
@media (min-width: 768px) {
    .mkt-nav {
        display: flex;
    }

    .mkt-header-actions {
        display: flex;
    }

    .mkt-hamburger {
        display: none;
    }
}

/* ---- Main content ---- */
.mkt-main {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 64px - 300px);
}

.mkt-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    animation: cardEnter 0.5s var(--ease-out);
}

@media (min-width: 768px) {
    .mkt-content {
        padding: 64px 32px 80px;
    }
}

/* Page hero patterns for marketing pages */
.mkt-content > h1:first-child {
    font-size: 2.2rem;
    margin-bottom: 8px;
    animation: heroEnter 0.6s var(--ease-out);
}

.mkt-content > h1:first-child + p {
    font-size: 1.05rem;
    color: var(--neutral-500);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 560px;
    animation: heroEnter 0.6s var(--ease-out) 0.1s backwards;
}

@media (min-width: 768px) {
    .mkt-content > h1:first-child {
        font-size: 2.6rem;
    }
}

/* ---- Footer ---- */
.mkt-footer {
    position: relative;
    z-index: 1;
    background: var(--neutral-0);
    border-top: 1px solid var(--neutral-100);
}

.mkt-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 24px 0;
}

.mkt-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .mkt-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 48px;
    }
}

.mkt-footer-brand {
    max-width: 260px;
}

.mkt-footer-tagline {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--neutral-500);
    margin-top: 12px;
    line-height: 1.5;
}

.mkt-footer-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--neutral-400);
    margin-top: 16px;
}

.mkt-footer-heading {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neutral-400);
    margin-bottom: 16px;
}

.mkt-footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mkt-footer-link {
    font-size: 0.85rem;
    color: var(--neutral-600);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.mkt-footer-link:hover {
    color: var(--rose-500);
}

.mkt-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 0;
    border-top: 1px solid var(--neutral-100);
    font-size: 0.72rem;
    color: var(--neutral-400);
}

.mkt-footer-cta {
    display: flex;
}

.mkt-footer-gradient {
    height: 4px;
    background: linear-gradient(90deg, var(--rose-300), var(--lavender-400), var(--sage-400), var(--amber-400));
    opacity: 0.5;
}


/* ==========================================================================
   Check-in — Conversational Daily Logger
   Warm, Apple-inspired chat experience
   ========================================================================== */

.checkin-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 16px;
    min-height: calc(100vh - var(--bottom-nav-height) - var(--nav-height) - 40px);
    display: flex;
    flex-direction: column;
}

/* ─── Chat Layout ─────────────────────────────────────────── */

.checkin-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.checkin-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ─── Chat Bubbles ────────────────────────────────────────── */

.checkin-bubble {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 88%;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s var(--ease-spring),
                transform 0.5s var(--ease-spring);
}

.checkin-bubble--entering {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
}

.checkin-bubble--bloom {
    align-self: flex-start;
}

.checkin-bubble--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Bloom avatar */
.checkin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-50), var(--rose-100));
    border: 1.5px solid var(--rose-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(244,63,94,0.1);
}

/* Bubble text */
.checkin-bubble-text {
    padding: 14px 18px;
    border-radius: var(--r-xl);
    line-height: 1.55;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.checkin-bubble--bloom .checkin-bubble-text {
    background: var(--neutral-0);
    color: var(--neutral-800);
    border: 1px solid var(--neutral-150);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.checkin-bubble--user .checkin-bubble-text {
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 12px rgba(244,63,94,0.25);
    font-weight: 500;
}

/* ─── Typing Indicator ────────────────────────────────────── */

.checkin-typing {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    align-self: flex-start;
    animation: fadeIn 0.3s var(--ease-smooth);
}

.checkin-dots {
    display: flex;
    gap: 5px;
    padding: 16px 20px;
    background: var(--neutral-0);
    border: 1px solid var(--neutral-150);
    border-radius: var(--r-xl);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.checkin-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rose-300);
    animation: checkinBounce 1.4s ease-in-out infinite;
}

.checkin-dots span:nth-child(2) { animation-delay: 0.16s; }
.checkin-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes checkinBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── Input Area (Pills + Number) ─────────────────────────── */

.checkin-input-area {
    padding: 16px 0 24px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    animation: slideUp 0.4s var(--ease-spring);
}

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

.checkin-quicktaps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 20px;
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    border: 1px solid var(--neutral-150);
    box-shadow: var(--shadow-md);
}

/* Quick-tap pills — match existing pill-label system */
.checkin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    min-height: 44px;
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--r-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--neutral-600);
    background: var(--neutral-0);
    transition: all 0.25s var(--ease-spring);
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.checkin-pill:hover {
    background: var(--rose-50);
    border-color: var(--rose-300);
    color: var(--rose-600);
    transform: scale(1.04);
}

.checkin-pill:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.checkin-pill--selected {
    background: var(--rose-50);
    border-color: var(--rose-400);
    color: var(--rose-600);
    font-weight: 600;
    box-shadow: var(--shadow-glow-rose);
    animation: pillSelect 0.4s var(--ease-spring);
}

@keyframes pillSelect {
    0% { transform: scale(1); }
    40% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.checkin-pill--done {
    background: var(--sage-500);
    color: white;
    border-color: var(--sage-500);
    font-weight: 600;
    box-shadow: var(--shadow-glow-sage);
}

.checkin-pill--done:hover {
    background: var(--sage-600);
    border-color: var(--sage-600);
    color: white;
}

/* ─── Number Input ────────────────────────────────────────── */

.checkin-number-input {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--neutral-0);
    border-radius: var(--r-xl);
    border: 1px solid var(--neutral-150);
    box-shadow: var(--shadow-md);
}

.checkin-number {
    width: 140px;
    padding: 12px 16px;
    border-radius: var(--r-lg);
    border: 1.5px solid var(--neutral-200);
    background: var(--neutral-50);
    font-size: 1.125rem;
    text-align: center;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 500;
    color: var(--neutral-800);
    outline: none;
    transition: all 0.25s var(--ease-smooth);
    -moz-appearance: textfield;
}

.checkin-number::-webkit-inner-spin-button,
.checkin-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.checkin-number:focus {
    border-color: var(--rose-400);
    background: var(--neutral-0);
    box-shadow: 0 0 0 3px rgba(244,63,94,0.1);
}

.checkin-number::placeholder {
    color: var(--neutral-300);
    font-weight: 400;
}

/* ─── Action Buttons ──────────────────────────────────────── */

.checkin-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    min-height: 48px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    font-family: 'Inter', -apple-system, sans-serif;
    box-shadow: 0 4px 14px rgba(244,63,94,0.3);
    letter-spacing: -0.01em;
}

.checkin-btn-primary:hover {
    background: linear-gradient(135deg, var(--rose-600), var(--rose-700));
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(244,63,94,0.35);
}

.checkin-btn-primary:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.checkin-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    min-height: 48px;
    border-radius: var(--r-full);
    background: var(--neutral-0);
    color: var(--neutral-600);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    border: 1.5px solid var(--neutral-200);
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    font-family: 'Inter', -apple-system, sans-serif;
}

.checkin-btn-secondary:hover {
    border-color: var(--neutral-300);
    color: var(--neutral-700);
    background: var(--neutral-50);
}

.checkin-btn-sm {
    padding: 10px 18px;
    min-height: 40px;
    font-size: 0.8125rem;
}

.checkin-btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    min-height: 40px;
    background: none;
    border: none;
    color: var(--neutral-400);
    font-size: 0.8125rem;
    cursor: pointer;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: color 0.2s;
}

.checkin-btn-ghost:hover {
    color: var(--neutral-600);
}

.checkin-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 24px 0;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s var(--ease-spring),
                transform 0.5s var(--ease-spring);
}

.checkin-actions.checkin-bubble--entering {
    opacity: 0;
    transform: translateY(16px);
}

/* ─── Summary Card ────────────────────────────────────────── */

.checkin-summary-card {
    background: var(--neutral-0);
    border: 1px solid var(--neutral-150);
    border-radius: var(--r-xl);
    padding: 20px 24px;
    margin: 4px 0;
    box-shadow: var(--shadow-md);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s var(--ease-spring),
                transform 0.5s var(--ease-spring);
}

.checkin-summary-card.checkin-bubble--entering {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
}

.checkin-summary-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--neutral-800);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--neutral-150);
    letter-spacing: -0.02em;
}

.checkin-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.875rem;
}

.checkin-summary-row + .checkin-summary-row {
    border-top: 1px solid var(--neutral-100);
}

.checkin-summary-label {
    color: var(--neutral-400);
    font-weight: 400;
}

.checkin-summary-value {
    color: var(--neutral-700);
    font-weight: 600;
}

/* ─── Completed State ─────────────────────────────────────── */

.checkin-completed {
    text-align: center;
    padding: 48px 16px;
    animation: fadeIn 0.5s var(--ease-smooth);
}

.checkin-completed-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sage-50), var(--sage-100));
    border: 2px solid var(--sage-200);
    color: var(--sage-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow-sage);
}

.checkin-completed h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--neutral-800);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.checkin-completed-summary {
    color: var(--neutral-500);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.checkin-completed .checkin-summary-card {
    text-align: left;
    max-width: 420px;
    margin: 0 auto 24px;
}

.checkin-completed .checkin-actions {
    padding-top: 0;
}

/* ─── Check-in Preferences (Settings) ─────────────────────── */

.checkin-prefs {
    padding: 4px 0;
}

.checkin-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 16px;
    cursor: pointer;
}

.checkin-pref-row + .checkin-pref-row {
    border-top: 1px solid var(--neutral-100);
}

.checkin-pref-label {
    font-size: 0.9375rem;
    color: var(--neutral-800);
    font-weight: 500;
}

.checkin-pref-desc {
    font-size: 0.8125rem;
    color: var(--neutral-400);
    margin-top: 3px;
    line-height: 1.4;
}

/* Toggle-style checkbox */
.checkin-pref-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: var(--neutral-200);
    position: relative;
    cursor: pointer;
    transition: background 0.25s var(--ease-smooth);
    flex-shrink: 0;
}

.checkin-pref-row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.25s var(--ease-spring);
}

.checkin-pref-row input[type="checkbox"]:checked {
    background: var(--rose-500);
}

.checkin-pref-row input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* ─── Mobile Adjustments ──────────────────────────────────── */

@media (max-width: 1023px) {
    .checkin-container {
        min-height: calc(100vh - var(--bottom-nav-height) - 60px);
        padding-bottom: 8px;
    }

    .checkin-bubble {
        max-width: 92%;
    }

    .checkin-quicktaps {
        border-radius: var(--r-lg);
        padding: 16px;
        gap: 6px;
    }

    .checkin-pill {
        padding: 10px 14px;
        font-size: 0.78rem;
    }
}

/* ─── Floating Check-in Reminder ──────────────────────────── */

.checkin-fab {
    position: fixed;
    bottom: 92px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: white;
    border-radius: var(--r-full);
    box-shadow: 0 6px 24px rgba(244,63,94,0.35), 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 999;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--ease-spring);
    animation: fabEnter 0.6s var(--ease-spring) 1s backwards;
    -webkit-tap-highlight-color: transparent;
}

.checkin-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 30px rgba(244,63,94,0.4), 0 4px 12px rgba(0,0,0,0.1);
}

.checkin-fab:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.checkin-fab-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.checkin-fab-label {
    white-space: nowrap;
}

@keyframes fabEnter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulse ring for attention */
.checkin-fab::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--r-full);
    border: 2px solid var(--rose-300);
    animation: fabPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fabPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.08); }
}

@media (min-width: 1024px) {
    .checkin-fab {
        bottom: 32px;
        right: 32px;
    }
}

/* AI Markdown rendering */
.checkin-bubble-text p,
[style*="border:1px solid #c7d2fe"] p {
    margin: 0 0 8px;
}
.checkin-bubble-text p:last-child,
[style*="border:1px solid #c7d2fe"] p:last-child {
    margin-bottom: 0;
}
.checkin-bubble-text ul,
.checkin-bubble-text ol,
[style*="border:1px solid #c7d2fe"] ul,
[style*="border:1px solid #c7d2fe"] ol {
    margin: 4px 0 8px;
    padding-left: 20px;
}
.checkin-bubble-text li,
[style*="border:1px solid #c7d2fe"] li {
    margin-bottom: 2px;
}
.checkin-bubble-text strong,
[style*="border:1px solid #c7d2fe"] strong {
    font-weight: 600;
    color: var(--neutral-800);
}
.checkin-bubble-text em,
[style*="border:1px solid #c7d2fe"] em {
    font-style: italic;
}
.checkin-bubble-text h3,
[style*="border:1px solid #c7d2fe"] h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 8px 0 4px;
    color: var(--neutral-800);
}
.checkin-bubble-text code,
[style*="border:1px solid #c7d2fe"] code {
    background: var(--neutral-100);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.85em;
}


/* Bloom AI quick-ask chips */
.bloom-chip {
    padding: 5px 12px;
    background: var(--rose-50);
    border: 1px solid var(--rose-200);
    border-radius: var(--r-full);
    font-size: 0.75rem;
    color: var(--rose-600);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.15s;
}
.bloom-chip:hover {
    background: var(--rose-100);
}
.bloom-chip:active {
    background: var(--rose-200);
}

/* Bloom nav active state */
#sidebar-bloom-link.chat-open,
#bottomnav-bloom.chat-open {
    color: var(--rose-500);
}
