:root {
    /* Theme tokens (default theme) */
    --bg: #ffffff;
    --text: #0b1220;
    --brand-1: rgb(120, 179, 95);
    --brand-2: rgb(153, 183, 83);
    --brand-1-12: rgba(120,179,95,0.12);
    --brand-1-18: rgba(120,179,95,0.18);
    --brand-1-16: rgba(120,179,95,0.16);
    --muted: #6b6b6b;
    --accent: #f59e0b;
    --card-bg: #ffffff;
    --card-border: rgba(0,0,0,0.04);
    --entry-details-text: #222;
    --timeline-track-color: rgba(0,0,0,0.03);
    --asleep-bg: rgba(24,58,33,0.9);
    --no-sleep-color: #9aa19a;
    --inbed-start: rgba(120,179,95,0.18);
    --inbed-end: rgba(153,183,83,0.12);
    --inbed-border: rgba(120,179,95,0.16);
    --sleep-day-label-color: var(--brand-2);
    /* UI timing */
    --theme-transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

/* Named theme: "default" */
html[data-theme="default"] {
    --bg: #ffffff;
    --text: #0b1220;
    --brand-1: rgb(120, 179, 95);
    --brand-2: rgb(153, 183, 83);
    --brand-1-12: rgba(120,179,95,0.12);
    --brand-1-18: rgba(120,179,95,0.18);
    --brand-1-16: rgba(120,179,95,0.16);
    --muted: #6b6b6b;
    --accent: #f59e0b;
    --card-bg: #ffffff;
    --card-border: rgba(0,0,0,0.04);
    --entry-details-text: #222;
    --timeline-track-color: rgba(0,0,0,0.03);
    --asleep-bg: rgba(24,58,33,0.9);
    --no-sleep-color: #9aa19a;
    --inbed-start: rgba(120,179,95,0.18);
    --inbed-end: rgba(153,183,83,0.12);
    --inbed-border: rgba(120,179,95,0.16);
    --sleep-day-label-color: #234d26; /* slightly darker than brand for legibility */
}

html[data-theme="blue"] {
    --bg: #f6fbff; /* very light background */
    --text: #083147; /* slightly softened deep text */
    --brand-1: #8cc3ff; /* soft baby blue */
    --brand-2: #6aaedc; /* muted darker accent */
    --brand-1-12: rgba(140,195,255,0.12);
    --brand-1-18: rgba(140,195,255,0.18);
    --brand-1-16: rgba(140,195,255,0.16);
    --muted: #5b6d7a;
    --accent: #a9d6ff; /* gentle accent */
    --card-bg: #ffffff;
    --card-border: rgba(10,55,85,0.04);
    --entry-details-text: #083147;
    --timeline-track-color: rgba(10,55,85,0.02);
    --asleep-bg: rgba(10,45,80,0.82); /* softened asleep band */
    --no-sleep-color: #9fbfd6;
    --inbed-start: rgba(140,195,255,0.18);
    --inbed-end: rgba(166,211,255,0.12);
    --inbed-border: rgba(140,195,255,0.14);
    --sleep-day-label-color: #315a75; /* softer blue tone for day label */
}

    html[data-theme="blue"] nav > ul > li.tab > a {
        /* keep a light button but use a darker text color */
        background: rgba(255,255,255,0.14);
        color: var(--entry-details-text);
    }

        html[data-theme="blue"] nav > ul > li.tab > a:hover,
        html[data-theme="blue"] nav > ul > li.tab > a:focus {
            /* subtle lift on hover */
            background: rgba(255,255,255,0.20);
            color: var(--entry-details-text);
        }

        html[data-theme="blue"] nav > ul > li.tab > a.active {
            background: white;
            color: var(--brand-2);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

    html[data-theme="blue"] .input-form footer ul li > button {
        background: rgba(255,255,255,0.14);
        color: var(--entry-details-text);
    }

        html[data-theme="blue"] .input-form footer ul li > button:hover,
        html[data-theme="blue"] .input-form footer ul li > button:focus {
            background: rgba(255,255,255,0.20);
            color: var(--entry-details-text);
        }

        html[data-theme="blue"] .input-form footer ul li > button.active {
            background: white;
            color: var(--brand-2);
        }

html[data-theme="pink"] {
    --bg: #fff7fb; /* very pale pink background */
    --text: #4a2430; /* warm but readable text color */
    --brand-1: #f7c6dc; /* soft pastel pink */
    --brand-2: #d79aaf; /* muted accent */
    --brand-1-12: rgba(247,198,220,0.12);
    --brand-1-18: rgba(247,198,220,0.18);
    --brand-1-16: rgba(247,198,220,0.16);
    --muted: #7a5666;
    --accent: #f7a8bf; /* gentle accent */
    --card-bg: #fff7fb; /* match page background for gentle cards */
    --card-border: rgba(215,150,165,0.06);
    --entry-details-text: #402130;
    --timeline-track-color: rgba(99,26,46,0.02);
    --asleep-bg: rgba(120,30,50,0.6); /* softened asleep band */
    --no-sleep-color: #d3a9b6;
    --inbed-start: rgba(247,198,220,0.16);
    --inbed-end: rgba(253,209,221,0.10);
    --inbed-border: rgba(215,150,165,0.12);
    --sleep-day-label-color: #6b2340; /* warm, readable pink label */
}

    /* Pink: darker buttons, white text */
    html[data-theme="pink"] nav > ul > li.tab > a {
        background: var(--brand-2);
        color: white;
    }

        html[data-theme="pink"] nav > ul > li.tab > a:hover,
        html[data-theme="pink"] nav > ul > li.tab > a:focus {
            /* slightly darker on hover for affordance */
            filter: brightness(0.95);
            color: white;
        }

        html[data-theme="pink"] nav > ul > li.tab > a.active {
            background: white;
            color: var(--brand-2);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

    html[data-theme="pink"] .input-form footer ul li > button {
        background: var(--brand-2);
        color: white;
    }

        html[data-theme="pink"] .input-form footer ul li > button:hover,
        html[data-theme="pink"] .input-form footer ul li > button:focus {
            filter: brightness(0.96);
            color: white;
        }

        html[data-theme="pink"] .input-form footer ul li > button.active {
            background: white;
            color: var(--brand-2);
        }

body {
    font-family: sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--theme-transition);
}

select#allBabies {
    font-size: 3em;
    width: 100%;
    margin-bottom: 2px;
}

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--brand-1);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
    transition: var(--theme-transition);
}

    /* Primary nav row */
    nav > ul {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px;
        margin: 0;
        overflow-x: auto; /* allow horizontal scroll on very small screens */
        -webkit-overflow-scrolling: touch;
    }

        /* Tab style for common items (Track / Chart / Log)
   Apply class="tab" to the LI elements you want to appear as tabs. */
        nav > ul > li.tab {
            flex: 0 0 auto; /* do not stretch */
            list-style: none;
        }

            nav > ul > li.tab > a {
                display: inline-block;
                padding: 8px 12px;
                border-radius: 999px;
                background: rgba(255,255,255,0.12);
                color: white;
                font-weight: 600;
                text-decoration: none;
                font-size: 1rem;
                line-height: 1;
                box-shadow: none;
                transition: transform .06s ease, background-color .12s ease;
            }

                nav > ul > li.tab > a:hover,
                nav > ul > li.tab > a:focus {
                    background: rgba(255,255,255,0.18);
                    transform: translateY(-1px);
                    outline: none;
                }

                /* Active tab */
                nav > ul > li.tab > a.active {
                    background: white;
                    color: rgb(28, 64, 27);
                    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
                }

        /* Push the menu / dropdown to the right */
        nav > ul > li.dropdown {
            margin-left: auto;
            list-style: none;
        }

