/* CoupleNotes · Soft Nursery design system.
   Tokens first (light, then dark), then layout, then components. Category and list colours are
   applied through .tone-* / .list-* classes that set --tint and --tone, so a chip, a tag and a
   tile of the same category always match. A couple's categories pick one of the eight tones:
   the four original category pairs plus the four list pairs. */

:root {
    --bg: #F6F1FF;
    --surface: #FFFFFF;
    --surface-2: #EFE8FF;
    --ink: #2E2645;
    --ink-2: #5F5679;
    --line: #E5DCF7;
    --primary: #5B3FD0;
    --primary-ink: #4A2FBF;
    --on-primary: #FFFFFF;
    --primary-muted: #B3A6E3;
    --shadow: 0 4px 16px rgba(90, 64, 170, 0.08);
    --shadow-lift: 0 10px 28px rgba(90, 64, 170, 0.16);
    --scrim: rgba(46, 38, 69, 0.42);
    --tag-on-tint: rgba(255, 255, 255, 0.72);

    --new-dot: #E8436E;
    --new-ink: #9E1F4A;
    --new-bg: #FFE4EC;
    --alex-bg: #EFE8FF;
    --sam-bg: #FFEADF;
    --lock-ink: #4B2E91;
    --late: #A3331F;
    --late-bg: #FFF6F3;
    --ok: #2F7D55;
    --ok-ink: #1F6142;
    --ok-bg: #E6F4EC;
    --heart: #E8436E;
    --handle: #DCD2F3;

    /* Habits & Kids */
    --ring-idle: #CFC6E6;
    --skip-ink: #9C93B5;
    --ok-line: #B9E2CB;
    --on-ok: #FFFFFF;
    --card-line: #EEE7FB;
    --surface-soft: #FBF9FF;

    --date-tint: #FFE3D3;   --date-ink: #8A3B12;
    --gift-tint: #DCEBFF;   --gift-ink: #1F4A8A;
    --memory-tint: #D9F2E4; --memory-ink: #1E6B45;
    --love-tint: #FFDFE8;   --love-ink: #8C1D45;

    --groceries-tint: #FFF1C7; --groceries-ink: #7A5300;
    --pharmacy-tint: #D3F1F1;  --pharmacy-ink: #145C5C;
    --home-tint: #EFE8FF;      --home-ink: #4B2E91;
    --other-tint: #F1EEF6;     --other-ink: #4A4458;

    --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, sans-serif;
    --font-hand: 'Caveat', 'Segoe Print', cursive;

    --sidebar-w: 248px;
    --tabbar-h: 72px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16122A;
        --surface: #221C3B;
        --surface-2: #2E2752;
        --ink: #F3EFFF;
        --ink-2: #BDB4DA;
        --line: #3A325E;
        --primary: #B6A5FF;
        --primary-ink: #CFC4FF;
        --on-primary: #1A1238;
        --primary-muted: #4D4478;
        --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
        --shadow-lift: 0 10px 28px rgba(0, 0, 0, 0.45);
        --scrim: rgba(5, 3, 15, 0.62);
        --tag-on-tint: rgba(0, 0, 0, 0.25);
        --new-dot: #FF7FA3;
        --new-ink: #FFB3CA;
        --new-bg: #4D2034;
        --alex-bg: #3A2F66;
        --sam-bg: #4A3226;
        --lock-ink: #D3C6FF;
        --late: #FFA191;
        --late-bg: #3A1F24;
        --ok: #7FD3A6;
        --ok-ink: #A6E6C3;
        --ok-bg: #1B3A2B;
        --handle: #3A325E;

        --ring-idle: #4D4478;
        --skip-ink: #8F86AE;
        --ok-line: #2C5A43;
        --on-ok: #10261B;
        --card-line: #3A325E;
        --surface-soft: #1D1834;

        --date-tint: #4A2C1E;   --date-ink: #FFC7A8;
        --gift-tint: #1D2F50;   --gift-ink: #AECDFF;
        --memory-tint: #173D2D; --memory-ink: #A3E6C3;
        --love-tint: #4D2034;   --love-ink: #FFB3CA;

        --groceries-tint: #463A12; --groceries-ink: #FFE08A;
        --pharmacy-tint: #143A3A;  --pharmacy-ink: #9FE3E3;
        --home-tint: #2E2752;      --home-ink: #D3C6FF;
        --other-tint: #2B2738;     --other-ink: #D9D3E8;
        color-scheme: dark;
    }
}

.tone-rose { --tint: var(--love-tint); --tone: var(--love-ink); }
.tone-peach { --tint: var(--date-tint); --tone: var(--date-ink); }
.tone-sky { --tint: var(--gift-tint); --tone: var(--gift-ink); }
.tone-mint { --tint: var(--memory-tint); --tone: var(--memory-ink); }
.tone-butter { --tint: var(--groceries-tint); --tone: var(--groceries-ink); }
.tone-teal { --tint: var(--pharmacy-tint); --tone: var(--pharmacy-ink); }
.tone-lilac { --tint: var(--home-tint); --tone: var(--home-ink); }
.tone-stone { --tint: var(--other-tint); --tone: var(--other-ink); }
.list-groceries { --tint: var(--groceries-tint); --tone: var(--groceries-ink); }
.list-pharmacy { --tint: var(--pharmacy-tint); --tone: var(--pharmacy-ink); }
.list-home { --tint: var(--home-tint); --tone: var(--home-ink); }
.list-other { --tint: var(--other-tint); --tone: var(--other-ink); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--primary-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
h1:focus { outline: none; }

.display { font-family: var(--font-display); font-weight: 600; }
.hand { font-family: var(--font-hand); font-weight: 700; }
.hand--accent { color: var(--primary); font-size: 1.1em; margin-left: 6px; }
.meta { font-size: 14px; color: var(--ink-2); }
.eyebrow { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.accent { color: var(--primary); }
.late { color: var(--late); }
.ok { color: var(--ok); }

.sr-only, .sr-only-focusable:not(:focus) {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Shell ---------- */

.app-shell { min-height: 100vh; display: flex; }
.app-main { flex: 1; min-width: 0; }

.sidebar { display: none; }

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px 12px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr));
}
/* Four or five tabs (Extras on) still fit a 390 px phone: tighter labels and icon pills. */
.tabbar--many { padding: 6px 6px env(safe-area-inset-bottom); gap: 2px; }
.tabbar--many .tabbar__link { font-size: 12px; }
.tabbar--many .tabbar__icon { width: 52px; }

