/* ═══════════════════════════════════════════════════════════════════
   BéBé Journal — Design System
   Style : iOS Premium · Glassmorphism · Phosphor Icons
   Typographie : Fraunces (display) + Figtree (body)
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300&family=Figtree:wght@300;400;500;600&display=swap');


/* ── Phosphor Icons (CDN) ────────────────────────────────────────── */
/* Utilisé via <i class="ph ph-baby"> etc. dans les templates        */

/* ── Tokens ──────────────────────────────────────────────────────── */
:root {
    /* Couleurs principales */
    --clay:        #c4785a;
    --clay-light:  #e09b80;
    --clay-dark:   #9a5840;
    --sage:        #6b9e7e;
    --sage-light:  #a8ccb5;
    --gold:        #c9973a;
    --gold-light:  #e8c06a;
    --night:       #3d4f72;

    /* Surfaces */
    --bg:          #f7f2ed;
    --bg-alt:      #f0e9e0;
    --surface:     rgba(255, 255, 255, 0.72);
    --surface-mid: rgba(255, 255, 255, 0.48);
    --surface-low: rgba(255, 255, 255, 0.28);
    --border:      rgba(196, 120, 90, 0.12);
    --border-mid:  rgba(196, 120, 90, 0.22);

    /* Texte */
    --text:        #2a1f17;
    --text-2:      #6b5748;
    --text-3:      #a08878;

    /* Effets */
    --blur:        blur(20px) saturate(1.6);
    --blur-heavy:  blur(40px) saturate(1.8);
    --shadow-xs:   0 1px 3px rgba(42, 31, 23, 0.06);
    --shadow-sm:   0 2px 12px rgba(42, 31, 23, 0.08), 0 1px 3px rgba(42, 31, 23, 0.04);
    --shadow-md:   0 8px 32px rgba(42, 31, 23, 0.10), 0 2px 8px rgba(42, 31, 23, 0.06);
    --shadow-lg:   0 24px 64px rgba(42, 31, 23, 0.14), 0 4px 16px rgba(42, 31, 23, 0.08);
    --shadow-clay: 0 8px 32px rgba(196, 120, 90, 0.28);

    /* Géométrie */
    --r-sm:  0.75rem;
    --r:     1.25rem;
    --r-lg:  1.75rem;
    --r-xl:  2.25rem;

    /* Typographie */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'Figtree', system-ui, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
    --bg:          #1a1310;
    --bg-alt:      #221a15;
    --surface:     rgba(40, 28, 22, 0.80);
    --surface-mid: rgba(40, 28, 22, 0.55);
    --surface-low: rgba(40, 28, 22, 0.35);
    --border:      rgba(196, 120, 90, 0.16);
    --border-mid:  rgba(196, 120, 90, 0.28);
    --text:        #f2ebe4;
    --text-2:      #c4aa98;
    --text-3:      #8a7060;
    --clay-light:  #d4896a;
    --shadow-sm:   0 2px 12px rgba(0,0,0,0.24);
    --shadow-md:   0 8px 32px rgba(0,0,0,0.32);
    --shadow-lg:   0 24px 64px rgba(0,0,0,0.48);
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body), serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* Fond ambiant animé */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(196,120,90,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(107,158,126,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(201,151,58,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout shell ────────────────────────────────────────────────── */
.app-shell {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 960px) {
    body { background: var(--bg-alt); }
    .app-shell {
        max-width: 1140px;
        flex-direction: row;
        min-height: 100vh;
        box-shadow: var(--shadow-lg);
        border-radius: var(--r-xl);
        overflow: hidden;
        margin: 1.5rem auto;
    }
    .sidebar { display: flex !important; }
}

/* ── Général ─────────────────────────────────────────────────────── */
.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

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

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
    display: none;
    width: 240px;
    flex-shrink: 0;
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 0.25rem;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--border);
}

.sidebar-logo {
    font-family: var(--font-display), serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--clay);
    padding: 0.5rem 0.75rem 1.5rem;
    line-height: 1.2;
}
.sidebar-logo span {
    display: block;
    font-family: var(--font-body), serif;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.875rem;
    border-radius: var(--r-sm);
    text-decoration: none;
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 400;
    transition: background 0.18s, color 0.18s;
    cursor: pointer;
}
.nav-item:hover { background: var(--surface-low); color: var(--text); }
.nav-item.active {
    background: var(--clay);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(196,120,90,0.35);
}
.nav-item .nav-icon {
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
/* Phosphor icon dans nav */
.nav-item .ph {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-item--secondary { opacity: 0.55; }
.nav-item--secondary:hover { opacity: 0.9; }

.sidebar-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    color: var(--text-3);
    margin-top: 0.5rem;
}

.mobile-more-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    display: none;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    background: var(--surface);
    border-top: 1px solid var(--surface);
    padding: 20px;
}