/* Hamburger button */
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: var(--theme-transition);
}

    .dropdown-toggle:focus {
        outline: 3px solid rgba(255,255,255,0.18);
    }

/* Dropdown panel */
.dropdown .dropdown-content {
    position: absolute;
    right: 8px;
    top: calc(100% + 8px);
    background: white;
    color: #0f172a;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none;
    padding: 8px 0;
    list-style-type: none;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown .dropdown-content li {
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
}

    .dropdown .dropdown-content li:hover,
    .dropdown .dropdown-content li:focus {
        background: var(--brand-1-12);
    }

    /* Make dropdown items tappable */
    .dropdown .dropdown-content li > a {
        color: inherit;
        text-decoration: none;
        display: block;
        width: 100%;
    }

/* Small-screen adjustments */
@media (max-width: 520px) {
    nav > ul {
        padding: 8px;
        gap: 8px;
    }

        nav > ul > li.tab > a {
            padding: 10px 14px;
            font-size: 0.98rem;
        }
}

ul#mostRecentEntries {
    list-style-type: none;
    padding-inline-start: 0px;
    font-size: 1.5em;
}

ul#tileList {
    list-style-type: none;
    gap: 12px;
    padding-inline-start: 0px;
    margin: 0px 16px;
}

    ul#tileList li {
        padding: 48px;
        border-radius: 12px;
        box-shadow: 0 2px 4px var(--brand-2);
        display: block;
    }

    ul#tileList button {
        font-size: 6rem;
        cursor: pointer;
        border: none;
        background-color: transparent;
        width: 100%;
        height: 120px;
    }

#overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2;
}

.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--brand-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

#errorDialog {
    background-color: rgba(255, 0, 0, 0.20);
    position: relative;
}

#errorMessage {
}

.input-form {
    font-size: 1.5em;
    transition: var(--theme-transition);
}

    .input-form button {
        cursor: pointer;
    }

    .input-form legend {
        font-size: 2em;
    }

    .input-form fieldset {
        border-color: var(--brand-2);
        margin: 4px 0px;
    }

    .input-form select {
        font-size: 1em;
    }

    .input-form input {
        font-size: 1em;
    }

    .input-form footer {
        background-color: var(--brand-1);
        padding: 4px;
    }

        .input-form footer ul {
            list-style-type: none;
            padding-inline-start: 0px;
            margin: 0px;
            padding: 8px;
        }

            .input-form footer ul li {
                display: inline;
                padding: 8px;
                margin: 8px;
            }

                .input-form footer ul li button {
                    display: inline-block;
                    padding: 8px 12px;
                    border-radius: 999px;
                    background: rgba(255,255,255,0.12);
                    color: white;
                    font-weight: 600;
                    font-size: 1em;
                    line-height: 1;
                    text-decoration: none;
                    border: none;
                    cursor: pointer;
                    box-shadow: none;
                    transition: transform .06s ease, background-color .12s ease, box-shadow .12s ease;
                }

                .input-form footer ul li > button:hover,
                .input-form footer ul li > button:focus {
                    background: rgba(255,255,255,0.18);
                    transform: translateY(-1px);
                    outline: none;
                }

/* Compact, touch-friendly tile list and collapsible category styles
   — replaces previous tile-group rules to remove stacked padding/margins,
   increase hit targets, and add a chevron indicator for expand/collapse. */

/* Reset container spacing so there is no cumulative padding/margin */
ul#baby-configuration-tile-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px; /* small gap between categories */
}

/* Each category item */
.tile-group {
    margin: 0;
}

/* Visual container around each category (keeps details semantics) */
.tile-group-details {
    padding: 4px 6px; /* minimal padding so header touch target is comfortable */
    border-radius: 8px;
    background: transparent;
}

/* Summary row (clickable header) */
.tile-group-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px; /* comfortable tap area */
    font-weight: 700; /* slightly heavier title */
    cursor: pointer;
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    /* Remove native disclosure marker */
    .tile-group-summary::-webkit-details-marker {
        display: none;
    }

    .tile-group-summary::marker {
        font-size: 0;
    }

    /* Chevron indicator (pseudo element). Starts pointing right, rotates down when open.
   Uses borders so it inherits color and scales crisply. */
    .tile-group-summary::before {
        content: "";
        display: inline-block;
        width: 10px;
        height: 10px;
        margin-right: 8px;
        border-right: 2px solid var(--muted);
        border-bottom: 2px solid var(--muted);
        transform: rotate(-45deg); /* arrow pointing right */
        transition: transform 140ms ease, border-color 140ms ease;
        flex: 0 0 auto;
    }

    /* When details is open, rotate chevron to point down and tint it to the brand color */
    .tile-group-details[open] > .tile-group-summary::before,
    .tile-group-summary[aria-expanded="true"]::before {
        transform: rotate(45deg); /* arrow pointing down */
        border-color: var(--brand-2);
    }

/* Category title slightly larger than items */
.tile-group-title {
    font-size: 1rem;
    line-height: 1;
}