.tabbar__link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 13px; font-weight: 700; line-height: 1.15; text-align: center;
}
.tabbar__icon { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.tabbar__link.active { color: var(--primary); font-weight: 800; }
.tabbar__link.active .tabbar__icon { background: var(--surface-2); }

@media (min-width: 900px) {
    .tabbar { display: none; }
    .sidebar {
        display: flex; flex-direction: column; gap: 24px;
        width: var(--sidebar-w); flex-shrink: 0;
        height: 100vh; position: sticky; top: 0;
        padding: 28px 20px;
    }
    .sidebar__brand { display: flex; align-items: center; gap: 12px; }
    .sidebar__names { font-size: 20px; line-height: 1.15; }
    .sidebar__nav { display: flex; flex-direction: column; gap: 6px; }
    .sidebar__link {
        min-height: 48px; padding: 0 14px; border-radius: 16px;
        display: flex; align-items: center; gap: 12px;
        color: var(--ink-2); text-decoration: none;
        font-family: var(--font-display); font-size: 17px; font-weight: 500;
    }
    .sidebar__link:hover { background: var(--surface-2); color: var(--ink); }
    .sidebar__link.active { background: var(--surface); color: var(--primary-ink); font-weight: 600; box-shadow: var(--shadow); }
}

.page { max-width: 760px; margin: 0 auto; padding: 20px 20px calc(var(--tabbar-h) + 40px); }
.page--with-capture { padding-bottom: calc(var(--tabbar-h) + 132px); }
.page--narrow { max-width: 520px; }
.page--wide { max-width: 1160px; }
.only-wide { display: none; }
@media (min-width: 900px) {
    .only-wide { display: block; }
    .only-narrow { display: none; }
}
@media (min-width: 900px) {
    .page { padding: 32px 32px 48px; }
    .page--with-capture { padding-bottom: 140px; }
}

/* ---------- Auth pages (Identity) ---------- */

.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 48px; gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; font-size: 26px; }
.auth-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: 28px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 28px; margin-bottom: 8px; }
.auth-card h2, .auth-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 18px; color: var(--ink-2); margin-bottom: 12px; }
.auth-card hr { display: none; }
.auth-card .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); border-radius: 26px; font-family: var(--font-display); font-weight: 600; min-height: 52px; }
.auth-card .form-control { border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.auth-card .form-control:focus { border-color: var(--primary); box-shadow: none; }
.auth-card .col-lg-6, .auth-card .col-lg-4, .auth-card .col-md-4, .auth-card .col-md-6 { width: 100%; max-width: 100%; flex: 1 1 100%; margin-left: 0; }

/* ---------- Page header ---------- */

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-header__text { display: flex; flex-direction: column; min-width: 0; }
.page-title { font-size: 30px; line-height: 1.1; margin-top: 2px; }

.new-pill {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 44px; margin: 4px 0 -4px -2px; padding: 0 14px 0 12px;
    border: 0; border-radius: 22px;
    background: var(--new-bg); color: var(--new-ink);
    font-size: 14px; font-weight: 800; text-decoration: none;
}
.new-pill.is-on { background: var(--new-dot); color: #FFFFFF; }
.new-pill.is-on .dot { background: #FFFFFF; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--new-dot); flex-shrink: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* ---------- Search & chips ---------- */

.search {
    display: flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 16px;
    background: var(--surface); border-radius: 24px; box-shadow: var(--shadow);
    color: var(--ink-2);
}
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); }
.search:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 20px 4px; margin: 0 -20px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
    height: 44px; padding: 0 14px 0 12px;
    border: 0; border-radius: 22px;
    background: var(--tint); color: var(--tone);
    font-family: var(--font-display); font-size: 15px; font-weight: 500; white-space: nowrap;
}
.chip__count { font-family: var(--font-body); font-size: 13px; font-weight: 800; opacity: 0.85; }
.chip.is-on { background: var(--tone); color: var(--tint); }
.chip--all { --tint: var(--surface); --tone: var(--primary-ink); box-shadow: var(--shadow); }
.chip--all.is-on { background: var(--primary); color: var(--on-primary); box-shadow: none; }
/* Dashed = make something new, here and on tiles. */
.chip--new { --tint: transparent; --tone: var(--primary-ink); border: 2px dashed var(--primary-muted); padding-left: 10px; gap: 6px; }
.chip { -webkit-touch-callout: none; user-select: none; }

/* ---------- Sections ---------- */

.section-title { font-size: 30px; line-height: 1.1; margin: 18px 4px 6px; }
.section-title--small { font-size: 28px; margin-top: 16px; }
.section-title--flush { margin: 0 0 8px; }
.section-title.late { color: var(--late); }
.section-title.done { color: var(--ok); }
.section-hint { display: flex; align-items: center; gap: 6px; margin: -2px 4px 8px; }

.carousel { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 6px 20px 14px; margin: 0 -20px; }
.carousel::-webkit-scrollbar { display: none; }
.carousel--bleed { padding: 2px 14px 8px; margin: 0 -14px; }

/* ---------- Notes ---------- */

.tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px 4px 8px; border-radius: 12px;
    background: var(--tint); color: var(--tone);
    font-family: var(--font-display); font-size: 13px; font-weight: 600;
}
.tag--on-tint { background: var(--tag-on-tint); }

.kept-card {
    flex-shrink: 0; width: 240px; min-height: 168px;
    padding: 14px 16px; border-radius: 24px;
    background: var(--tint); color: var(--ink);
    display: flex; flex-direction: column; gap: 8px;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    position: relative;
}
.kept-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kept-card__body { flex: 1; font-size: 16px; font-weight: 700; line-height: 1.35; }
.kept-card__meta { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--tone); }
.kept-card .new-flag { color: var(--tone); }

.love-title { font-size: 26px; line-height: 1; color: var(--tone); }

.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px; border-radius: 22px;
    background: var(--surface); box-shadow: var(--shadow);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    position: relative;
}
.note-card .blob { flex-shrink: 0; }
.note-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.note-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-card__body { font-size: 16px; font-weight: 600; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.note-card__meta { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.new-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--new-ink); flex-shrink: 0; }
.seen-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); flex-shrink: 0; }
.lock-flag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--lock-ink); }

/* A note card opens with one real button stretched over it; Keep close sits above it for keyboards. */
.card-open { position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.card-open:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.details-peek {
    display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0;
    font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.details-peek > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kept-card .details-peek { color: var(--tone); font-weight: 700; }
.mini-btn { position: absolute; z-index: 2; top: 8px; right: 8px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: var(--surface); color: var(--primary-ink); font-size: 13px; font-weight: 800; box-shadow: var(--shadow); }

@media (min-width: 900px) {
    .note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; gap: 14px; }
    .chips, .carousel { flex-wrap: wrap; overflow: visible; margin: 0; padding-left: 0; padding-right: 0; }
}

/* ---------- Capture bar ---------- */

.capture-wrap {
    position: fixed; z-index: 25;
    left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 8px 12px;
    background: var(--bg);
}
@media (min-width: 900px) {
    .capture-wrap { left: var(--sidebar-w); bottom: 0; padding: 12px 32px 20px; }
}
.capture-wrap > * { max-width: 736px; margin-left: auto; margin-right: auto; }

.capture {
    display: flex; align-items: center; gap: 6px;
    padding: 6px; border-radius: 28px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.capture__category {
    flex-shrink: 0; height: 44px; padding: 0 8px 0 10px;
    display: inline-flex; align-items: center; gap: 3px;
    border: 1.5px dashed var(--tone); border-radius: 16px;
    background: var(--tint); color: var(--tone);
}
.capture__field { flex: 1; min-width: 0; display: flex; }
.capture__field--padded { padding-left: 10px; }
.capture__field input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); }
.capture:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }

.capture-menu {
    width: 270px; margin: 0 0 8px; padding: 12px;
    border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lift);
    display: flex; flex-direction: column; gap: 4px;
}
.capture-wrap > .capture-menu { margin-left: 0; }
.capture-menu__title { padding: 0 6px 6px; font-weight: 800; }
.capture-menu__item {
    min-height: 48px; padding: 6px 8px; border: 0; border-radius: 14px; background: transparent;
    display: flex; align-items: center; gap: 10px; text-align: left; font-size: 16px; font-weight: 700;
}
.capture-menu__item[aria-pressed="true"] { background: var(--surface-2); }
.capture-menu__item > span:nth-child(2) { flex: 1; }
.tile { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.tile--new { --tint: transparent; --tone: var(--primary-ink); border: 2px dashed var(--primary-muted); }
.capture-menu__item--new { color: var(--primary-ink); font-weight: 800; }

.parse-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 8px 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.parse-preview strong { color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 8px 18px;
    border: 0; border-radius: 24px;
    font-family: var(--font-display); font-size: 16px; font-weight: 600; text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.55; }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(91, 63, 208, 0.25); }
.btn--soft { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow); }
.btn--ok { background: var(--ok-bg); color: var(--ok-ink); font-family: var(--font-body); font-size: 15px; font-weight: 800; }
.btn--block { width: 100%; min-height: 56px; border-radius: 28px; font-size: 18px; }
.btn--big { min-height: 56px; padding: 10px 26px; border-radius: 28px; font-size: 18px; }
.btn--grow { flex: 1; min-height: 56px; border-radius: 28px; font-size: 18px; }

.icon-btn {
    width: 44px; height: 44px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 22px; background: transparent; color: var(--ink-2);
}
.icon-btn--primary { background: var(--primary); color: var(--on-primary); }
.icon-btn--primary:disabled { background: var(--primary-muted); }
.icon-btn--soft { background: var(--surface-2); color: var(--primary-ink); }
.icon-btn--raised { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow); }
.icon-btn--small { width: 36px; height: 36px; margin: -8px -4px -8px 0; }

.text-btn { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--primary-ink); font-size: 15px; font-weight: 800; }
.text-btn--danger { color: var(--late); }