.mobile-more-menu.open {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

.more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.more-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* ── Main wrapper ────────────────────────────────────────────────── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* ── Top bar mobile ──────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.625rem;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
@media (min-width: 960px) { .topbar { display: none; } }

.topbar-logo {
    font-family: var(--font-display), serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--clay);
}
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.75rem;
    color: var(--text-3);
}
.breadcrumb a { color: var(--clay); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { opacity: 0.35; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.icon-btn {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
}
.icon-btn:hover { background: var(--surface-mid); box-shadow: var(--shadow-sm); }

.theme-toggle {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--text-2);
    transition: background 0.18s;
}
.theme-toggle:hover { background: var(--surface-mid); }

.btn-add {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--clay);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px rgba(196,120,90,0.45);
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
}
.btn-add:hover { transform: scale(1.1); box-shadow: var(--shadow-clay); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--r-sm);
    background: var(--surface);
    backdrop-filter: var(--blur);
    color: var(--text);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    border: 1px solid var(--border-mid);
    transition: background 0.18s, box-shadow 0.18s;
}
.btn-secondary:hover { background: var(--surface-mid); box-shadow: var(--shadow-sm); }

/* ── Main scroll ─────────────────────────────────────────────────── */
.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 5rem;
}

/* ── Hero banner ─────────────────────────────────────────────────── */
.hero {
    margin: 0.875rem 1rem 0;
    border-radius: var(--r-lg);
    background: linear-gradient(140deg, #e8d5c4 0%, #c9a882 100%);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    padding: 1.375rem;
}

.hero-bg-pattern {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 80% 20%, rgba(255,255,255,0.22) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(196,120,90,0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.hero-photo {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 58%;
    background: center/cover no-repeat;
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
    z-index: 0;
}
.hero-photo::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(
        to right,
        rgba(232,213,196,0.15) 0%,
        rgba(220,195,170,0.65) 65%,
        rgba(201,168,130,1)    100%
    );
    border-radius: inherit;
}

.hero-info {
    position: relative;
    z-index: 2;
    flex: 1;
}

.hero-name {
    font-family: var(--font-display), serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--clay-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 12px rgba(255,255,255,0.4);
}

.hero-stats { display: flex; flex-direction: column; gap: 0.2rem; }

.hero-stat {
    font-size: 0.8rem;
    color: rgba(42,31,23,0.82);
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.hero-stat strong { font-weight: 600; }
.hero-stat .ph { font-size: 0.85rem; opacity: 0.6; }

/* Biberon pill */
.biberon-pill {
    position: relative;
    z-index: 2;
    align-self: center;
    background: var(--surface);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--r);
    padding: 0.625rem 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-shadow: var(--shadow-md);
    min-width: 62px;
    flex-shrink: 0;
    margin-left: 1rem;
}
.biberon-icon { font-size: 1.25rem; }
.biberon-bar {
    width: 24px; height: 46px;
    background: rgba(196,120,90,0.12);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}
.biberon-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, var(--sage), var(--sage-light));
    border-radius: 3px;
    transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.biberon-pct { font-size: 0.72rem; font-weight: 600; color: var(--sage); }
.biberon-vol { font-size: 0.6rem; color: var(--text-3); }

/* ── Stats strip ─────────────────────────────────────────────────── */
.stats-strip {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 0 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.stats-strip::-webkit-scrollbar { display: none; }

.stat-chip {
    flex-shrink: 0;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s, box-shadow 0.18s;
}
.stat-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.stat-chip .s-icon {
    width: 2rem; height: 2rem;
    border-radius: 0.625rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-chip .s-icon.icon-sleep  { background: rgba(61,79,114,0.10); color: var(--night); }
.stat-chip .s-icon.icon-feed   { background: rgba(201,151,58,0.12); color: var(--gold); }
.stat-chip .s-icon.icon-change { background: rgba(107,158,126,0.12); color: var(--sage); }
.stat-chip .s-icon.icon-awake  { background: rgba(196,120,90,0.12); color: var(--clay); }

.stat-chip .s-val { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.stat-chip .s-lbl { font-size: 0.68rem; color: var(--text-3); line-height: 1; }

/* ── Date nav ────────────────────────────────────────────────────── */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem 0.5rem;
}
.date-nav-btn {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
}
.date-nav-btn:hover { background: var(--surface-mid); box-shadow: var(--shadow-xs); }

.date-nav-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-display), serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.date-nav-label .cal-icon { font-size: 0.9rem; opacity: 0.4; }

/* ── Wheel timeline ──────────────────────────────────────────────── */
.wheel-section { padding: 0 0.5rem 0.25rem; }

.wheel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-canvas { width: 320px; height: 320px; flex-shrink: 0; }

.wheel-popup {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: var(--r);
    padding: 1rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 136px;
    pointer-events: none;
    transition: opacity 0.2s;
}
.popup-icon     { font-size: 1.75rem; margin-bottom: 0.25rem; }
.popup-time     { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.popup-label    { font-size: 0.72rem; color: var(--text-3); margin: 0.1rem 0; }
.popup-duration { font-size: 0.82rem; font-weight: 600; color: var(--clay); }
.popup-detail   { font-size: 0.65rem; color: var(--text-3); margin-top: 0.15rem; }

.popup-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    background: var(--clay);
    color: #fff;
    font-size: 0.75rem;
    text-decoration: none;
    pointer-events: all;
    transition: transform 0.15s;
}
.popup-edit-link:hover { transform: scale(1.1); }

/* Légende */
.wheel-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.875rem;
    justify-content: center;
    padding: 0 1rem 0.25rem;
}
.legend-item {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; color: var(--text-3);
}
.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Journal d'activité ──────────────────────────────────────────── */
.journal-section { padding: 0.75rem 1rem 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}
.section-title {
    font-family: var(--font-display), serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }

.activity-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    animation: cardIn 0.32s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-mid);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.activity-time {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-3);
    min-width: 40px;
    text-align: right;
    line-height: 1.4;
}
.activity-time .time-end { opacity: 0.65; }