/* Inner list of tiles — compact and touch-sized items */
.tile-group-list {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    /* Individual selector items — make them clearly tappable on mobile */
    .tile-group-list li {
        padding: 10px 12px; /* adequate touch target (>=44px height) */
        min-height: 44px;
        border-radius: 6px;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.95rem;
        box-sizing: border-box;
    }

/* Desktop: slightly denser */
@media (min-width: 900px) {
    .tile-group-list li {
        padding: 8px 10px;
        min-height: 36px;
        font-size: 0.94rem;
    }
}

/* Hover / focus affordances */
.tile-group-summary:focus,
.tile-group-summary:hover {
    outline: none;
    background: var(--brand-1-12);
    border-radius: 6px;
}

.tile-group-list li:hover,
.tile-group-list li:focus-within {
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* When collapsed, hide the inner list entirely (keeps layout tight) */
.tile-group-details:not([open]) .tile-group-list {
    display: none;
}

/* Slightly tighter spacing on very small screens */
@media (max-width: 520px) {
    ul#baby-configuration-tile-list {
        gap: 6px;
        margin: 0 6px;
    }

    .tile-group-summary {
        padding: 8px 6px;
        font-size: 0.98rem;
    }

    .tile-group-list li {
        padding: 10px 10px;
        font-size: 0.98rem;
        min-height: 44px;
    }
}

.icon-button {
    width: 24px;
    height: 24px;
}

    .icon-button.inline-svg {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px; /* comfortable tap padding */
        min-width: 44px;
        min-height: 44px;
        background: transparent;
        border: none;
        border-radius: 8px;
        box-sizing: border-box;
        cursor: pointer;
    }

        .icon-button.inline-svg:focus,
        .icon-button.inline-svg:focus-visible {
            outline: 3px solid color-mix(in srgb, var(--brand-2) 30%, white 70%);
            outline-offset: 2px;
        }

/* Ensure the inline SVG scales cleanly and is centered */
.inline-svg {
    display: block;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}

/* Slightly larger icon on wider screens */
@media (min-width: 900px) {
    .inline-svg {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }
}

.tooltip-container {
    position: relative;
    display: inline-block; /* keeps it tight around the button */
}

.tooltip {
    position: absolute;
    top: -30px; /* positions above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: black;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .tooltip.show {
        visibility: visible;
        opacity: 1;
    }

.babytracker-list {
    width: 100%;
    display: block;
    box-sizing: border-box;
    padding: 8px;
    gap: 12px;
}

.log-day {
    margin-bottom: 14px;
}

.log-day-label {
    font-weight: 700;
    color: var(--brand-2);
    margin: 8px 4px;
}

.log-day-entries {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.log-entry details,
.log-entry > details {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(11,18,32,0.04);
    overflow: hidden;
    transition: var(--theme-transition);
    border: 1px solid var(--card-border);
}

.entry-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    gap: 12px;
}

    .entry-summary .entry-left {
        display: flex;
        gap: 10px;
        align-items: center;
        min-width: 0;
    }

.entry-title {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text);
}

.entry-type {
    background: var(--brand-1-12);
    color: var(--brand-2);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.entry-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-button {
    width: 34px;
    height: 34px;
    padding: 4px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
}

    .icon-button img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* Details content */
.entry-details {
    padding: 10px 12px 14px 12px;
    border-top: 1px solid var(--card-border);
    color: var(--entry-details-text);
    background: transparent;
}

/* Deleted style */
.deleted-entry {
    opacity: 0.7;
    font-style: italic;
    color: var(--muted);
}

/* hide default marker for consistent look */
details summary::marker {
    display: none;
}

details summary::marker {
    display: none;
}

/* small screens: keep layout tight */
@media (max-width: 520px) {
    .entry-summary {
        padding: 12px 8px;
    }

    .entry-actions {
        gap: 6px;
    }

    .icon-button {
        width: 28px;
        height: 28px;
    }
}

/* optional: expand details by default for desktop */
@media (min-width: 900px) {
    .log-entry details[open] .entry-details { /* no-op, placeholder for future tweaks */
    }
}

/* Sleep chart styles — append to the end of BabyTracker.css */

.sleep-chart {
    padding: 8px 12px;
    display: block;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.sleep-chart-header .ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b6b6b;
    margin: 6px 4px;
    padding-left: 70px; /* align with timeline start */
    padding-right: 12px;
}

.sleep-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.sleep-day-label {
    width: 70px;
    font-size: 0.85rem;
    color: var(--sleep-day-label-color);
    flex: 0 0 70px;
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-align: left;
}

.sleep-day-name {
    font-size: 0.9rem;
    white-space: nowrap;
}

.sleep-day-month {
    font-size: 0.78rem;
}

.sleep-timeline {
    position: relative;
    flex: 1 1 auto;
    min-height: 36px;
    padding: 6px 6px;
    box-sizing: border-box;
    display: block;
    background-image: linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: calc(100% / 24) 100%, calc(100% / 48) 100%;
    background-repeat: repeat-x, repeat-x;
    background-position: left top, left top;
}

    /* marker for non-sleep entries on the sleep timeline */
    .sleep-timeline .timeline-marker {
        position: absolute;
        top: 50%;
        left: 0; /* left is set inline from JS */
        transform: translate(-50%, -50%); /* center horizontally and vertically */
        width: 14px; /* smaller marker */
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        z-index: 4;
    }

        /* slightly smaller icon within the marker so it reads crisp */
        .sleep-timeline .timeline-marker img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }

    /* fallback dot when no image available (e.g. breastfeeding) */
    .sleep-timeline .timeline-marker-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #f59e0b; /* accent (orange) */
        display: inline-block;
    }

    /* baseline track */
    .sleep-timeline .timeline-track {
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        height: 6px;
        transform: translateY(-50%);
        background: linear-gradient(90deg, var(--timeline-track-color), rgba(0,0,0,0.02));
        border-radius: 6px;
        z-index: 1;
    }

    /* segment common */
    .sleep-timeline .seg {
        position: absolute;
        top: 50%;
        height: 16px;
        transform: translateY(-50%);
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        cursor: default;
        z-index: 2;
    }

        /* in-bed: lighter (start -> in bed until end) */
        .sleep-timeline .seg.inbed {
            background: linear-gradient(90deg, var(--inbed-start), var(--inbed-end));
            border: 1px solid var(--inbed-border);
        }

        /* asleep: darker overlay above in-bed */
        .sleep-timeline .seg.asleep {
            background: linear-gradient(90deg, var(--asleep-bg), color-mix(in srgb, var(--asleep-bg) 80%, black 20%));
            opacity: 0.95;
            height: 12px;
        }

        .sleep-timeline .seg.breastfeeding {
            height: 8px;
            background: var(--accent);
            border: none;
            opacity: 0.98;
            border-radius: 6px;
            box-shadow: 0 1px 0 rgba(0,0,0,0.04) inset;
            z-index: 3;
            transform: translateY(-50%);
        }

    /* fallback empty marker */
    .sleep-timeline .no-sleep {
        color: #9aa19a;
        font-size: 0.9rem;
        padding-left: 4px;
    }