.take-btn {
    flex-shrink: 0; max-width: 128px; min-height: 44px; padding: 6px 12px;
    border: 1.5px dashed var(--primary); border-radius: 22px;
    background: var(--bg); color: var(--primary-ink);
    font-family: var(--font-display); font-size: 14px; font-weight: 600; line-height: 1.15;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed; z-index: 60;
    left: 50%; transform: translateX(-50%);
    bottom: calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
    width: max-content; max-width: calc(100vw - 32px);
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 20px;
    background: var(--ink); color: var(--bg);
    font-size: 15px; font-weight: 700; box-shadow: var(--shadow-lift);
    animation: toast-in 0.18s ease-out;
}
.toast--high { bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.toast__heart { color: #FF6B8A; }
@media (min-width: 900px) { .toast, .toast--high { bottom: 104px; margin-left: calc(var(--sidebar-w) / 2); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Sheet ---------- */

.sheet-backdrop {
    position: fixed; inset: 0; z-index: 50;
    background: var(--scrim);
    display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
    width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
    background: var(--surface); color: var(--ink);
    border-radius: 32px 32px 0 0;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
    animation: sheet-in 0.2s ease-out;
}
@media (min-width: 700px) {
    .sheet-backdrop { align-items: center; }
    .sheet { border-radius: 28px; padding-bottom: 24px; }
    .sheet__handle { display: none; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } }
.sheet__handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.sheet__body { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label { font-size: 14px; font-weight: 800; color: var(--ink-2); padding: 0; }
.field input, .field textarea, .field select, .inline-form input {
    border: 2px solid var(--line); border-radius: 16px;
    padding: 12px 14px; min-height: 50px;
    background: var(--bg); color: var(--ink);
    font-size: 16px; font-weight: 600; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field--inline { flex-direction: row; align-items: center; gap: 10px; margin-top: 10px; }
.field--inline input { width: auto; }
.field--grow { flex: 1; min-width: 200px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 6px; }
.form-error { color: var(--late); font-weight: 700; font-size: 15px; }
.form-ok { color: var(--ok); font-weight: 700; font-size: 15px; }
.form-actions { display: flex; align-items: center; gap: 10px; }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-tile {
    min-height: 52px; padding: 6px 10px;
    display: flex; align-items: center; gap: 8px; text-align: left;
    border: 2px solid var(--line); border-radius: 16px;
    background: var(--surface); color: var(--tone);
    font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.15;
}
.pick-tile.is-on { background: var(--tint); border-color: var(--tone); }
.pick-tile--new { --tone: var(--primary-ink); border-style: dashed; border-color: var(--primary-muted); background: transparent; }
.pick-tile__icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; background: var(--tint); display: flex; align-items: center; justify-content: center; }

.radio-card { display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 20px; overflow: hidden; }
.radio-card__row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; cursor: pointer; }
.radio-card__row + .radio-card__row { border-top: 1px solid var(--line); }
.radio-card__row.is-on { background: var(--surface-2); }
.radio-card__row input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.radio-card__text { display: flex; flex-direction: column; gap: 2px; }
.radio-card__label { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; }

.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 24px; background: var(--surface-2); }
.seg__btn { min-height: 44px; padding: 4px 6px; border: 0; border-radius: 20px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 800; line-height: 1.15; text-align: center; }
.seg__btn.is-on { background: var(--surface); color: var(--primary-ink); box-shadow: 0 2px 8px rgba(90, 64, 170, 0.18); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 800; }
.pill.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill--dashed { min-height: 38px; border-style: dashed; color: var(--primary-ink); font-size: 14px; }

.days { display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; }
.day { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.day.is-on { background: var(--surface-2); border-color: var(--primary); color: var(--primary-ink); }

.settings { display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: 20px; overflow: hidden; }
.settings__row {
    display: flex; align-items: center; gap: 12px;
    min-height: 58px; padding: 8px 14px;
    border: 0; background: var(--surface); text-align: left; width: 100%;
}
.settings__row + .settings__row { border-top: 1px solid var(--line); }
.settings__text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.settings__label { font-size: 16px; font-weight: 800; }
.settings__input { border: 0; background: transparent; color: var(--primary-ink); font-weight: 700; text-align: right; max-width: 55%; min-height: 44px; }

.switch { width: 52px; height: 32px; flex-shrink: 0; padding: 3px; border-radius: 16px; background: var(--line); display: flex; transition: background 0.15s; }
.switch span { width: 26px; height: 26px; border-radius: 13px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch.is-on { background: var(--primary); }
.switch.is-on span { transform: translateX(20px); }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 2px solid var(--line); border-radius: 26px; align-self: flex-start; margin-bottom: 8px; }
.stepper__value { min-width: 56px; text-align: center; font-family: var(--font-display); font-size: 22px; font-weight: 600; }

/* ---------- Fridge (Home & lists) ---------- */

.fridge {
    position: relative;
    margin: 8px -8px 0; padding: 14px 14px 20px;
    border-radius: 32px; background: var(--surface);
    box-shadow: 0 -2px 0 var(--line), var(--shadow-lift);
}
.fridge__handle { position: absolute; top: 22px; right: -5px; width: 8px; height: 72px; border-radius: 4px; background: var(--handle); }

.summary {
    position: relative; margin: 10px 2px 4px; padding: 16px;
    border-radius: 22px; background: var(--love-tint); color: var(--love-ink);
    display: flex; align-items: center; gap: 12px;
}
.summary__title { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; }
.summary__sub { font-size: 14px; font-weight: 700; }
.magnet { position: absolute; top: -9px; width: 22px; height: 22px; border-radius: 11px; box-shadow: 0 2px 0 rgba(46, 38, 69, 0.15), inset -3px -3px 0 rgba(0, 0, 0, 0.08); }
.magnet--pink { left: 18px; background: #E8436E; }
.magnet--lilac { right: 18px; background: #B9A2FF; }

.list-card {
    position: relative; flex-shrink: 0;
    width: 148px; min-height: 112px; padding: 12px 14px;
    border: 0; border-radius: 22px;
    background: var(--tint); color: var(--tone);
    display: flex; flex-direction: column; gap: 6px; text-decoration: none; text-align: left;
}
.list-card__magnet { position: absolute; top: -6px; right: 16px; width: 18px; height: 18px; border-radius: 9px; background: var(--tone); box-shadow: 0 2px 0 rgba(46, 38, 69, 0.15); }
.list-card__icon { width: 36px; height: 36px; border-radius: 12px; background: var(--tag-on-tint); display: flex; align-items: center; justify-content: center; }
.list-card__name { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.15; }
.list-card__count { font-size: 14px; font-weight: 800; }
.list-card--new { --tint: transparent; --tone: var(--primary-ink); width: 116px; border: 2px dashed var(--primary-muted); align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.lrow {
    display: flex; align-items: center; gap: 2px;
    min-height: 64px; padding: 8px 8px 8px 2px;
    border: 1px solid var(--line); border-radius: 20px;
    background: var(--surface);
}
.lrow--late { background: var(--late-bg); }
.lrow--done { background: transparent; border-style: dashed; }
.lrow--basket { min-height: 52px; background: transparent; border: 0; }
.lrow--flash { background: var(--tint); transition: background 0.4s; }
.lrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.lrow__main--button { border: 0; background: transparent; padding: 4px 0; text-align: left; min-height: 48px; justify-content: center; }
.lrow__title { border: 0; background: transparent; padding: 0; text-align: left; font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.lrow__title--static { cursor: inherit; }
.lrow__title--struck { flex: 1; color: var(--ink-2); text-decoration: line-through; }
.lrow__meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 2px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.lrow__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.lrow__meta .turns { color: var(--lock-ink); }

.check { width: 44px; height: 44px; flex-shrink: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.check__box { width: 26px; height: 26px; border-radius: 9px; border: 2.5px solid var(--primary-muted); background: var(--surface); display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.check--late .check__box { border-color: var(--late); }
.check--list .check__box { border-color: var(--tone); }
.check--done .check__box { background: var(--ok); border-color: var(--ok); }
.check:hover .check__box { border-color: var(--primary); }

.who-btn { min-width: 48px; height: 48px; flex-shrink: 0; padding: 0 2px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.who-btn__second { margin-left: -16px; display: flex; }

.link-chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; margin-top: 2px; padding: 4px 10px 4px 8px;
    border-radius: 18px; background: var(--tint); color: var(--tone);
    font-size: 14px; font-weight: 800; text-decoration: none;
}

.thanks-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; margin-top: 4px; padding: 0 12px 0 10px;
    border: 1.5px solid #F2B8C8; border-radius: 18px;
    background: var(--surface); color: var(--love-ink);
    font-size: 14px; font-weight: 800;
}
.thanks-btn svg { color: var(--heart); }
.thanks-btn.is-on { background: var(--love-tint); }

/* ---------- Shopping list ---------- */

.list-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.list-header__icon { width: 54px; height: 54px; flex-shrink: 0; border-radius: 18px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.list-header__text { flex: 1; min-width: 0; }

.linked-chore { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 20px; background: var(--bg); }
.linked-chore__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.linked-chore__title { font-weight: 800; color: var(--ink); text-decoration: none; }

.suggest { margin-top: 12px; padding: 10px 6px 12px 14px; border: 1.5px dashed var(--line); border-radius: 20px; display: flex; flex-direction: column; gap: 6px; }
.suggest--soft { border: 0; background: var(--bg); padding: 12px 14px; }
.suggest__head { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--ink-2); }
.suggest__head span { flex: 1; }
.suggest__title { font-size: 26px; line-height: 1; }
.suggest__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.list-ink { color: var(--tone); }

.qty-chip {
    min-height: 44px; padding: 0 12px 0 10px;
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; border-radius: 22px; background: var(--tint); color: var(--tone);
    font-size: 15px; font-weight: 800;
}
.qty-chip__freq { font-size: 13px; font-weight: 700; opacity: 0.85; }
.qty-pill { padding: 1px 8px; border-radius: 10px; background: var(--tint); color: var(--tone); font-weight: 800; }

.basket-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.basket-head .section-title { margin-bottom: 4px; }

.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin-top: 24px; }

.trips { display: flex; flex-direction: column; gap: 8px; }
.trip { border: 2px solid var(--line); border-radius: 20px; overflow: hidden; }
.trip.is-on { border-color: var(--primary); background: var(--bg); }
.trip__head { width: 100%; min-height: 64px; padding: 10px 14px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; }
.trip__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trip__preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip__lines { padding: 0 14px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.radio-dot { width: 22px; height: 22px; flex-shrink: 0; border-radius: 11px; border: 2px solid var(--ink-2); }
.trip.is-on .radio-dot { border-color: var(--primary); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 11px var(--primary); }

.pick-chip {
    min-height: 44px; padding: 0 12px 0 10px;
    display: inline-flex; align-items: center; gap: 6px;
    border: 2px solid var(--line); border-radius: 22px;
    background: var(--surface); color: var(--tone);
    font-size: 15px; font-weight: 800;
}
.pick-chip.is-on { background: var(--tint); border-color: var(--tone); }
.pick-chip--onlist { border-style: dashed; background: var(--bg); color: var(--ink-2); }

/* ---------- Us & join ---------- */

.card { background: var(--surface); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.partner { display: flex; align-items: center; gap: 12px; }
.partner__name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.pending { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--bg); }
.pending__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-actions form { margin: 0; }

.join { align-items: center; text-align: center; padding: 32px 24px; margin-top: 24px; gap: 14px; }
.join__title { font-size: 36px; line-height: 1.05; }
.join__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }

/* ---------- Empty & loading ---------- */

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty--compact { padding: 20px 12px; }
.empty__title { font-size: 34px; line-height: 1.05; color: var(--ink); }
.empty p { max-width: 320px; font-size: 16px; font-weight: 600; }
.empty .btn { margin-top: 8px; }

.skeleton-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.skeleton { height: 88px; border-radius: 22px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none; position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0;
    padding: 12px 20px; background: var(--late-bg); color: var(--late); font-weight: 700;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
}
#blazor-error-ui .reload { margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; border: 0; background: transparent; color: inherit; font-size: 20px; }

.blazor-error-boundary { padding: 16px; border-radius: 16px; background: var(--late-bg); color: var(--late); }
.blazor-error-boundary::after { content: "Something went wrong here."; }

.validation-message, .text-danger { color: var(--late); }

/* Category sheet: live preview, eight colours, the icon picker. */
.cat-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px; border-radius: 22px; background: var(--bg); }
/* One row of eight: each cell is the ~44 px tap target, the dot inside shows the colour. */
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 440px; }
.swatch { height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.swatch__dot {
    width: 36px; height: 36px; box-sizing: border-box; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--tint); color: var(--tone); border: 3px solid var(--tint);
    box-shadow: 0 0 0 2px var(--line);
}
.swatch.is-on .swatch__dot { border-color: var(--tone); box-shadow: 0 0 0 2px var(--surface); }
.icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.icon-pick {
    height: 48px; box-sizing: border-box; border-radius: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.icon-pick.is-on { background: var(--tint); color: var(--tone); border-color: var(--tone); }
.swatch:has(input:focus-visible) .swatch__dot, .icon-pick:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.cat-delete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cat-delete .meta { flex: 1; min-width: 160px; }
.btn--danger-soft { background: var(--late-bg); color: var(--late); font-family: var(--font-body); font-size: 15px; font-weight: 800; }
.btn--small { padding: 4px 16px; font-size: 15px; }

.cat-list { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cat-list__row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.cat-list__name { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; }

/* Note detail sheet. */
.note-view { display: flex; flex-direction: column; gap: 14px; }
.note-view > .tag { align-self: flex-start; font-size: 15px; padding: 6px 12px 6px 10px; border-radius: 16px; }
.note-view__body { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.note-view__details { padding: 14px 16px; border-radius: 20px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.note-view__details p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-view__label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.note-view__by { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.note-view__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note-view__actions .btn--soft { background: var(--surface-2); box-shadow: none; }
.btn--keep { background: var(--tint); color: var(--tone); }
.btn--keep.is-on { background: var(--tone); color: var(--tint); }
.btn--danger { background: var(--late); color: var(--surface); }
.confirm { padding: 14px 16px; border-radius: 20px; background: var(--late-bg); color: var(--late); display: flex; flex-direction: column; gap: 10px; }
.confirm__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.add-details {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 16px 0 12px;
    border: 2px dashed var(--primary-muted); border-radius: 22px; background: transparent;
    color: var(--primary-ink); font-family: var(--font-display); font-size: 15px; font-weight: 500;
}

/* ---------- Us · Extras ---------- */

.settings--flat { border: 0; border-radius: 0; overflow: visible; }
.settings--flat .settings__row { padding: 10px 0; background: transparent; }
.settings--flat .settings__row + .settings__row { border-top: 1px solid var(--surface-2); }
.extra { align-items: center; }
.extra[aria-disabled="true"] { cursor: default; }
.extra__tile { width: 44px; height: 44px; flex-shrink: 0; border-radius: 15px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.extra__label { font-family: var(--font-display); font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.extra .meta { line-height: 1.35; font-weight: 600; }
.soon { padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-family: var(--font-body); font-size: 12px; font-weight: 800; }
.extras-note { margin-top: 6px; padding: 10px 12px; border-radius: 16px; background: var(--bg); color: var(--lock-ink); font-size: 13px; font-weight: 700; line-height: 1.4; }

/* ---------- Option chips, cards and steppers (habit sheet) ---------- */

.field__optional { font-weight: 600; }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
    min-height: 40px; padding: 0 14px;
    border: 2px solid var(--line); border-radius: 20px;
    background: var(--surface); color: var(--ink);
    font-size: 14px; font-weight: 800;
}
.opt.is-on { background: var(--surface-2); border-color: var(--primary); color: var(--primary-ink); }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt-card {
    min-height: 64px; padding: 8px 12px;
    border: 2px solid var(--line); border-radius: 18px;
    background: var(--surface); color: var(--ink);
    display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left;
}
.opt-card--short { min-height: 52px; padding: 6px 12px; }
.opt-card--center { align-items: center; text-align: center; min-height: 56px; }
.opt-card.is-on { background: var(--surface-2); border-color: var(--primary); }
.opt-card__label { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.opt-card.is-on .opt-card__label { color: var(--primary-ink); }
.opt-card--short .opt-card__label { font-family: var(--font-body); font-size: 15px; font-weight: 800; }
.opt-card__hint { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.opt-card--short .opt-card__hint { font-size: 12px; }

.goal-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 20px; background: var(--bg); }
.goal-panel__custom { margin-top: 6px; }
.goal-panel__sentence { font-size: 14px; font-weight: 700; color: var(--lock-ink); margin-top: 6px; }
.goal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mini-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 22px; background: var(--surface); }
.mini-seg button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 19px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 800; }
.mini-seg button.is-on { background: var(--primary); color: var(--on-primary); }
.mini-seg--soft { background: var(--surface-2); }
.mini-seg--soft button { min-height: 36px; border-radius: 17px; font-size: 13px; }
.mini-seg--soft button.is-on { background: var(--surface); color: var(--primary-ink); }
.goal-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 22px; background: var(--surface); }
.goal-stepper__value { display: inline-flex; align-items: baseline; gap: 4px; padding: 0 4px; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.goal-stepper__value input {
    width: 3.2em; field-sizing: content; min-width: 1.6em; min-height: 0; padding: 0; border: 0; border-bottom: 2px dashed var(--line); border-radius: 0;
    background: transparent; color: var(--ink); text-align: center; font: inherit; -moz-appearance: textfield;
}
.goal-stepper__value input::-webkit-outer-spin-button, .goal-stepper__value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goal-stepper__value input:focus { outline: none; border-bottom-color: var(--primary); }
.step-btn { width: 38px; height: 38px; flex-shrink: 0; border: 0; border-radius: 19px; background: var(--surface-2); color: var(--primary-ink); font-size: 20px; font-weight: 800; line-height: 1; }
.step-btn:disabled { opacity: 0.45; }
.step-btn--big { width: 56px; height: 56px; border-radius: 28px; font-size: 28px; }
.step-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; font-weight: 700; }
.step-line .step-btn { width: 40px; height: 40px; border-radius: 20px; }
.step-line__value { min-width: 1.5em; text-align: center; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.wdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.wday { height: 44px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--primary-ink); font-size: 14px; font-weight: 800; }
.wday.is-on { background: var(--primary); color: var(--on-primary); }
.cat-opt {
    min-height: 40px; padding: 0 12px 0 10px;
    display: inline-flex; align-items: center; gap: 5px;
    border: 2px solid var(--line); border-radius: 20px;
    background: var(--surface); color: var(--tone);
    font-family: var(--font-display); font-size: 14px; font-weight: 500;
}
.cat-opt.is-on { background: var(--tint); border-color: var(--tone); }
.cat-opt--new { --tone: var(--primary-ink); border-style: dashed; border-color: var(--primary-muted); background: transparent; }
.starts-line { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.btn--tint { background: var(--surface-2); color: var(--primary-ink); font-size: 15px; }
.btn--quiet { min-height: 56px; padding: 0 20px; border-radius: 28px; background: var(--bg); color: var(--ink-2); font-size: 17px; }

/* ---------- Habits: today ---------- */

.habits-header { align-items: flex-end; flex-wrap: wrap; }
.habits-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.week-strip {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    margin: 0 -8px 4px; padding: 8px 6px; border-radius: 24px;
    background: var(--surface); box-shadow: var(--shadow);
}
.week-strip__day {
    min-height: 64px; padding: 4px 0; border: 0; border-radius: 18px;
    background: transparent; color: var(--ink);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.week-strip__day.is-on { background: var(--surface-2); }
.week-strip__day.is-future { color: var(--skip-ink); cursor: default; }
.week-strip__name { font-size: 12px; font-weight: 800; letter-spacing: 0.3px; }
.week-strip__track { stroke: var(--surface-2); }
.week-strip__day.is-on .week-strip__track { stroke: var(--surface); }
.week-strip__day.is-today .week-strip__track { stroke: var(--ring-idle); }
.week-strip__fill { stroke: var(--primary); }
.week-strip__fill.is-full { stroke: var(--ok); }
.week-strip--compact { display: flex; gap: 4px; margin: 0; padding: 6px; border-radius: 22px; }
.week-strip--compact .week-strip__day { width: 40px; min-height: 0; padding: 2px 0; gap: 2px; border-radius: 14px; color: var(--ink-2); }
.week-strip--compact .week-strip__name { font-size: 11px; }

.habits-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.habits-layout > * { min-width: 0; }
@media (min-width: 900px) {
    .habits-layout { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
    .habits-panel { padding: 20px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
}

.habit-group { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 6px 6px; }
.habit-group__title { font-size: 30px; line-height: 1.05; }
.habit-group__count { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.habit-cards { display: flex; flex-direction: column; gap: 8px; }

.habit-card {
    min-height: 72px; padding: 8px 10px 8px 2px;
    border: 1.5px solid var(--card-line); border-radius: 22px;
    background: var(--surface);
    display: flex; align-items: center; gap: 2px;
}
.habit-card.is-done { background: var(--ok-bg); border-color: var(--ok-line); }
.habit-card.is-skipped { background: var(--surface-soft); border-style: dashed; border-color: var(--ring-idle); }
.habit-card.is-selected { border: 2px solid var(--primary); }
.habit-check { width: 48px; height: 48px; flex-shrink: 0; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.habit-ring {
    width: 30px; height: 30px; box-sizing: border-box; border-radius: 15px;
    border: 2.5px solid var(--ring-idle); background: transparent; color: var(--on-ok);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.habit-ring--small { width: 26px; height: 26px; border-width: 2px; }
.is-done > .habit-check .habit-ring, .habit-ring.is-done { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.is-skipped > .habit-check .habit-ring, .habit-ring.is-skipped { border-style: dashed; border-color: var(--skip-ink); color: var(--skip-ink); }
.is-missed > .habit-check .habit-ring, .habit-ring.is-missed { border-color: var(--late); color: var(--late); }
.habit-ring svg[stroke] path[d="M12 12h.01"] { stroke-width: 7; }
.habit-check:hover .habit-ring { border-color: var(--primary); }
.habit-card__open {
    flex: 1; min-width: 0; min-height: 56px; padding: 2px 4px;
    border: 0; background: transparent; color: var(--ink); text-align: left;
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.habit-card__title { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.habit-card__name { min-width: 0; font-size: 16px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.is-skipped .habit-card__name { color: var(--ink-2); }
.habit-card__cat { flex-shrink: 0; width: 22px; height: 22px; border-radius: 8px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.habit-card__meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.habit-streak { display: inline-flex; align-items: center; gap: 3px; color: var(--late); }
.habit-bar { display: flex; align-items: center; gap: 8px; }
.habit-bar__track { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: flex; }
.is-done .habit-bar__track { background: var(--surface); }
.habit-bar__fill { background: var(--primary); border-radius: 4px; }
.habit-bar__fill.is-met { background: var(--ok); }
.habit-bar__fill.is-over { background: var(--late); }
.habit-bar__amount { flex-shrink: 0; font-size: 14px; font-weight: 800; }
.habit-pips { display: flex; align-items: center; gap: 4px; }
.habit-pip { width: 12px; height: 12px; box-sizing: border-box; border-radius: 6px; border: 2px solid var(--ring-idle); }
.habit-pip.is-on { background: var(--ok); border-color: var(--ok); }
.habit-step {
    min-height: 44px; flex-shrink: 0; padding: 0 12px; border: 0; border-radius: 22px;
    background: var(--gift-tint); color: var(--gift-ink);
    font-family: var(--font-display); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.habit-step.is-over { background: var(--late-bg); color: var(--late); }
.habit-skip {
    min-height: 44px; flex-shrink: 0; padding: 0 10px; border: 0; border-radius: 22px;
    background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 800;
    display: inline-flex; align-items: center; gap: 4px;
}
.cheer-btn {
    min-height: 40px; flex-shrink: 0; padding: 0 12px 0 10px;
    border: 1.5px solid #F2B8C8; border-radius: 20px;
    background: var(--surface); color: var(--love-ink);
    font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px;
}
.cheer-btn svg { color: var(--heart); }
.cheer-btn.is-on { background: var(--love-tint); }
.cheer-btn:disabled { cursor: default; }

.rest-note {
    margin: 18px 6px 0; padding: 12px 14px; border-radius: 18px; border: 2px dashed var(--ring-idle);
    color: var(--ink-2); font-size: 14px; font-weight: 700; display: flex; gap: 8px; align-items: flex-start;
}
.rest-note svg { flex-shrink: 0; margin-top: 1px; }

.feature-off__tile { width: 88px; height: 88px; border-radius: 30px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.feature-off { margin-top: 24px; }

/* ---------- Habits: log sheet ---------- */

.log-goal { margin-top: -10px; font-weight: 700; }
.log-dial { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 0; }
.log-dial__track { stroke: var(--gift-tint); }
.log-dial__fill { stroke: var(--gift-ink); }
.log-dial__fill.is-met { stroke: var(--ok); }
.log-dial__fill.is-over { stroke: var(--late); }
.log-dial__value { font-family: var(--font-display); font-size: 34px; font-weight: 600; fill: var(--ink); }
.log-dial__of { font-family: var(--font-body); font-size: 14px; font-weight: 800; fill: var(--ink-2); }
.quick-adds { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.quick-add { min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--gift-tint); color: var(--gift-ink); font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.log-so-far { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 18px; background: var(--bg); }
.log-so-far__title { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.log-so-far__row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 700; }
.log-clear { align-self: center; }

/* ---------- Habits: history ---------- */

.detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -8px -8px 8px; }
.round-btn { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 22px; background: var(--bg); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; }
.round-btn[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.round-btn--raised { background: var(--surface); box-shadow: var(--shadow); }

.habit-history { display: flex; flex-direction: column; gap: 12px; }
.habit-history--panel { gap: 16px; }
.habit-history__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.habit-history--panel .habit-history__head { padding: 0; }
.habit-history__titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.habit-history__name { font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.habit-history--panel .habit-history__name { font-size: 26px; }
.habit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.habit-tag { padding: 4px 10px; border-radius: 12px; background: var(--surface-2); color: var(--lock-ink); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.habit-tag--paused { background: var(--bg); color: var(--ink-2); }

.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.habit-history--panel .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.stat-tile { padding: 12px 14px; border-radius: 20px; background: var(--tint); color: var(--tone); display: flex; flex-direction: column; gap: 2px; }
.stat-tile--ok { --tint: var(--ok-bg); --tone: var(--ok-ink); }
.stat-tile__label { font-size: 13px; font-weight: 800; opacity: 0.85; }
.stat-tile__value { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.15; }

.habit-chart, .habit-cal { margin-bottom: 0; padding: 14px 14px 12px; gap: 10px; }
.habit-history--panel .habit-chart, .habit-history--panel .habit-cal { box-shadow: none; padding: 0; }
.habit-chart__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.habit-chart__title { font-size: 28px; line-height: 1; margin: 4px 4px 0; }
.habit-chart .habit-chart__title { margin: 0; }

.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-chart__plot { position: relative; height: 132px; padding-top: 6px; display: flex; align-items: flex-end; border-bottom: 2px solid var(--line); }
.habit-history--panel .bar-chart__plot { height: 160px; }
.bar { flex: 1; min-width: 0; box-sizing: border-box; border-radius: 4px 4px 2px 2px; }
.bar--done { background: var(--ok); }
.bar--short { background: var(--primary-muted); }
.bar--open { background: var(--primary-muted); opacity: 0.6; }
.bar--skipped { height: 22px; border: 1.5px dashed var(--ink-2); background: transparent; }
.bar--off { height: 3px; background: var(--surface-2); }
.bar-chart__target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--primary); pointer-events: none; }
.bar-chart__target-label { position: absolute; right: 0; padding: 1px 6px; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 800; }
.bar-chart__ticks { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-legend__swatch.bar--skipped { height: 10px; }

.month-cal { display: flex; flex-direction: column; gap: 8px; }
.month-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-cal__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.month-cal__weekdays, .month-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.month-cal__weekdays { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.month-cal__grid { row-gap: 4px; }
.month-cal__cell { height: 40px; display: flex; align-items: center; justify-content: center; }
.habit-history--panel .month-cal__cell { height: 44px; }
.cal-day {
    position: relative; width: 34px; height: 34px; box-sizing: border-box; padding: 0;
    border: 2px solid transparent; border-radius: 17px; background: transparent; color: var(--ink);
    font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.habit-history--panel .cal-day { width: 38px; height: 38px; border-radius: 19px; }
button.cal-day:hover { border-color: var(--primary-muted); }
.cal-day--done { background: var(--ok); color: var(--on-ok); }
.cal-day--skipped { border: 2px dashed var(--ink-2); }
.cal-day--later { color: var(--primary-muted); }
.cal-day.is-today { border: 2px solid var(--primary); }
.cal-day__dot { position: absolute; bottom: 2px; width: 5px; height: 5px; border-radius: 3px; }
.cal-day--missed .cal-day__dot { background: var(--late); }
.cal-key { width: 12px; height: 12px; box-sizing: border-box; border-radius: 6px; }
.cal-key--done { background: var(--ok); }
.cal-key--skipped { border: 2px dashed var(--ink-2); }
.cal-key--missed { width: 6px; height: 6px; border-radius: 3px; background: var(--late); }
.cal-key--today { border: 2px solid var(--primary); }

.habit-why { padding: 14px 16px; border-radius: 20px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.habit-history--panel .habit-why { background: var(--bg); }
.habit-why p { font-size: 15px; font-weight: 600; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.habit-recent { display: flex; flex-direction: column; gap: 6px; }
.recent-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 16px; background: var(--surface); }
.habit-history--panel .recent-row { background: var(--bg); }
.recent-row__day { flex: 1; font-size: 15px; font-weight: 800; }
.recent-row__what { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.recent-row__what .heart { color: var(--heart); }
.recent-row__note { margin: -2px 12px 2px 48px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.habit-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Kids ---------- */

.kids-manage {
    margin-left: 56px; min-height: 44px; padding: 4px 12px 4px 6px; border-radius: 22px;
    display: flex; align-items: center; gap: 8px; background: var(--bg); color: var(--ink);
    text-decoration: none; font-size: 14px; font-weight: 800;
}
.kids-manage__faces { display: flex; }
.kids-manage__faces svg + svg { margin-left: -10px; }
.kids-manage__text { flex: 1; min-width: 0; }
.kids-manage__go { color: var(--primary-ink); }

.kid-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 20px 8px; margin: 0 -20px 4px; }
.kid-chips::-webkit-scrollbar { display: none; }
.kid-chip {
    flex-shrink: 0; min-height: 52px; padding: 4px 14px 4px 4px;
    border: 2px solid var(--line); border-radius: 26px; background: transparent; color: var(--ink);
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.kid-chip.is-on { background: var(--surface); border-color: var(--tone); box-shadow: var(--shadow); }
.kid-chip__text { display: flex; flex-direction: column; line-height: 1.15; }
.kid-chip__name { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.kid-chip__age { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.kid-chip--new { padding: 0 16px 0 12px; border: 2px dashed var(--primary-muted); color: var(--primary-ink); gap: 6px; font-family: var(--font-display); font-size: 15px; font-weight: 500; }

.kids-layout { display: grid; gap: 14px; align-items: start; }
.kids-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 900px) {
    .kids-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; }
    .kid-chips { margin: 0 0 8px; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
}

/* The one dark element on a light page: a night card with a star. */
.timer-card {
    position: relative; overflow: hidden;
    padding: 14px 14px 14px 16px; border-radius: 24px;
    background: #2E2645; color: #F3EFFF;
    display: flex; align-items: center; gap: 12px;
}
@media (prefers-color-scheme: dark) { .timer-card { background: #0E0B1C; box-shadow: inset 0 0 0 1px var(--line); } }
.timer-card__stars { position: absolute; right: 70px; top: -6px; width: 120px; height: 80px; opacity: 0.35; pointer-events: none;
    background: radial-gradient(circle at 17% 22%, #FFE08A 1.6px, transparent 2px), radial-gradient(circle at 53% 12%, #FFE08A 1.2px, transparent 1.6px),
                radial-gradient(circle at 80% 38%, #FFE08A 1.6px, transparent 2px), radial-gradient(circle at 37% 55%, #FFE08A 1.1px, transparent 1.5px); }
.timer-card__icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 16px; background: #3A325E; color: #FFE08A; display: flex; align-items: center; justify-content: center; }
.timer-card--feed .timer-card__icon { color: #FFB3CA; }
.timer-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.timer-card__title { font-size: 14px; font-weight: 800; color: #D3C6FF; }
.timer-card__clock { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.timer-card__since { font-size: 13px; font-weight: 700; color: #BDB4DA; }
.timer-card__btn { min-height: 44px; flex-shrink: 0; padding: 0 18px; border: 0; border-radius: 22px; background: #FFFFFF; color: #2E2645; font-family: var(--font-display); font-size: 16px; font-weight: 600; }

.since-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.since-tile { padding: 10px 12px; border-radius: 20px; background: var(--tint); color: var(--tone); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.since-tile__label { font-size: 12px; font-weight: 800; opacity: 0.9; }
.since-tile__value { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.since-tile__detail { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kid-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kid-action {
    min-height: 84px; padding: 10px 6px; border: 0; border-radius: 22px;
    background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    font-size: 14px; font-weight: 800;
}
.kid-action__icon { width: 40px; height: 40px; border-radius: 14px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }

.kid-firsts { display: flex; flex-direction: column; gap: 6px; }
.kid-firsts .section-title { margin-left: 4px; }
.kid-firsts .carousel { margin: 0 -20px; padding: 2px 20px 4px; }
.first-card {
    flex-shrink: 0; width: 170px; padding: 12px 14px; border: 0; border-radius: 22px;
    background: var(--tint); color: var(--tone); text-align: left;
    display: flex; flex-direction: column; gap: 4px;
}
.first-card__title { font-family: var(--font-hand); font-size: 26px; font-weight: 700; line-height: 1; }
.first-card__when { font-size: 13px; font-weight: 800; }
@media (min-width: 900px) { .kid-firsts .carousel { margin: 0; padding: 0; } }

.kid-timeline { display: flex; flex-direction: column; }
.kid-timeline .section-title { margin: 2px 4px 6px; }
@media (min-width: 900px) { .kid-timeline { padding: 18px 16px 8px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); } }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item { width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; display: flex; gap: 10px; align-items: stretch; border-radius: 16px; }
.timeline__item:hover { background: var(--surface-soft); }
.timeline__at { width: 42px; flex-shrink: 0; padding-top: 12px; font-size: 13px; font-weight: 800; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.timeline__rail { width: 34px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.timeline__icon { width: 34px; height: 34px; margin-top: 4px; border-radius: 12px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.timeline__line { flex: 1; width: 2px; background: var(--line); margin-top: 2px; }
.timeline li:last-child .timeline__line { background: transparent; }
.timeline__text { flex: 1; min-width: 0; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 1px; }
.timeline__title { font-size: 16px; font-weight: 800; }
.timeline__detail { font-size: 14px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.timeline__who { flex-shrink: 0; margin-top: 10px; }

/* Kid sheets */
.feed-tabs { display: grid; grid-template-columns: repeat(var(--count, 3), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 24px; background: var(--surface-2); }
.feed-tabs button { min-height: 44px; border: 0; border-radius: 20px; background: transparent; color: var(--ink-2); font-size: 15px; font-weight: 800; }
.feed-tabs button.is-on { background: var(--surface); color: var(--primary-ink); box-shadow: 0 2px 8px rgba(90, 64, 170, 0.12); }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 6px 4px; }
.side-btn {
    aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--line); background: var(--surface); color: var(--ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.side-btn.is-on { --tint: var(--love-tint); --tone: var(--love-ink); background: var(--tint); border-color: var(--tone); color: var(--tone); box-shadow: 0 0 0 8px rgba(232, 67, 110, 0.12); }
.side-btn__letter { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; }
.side-btn__clock { font-family: var(--font-display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.side-btn__state { font-size: 12px; font-weight: 800; }
.feed-hint { text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-pair input { min-width: 0; width: 100%; }
.field-static { min-height: 50px; display: flex; align-items: center; font-weight: 700; color: var(--ink-2); }
.milk-opt { min-height: 48px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.milk-opt.is-on { background: var(--gift-tint); border-color: var(--gift-ink); color: var(--gift-ink); }
.ml-picker { display: flex; align-items: center; justify-content: center; gap: 18px; }
.ml-picker__value { min-width: 130px; text-align: center; font-family: var(--font-display); font-size: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ml-picker__value span { font-size: 20px; color: var(--ink-2); }
.ml-chip { min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--gift-tint); color: var(--gift-ink); font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.ml-chip.is-on { background: var(--gift-ink); color: var(--gift-tint); }
.opt--peach.is-on { background: var(--date-tint); border-color: var(--date-ink); color: var(--date-ink); }
.when-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 4px 6px 4px 14px; border-radius: 16px; background: var(--bg); font-size: 15px; font-weight: 700; }
.when-row__value { min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--primary-ink); font-weight: 800; }
.when-row__input { min-height: 40px; border: 2px solid var(--line); border-radius: 12px; padding: 0 8px; background: var(--surface); color: var(--ink); font-weight: 700; }
.sheet-lead { font-weight: 700; margin-top: -4px; }
.diaper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.diaper-btn { min-height: 104px; border: 0; border-radius: 24px; background: var(--tint); color: var(--tone); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.text-btn--start { align-self: flex-start; padding: 0 4px; }

/* Kid settings */
.setup-bar { display: flex; align-items: center; gap: 8px; margin: -8px -8px 12px; }
.setup-bar__title { flex: 1; min-width: 0; font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-card { gap: 12px; }
.swatch { border: 0; padding: 0; background: transparent; }
.setup-intro { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; margin-bottom: 8px; }
.activity-list { padding: 0; gap: 0; overflow: visible; }
.activity-group + .activity-group { border-top: 1px solid var(--line); }
.activity-group.is-dragging { opacity: 0.5; }
.activity-row { display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 0 12px 0 4px; position: relative; }
.activity-row + .activity-row { border-top: 1px solid var(--surface-2); }
.activity-row--1 { padding-left: 48px; }
.activity-row--2 { padding-left: 88px; }
.activity-row--2 .activity-row__label { font-size: 15px; }
.activity-row__handle { position: relative; }
.grip-btn { width: 40px; height: 44px; flex-shrink: 0; border: 0; background: transparent; color: var(--lock-ink); cursor: grab; display: flex; align-items: center; justify-content: center; }
.grip-menu {
    position: absolute; z-index: 5; left: 0; top: 44px; padding: 6px; border-radius: 16px;
    background: var(--surface); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: 2px; min-width: 150px;
}
.grip-menu button { min-height: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.grip-menu button:hover:not(:disabled) { background: var(--surface-2); }
.grip-menu button:disabled { opacity: 0.4; }
.flip { transform: rotate(180deg); }
.activity-row__icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 11px; background: var(--tint); color: var(--tone); display: flex; align-items: center; justify-content: center; }
.activity-row__icon.is-off { opacity: 0.45; }
.activity-row__label { flex: 1; min-width: 0; padding-left: 8px; font-size: 16px; font-weight: 800; }
.activity-row__label.is-off { color: var(--ink-2); }
.switch-btn { width: 60px; height: 44px; flex-shrink: 0; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.setup-remove { align-self: flex-start; margin-top: 16px; }

/* Welcome */
.welcome { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.welcome__art { align-self: center; }
.welcome__head { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.welcome__title { font-size: 40px; line-height: 1; }
.welcome__card { gap: 12px; margin: 0; }
.age-opt {
    min-height: 48px; padding: 4px 10px; border: 2px solid var(--line); border-radius: 16px;
    background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 800;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left;
}
.age-opt.is-on { background: var(--date-tint); border-color: var(--date-ink); color: var(--date-ink); }
.age-opt__hint { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.welcome__suggest { padding: 10px 12px; border-radius: 16px; background: var(--date-tint); color: var(--date-ink); font-size: 14px; font-weight: 700; line-height: 1.4; }
.btn-dashed {
    min-height: 52px; border: 2px dashed var(--primary-muted); border-radius: 26px; background: transparent;
    color: var(--primary-ink); font-family: var(--font-display); font-size: 16px; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