.activity-icon {
    width: 2.375rem; height: 2.375rem;
    border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.activity-icon .ph { font-size: 1.15rem; }

/* Couleurs par type */
.type-sleep  .activity-icon { background: rgba(61,79,114,0.10);  color: var(--night); }
.type-feed   .activity-icon { background: rgba(201,151,58,0.12); color: var(--gold); }
.type-change .activity-icon { background: rgba(107,158,126,0.12);color: var(--sage); }
.type-awake  .activity-icon { background: rgba(196,120,90,0.12); color: var(--clay); }
.type-measure .activity-icon{ background: rgba(130,90,180,0.10); color: #8a5ab4; }

.activity-body { flex: 1; min-width: 0; }
.activity-name { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.activity-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.activity-badge {
    font-size: 0.65rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-sleep   { background: rgba(61,79,114,0.10);  color: var(--night); }
.badge-feed    { background: rgba(201,151,58,0.12); color: var(--gold-dark, #a07020); }
.badge-change  { background: rgba(107,158,126,0.12);color: var(--sage); }
.badge-awake   { background: rgba(196,120,90,0.12); color: var(--clay); }
.badge-measure { background: rgba(130,90,180,0.10); color: #8a5ab4; }

.activity-actions {
    display: flex;
    flex-shrink: 0;
}
.action-btn {
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    color: var(--text-3);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: var(--surface-low); color: var(--text); }
.action-btn--delete:hover { background: rgba(200,60,60,0.08); color: #c03c3c; }

.journal-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.journal-empty span { font-size: 2rem; opacity: 0.4; }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 12, 8, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

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

.modal-sheet {
    background: var(--bg);
    width: 100%;
    max-width: 480px;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 0 0 2.5rem;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

@media (min-width: 600px) {
    .modal-sheet {
        border-radius: var(--r-xl);
        transform: scale(0.94) translateY(12px);
        max-height: 80vh;
    }
    .modal-overlay.open .modal-sheet { transform: scale(1) translateY(0); }
}

.modal-handle {
    width: 36px; height: 4px;
    background: var(--border-mid);
    border-radius: 2px;
    margin: 0.875rem auto 0;
}

/* Type selector */
.type-selector { padding: 1.125rem 1.25rem 0.5rem; }
.type-selector-title {
    font-family: var(--font-display), serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--r);
    border: 1.5px solid var(--border);
    background: var(--surface);
    backdrop-filter: var(--blur);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    text-align: left;
}
.type-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-mid);
}

.tb-icon {
    width: 2.5rem; height: 2.5rem;
    border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.tb-icon .ph { font-size: 1.25rem; }
.tb-eveil  .tb-icon { background: rgba(196,120,90,0.12); color: var(--clay); }
.tb-repas  .tb-icon { background: rgba(201,151,58,0.12); color: var(--gold); }
.tb-change .tb-icon { background: rgba(107,158,126,0.12);color: var(--sage); }
.tb-sante  .tb-icon { background: rgba(130,90,180,0.10); color: #8a5ab4; }
.tb-milk  .tb-icon { background: rgb(90 121 180 / 0.1); color: #5a6fb4; }

.tb-label { font-size: 0.875rem; font-weight: 500; }
.tb-sub   { font-size: 0.7rem; color: var(--text-3); }

/* ── Bottom nav mobile ───────────────────────────────────────────── */
.bottom-nav {
    display: flex;
    align-items: center;
    background: var(--surface);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
@media (min-width: 960px) { .bottom-nav { display: none; } }

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.62rem;
    font-family: var(--font-body), serif;
    text-decoration: none;
    transition: color 0.18s;
}
.bottom-nav-item .b-icon {
    font-size: 1.35rem;
    display: flex; align-items: center; justify-content: center;
    height: 1.5rem;
}
.bottom-nav-item .b-icon .ph { font-size: 1.35rem; }
.bottom-nav-item.active { color: var(--clay); }

/* FAB */
.fab { position: relative; flex: 0 0 auto; }
.fab-btn {
    width: 3.375rem; height: 3.375rem;
    border-radius: 50%;
    background: var(--clay);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(196,120,90,0.5), 0 1px 4px rgba(196,120,90,0.3);
    transform: translateY(-0.875rem);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.fab-btn:hover {
    transform: translateY(-0.875rem) scale(1.08);
    box-shadow: 0 8px 28px rgba(196,120,90,0.6);
}

/* ── Pregnancy page ──────────────────────────────────────────────── */
.hero--pregnancy {
    background: linear-gradient(140deg, #ecdfd3 0%, #d4b898 100%);
    min-height: 195px;
}

.hero-stat--highlight {
    font-size: 1rem;
    font-weight: 600;
    color: var(--clay-dark);
}

.pregnancy-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    padding: 0.875rem 1rem 0;
}

.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.375rem 0.875rem;
    background: var(--surface);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s, box-shadow 0.18s;
    text-align: center;
}
.shortcut-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.shortcut-icon {
    width: 3rem; height: 3rem;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.shortcut-icon .ph { font-size: 1.5rem; }
.shortcut-label { font-size: 0.84rem; font-weight: 500; }
.shortcut-sub   { font-size: 0.7rem; color: var(--text-3); }

.shortcut--contractions .shortcut-icon { background: rgba(196,120,90,0.12); color: var(--clay); }
.shortcut--wishlist     .shortcut-icon { background: rgba(201,151,58,0.12); color: var(--gold); }
.shortcut--photos       .shortcut-icon { background: rgba(107,158,126,0.12);color: var(--sage); }
.shortcut--edit         .shortcut-icon { background: rgba(61,79,114,0.10);  color: var(--night); }

.pregnancy-section { padding: 1.125rem 1rem 0; }
.pregnancy-hint {
    font-size: 0.8rem;
    color: var(--text-3);
    margin: 0.4rem 0 0.875rem;
    line-height: 1.55;
}

/* ── Scrollbar fine ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ── Filtres de période pour les graphiques ──────────────────────── */
.chart-period-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-xs);
    margin-bottom: 1rem;
}

.chart-period-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-3);
    white-space: nowrap;
    flex-shrink: 0;
}
.chart-period-label svg { width: 0.9rem; height: 0.9rem; }

.chart-period-btns {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.chart-period-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-family: var(--font-body), serif;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-2);
    background: var(--bg);
    border: 1.5px solid var(--border-mid);
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}
.chart-period-btn:hover {
    background: var(--bg-alt);
    color: var(--text);
    border-color: var(--clay);
}
.chart-period-btn--active {
    background: var(--clay);
    border-color: var(--clay);
    color: #fff;
    box-shadow: 0 2px 10px rgba(196,120,90,0.3);
    font-weight: 600;
}
.chart-period-btn--active:hover {
    background: var(--clay-dark);
    border-color: var(--clay-dark);
}

/* ── Chart cards ─────────────────────────────────────────────────── */
.charts-section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 768px) {
    .charts-section-grid { grid-template-columns: repeat(2, 1fr); }
}

.chart-card { display: flex; flex-direction: column; gap: 0.75rem; }

.chart-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display), serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.chart-card-title svg { width: 1.1rem; height: 1.1rem; color: var(--clay); }

.chart-card-period {
    margin-left: auto;
    font-family: var(--font-body), serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-3);
    background: var(--bg-alt);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.chart-wrapper {
    height: 14rem;
    position: relative;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: var(--text-3);
    font-size: 0.84rem;
}
.chart-empty svg { width: 2rem; height: 2rem; opacity: 0.25; }