/* mobile tweaks */
@media (max-width: 520px) {
    .sleep-day-label {
        flex: 0 0 70px;
        font-size: 0.75rem;
    }

    .sleep-timeline .seg {
        height: 12px;
    }

    .sleep-timeline {
        min-height: 32px;
        padding: 4px 6px;
    }
}

/* Improve touch accessibility: make segments slightly easier to tap */
.sleep-timeline .seg:hover,
.sleep-timeline .seg:active {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* subtle legend (optional) */
.sleep-chart-legend {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: #556;
    margin-top: 8px;
}

    .sleep-chart-legend .legend-item {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .sleep-chart-legend .legend-swatch {
        width: 14px;
        height: 10px;
        border-radius: 3px;
    }

    .sleep-chart-legend .legend-inbed {
        background: linear-gradient(90deg, var(--brand-1-18), rgba(153,183,83,0.12));
        border: 1px solid var(--brand-1-16);
    }

    .sleep-chart-legend .legend-asleep {
        background: var(--asleep-bg);
    }

/* Optional: emphasize quarter/major ticks for wide screens */
@media (min-width: 700px) {
    .sleep-timeline {
        /* overlay a subtle stronger line every 6 hours (4 segments across) */
        background-image: linear-gradient(to right, rgba(0,0,0,0.08) 1px, transparent 1px), linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px);
        /* major every 6h (24/4 = 6), hour, half-hour */
        background-size: calc(100% / 4) 100%, calc(100% / 24) 100%, calc(100% / 48) 100%;
        background-repeat: repeat-x, repeat-x, repeat-x;
    }
}

.segment-list {
    list-style-type: none;
}

.segment-item {
    color: var(--entry-details-text);
}

.diaper-icon {
    width: 100px;
    height: 100px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.diaper-icon--large {
    width: 120px;
    height: 120px;
}

.diaper-icon--small {
    width: 40px;
    height: 40px;
}

/* Compact sizing for bottle amount + units so they don't exceed the description textbox */
.bottle-amount {
    width: 90px;
    max-width: 36%;
    min-width: 64px;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.bottle-units {
    width: 84px;
    max-width: 28%;
    min-width: 64px;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
}

/* Make the description input full width so it visually aligns with the combined controls */
.input-form .description-input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}

/* Slightly tighter widths on very small screens */
@media (max-width: 520px) {
    .bottle-amount {
        width: 72px;
        min-width: 56px;
    }

    .bottle-units {
        width: 68px;
        min-width: 56px;
    }
}