/* BabyBusiness. One stylesheet: tokens, base, components, pages, print. */

@font-face {
    font-family: 'Fraunces';
    src: url("../fonts/fraunces-latin-full-normal--EVu-Yn.woff2") format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Figtree';
    src: url("../fonts/figtree-latin-wght-normal-Dj9csJy.woff2") format('woff2');
    font-weight: 300 900;
    font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {
    --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    --radius: 16px;
    --radius-small: 10px;
    --tap: 44px;
    --header-height: 64px;
    --bottom-nav-height: 68px;
    --shadow: 0 1px 2px rgb(60 40 20 / 0.04), 0 6px 20px rgb(60 40 20 / 0.05);
    --shadow-raised: 0 12px 48px rgb(40 25 15 / 0.18);

    /* Neutral: warm sand and sage, until we know whether it is a boy or a girl. */
    --bg: #faf6f0;
    --surface: #ffffff;
    --surface-soft: #f3ede4;
    --ink: #2f2a25;
    --ink-soft: #6f665c;
    --line: #e8e0d4;
    --accent: #5b8a6c;
    --accent-strong: #3e6a50;
    --accent-soft: #e4eee6;
    --accent-ink: #ffffff;

    --danger: #b4483c;
    --danger-soft: #f8e3df;
    --warning: #a86b12;
    --warning-soft: #fbefd6;
    --done: #3f7d58;
}

:root[data-theme='boy'] {
    --bg: #f3f7fb;
    --surface-soft: #e8f0f8;
    --ink: #1e2c3c;
    --ink-soft: #586a7e;
    --line: #dce6f0;
    --accent: #3d77ad;
    --accent-strong: #275986;
    --accent-soft: #e0ebf7;
}

:root[data-theme='girl'] {
    --bg: #fcf6f6;
    --surface-soft: #f8ebef;
    --ink: #3a2730;
    --ink-soft: #7b6069;
    --line: #f0e0e5;
    --accent: #c25679;
    --accent-strong: #9a3a5a;
    --accent-soft: #fae2ea;
}

/* ---------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + 16px); }

/* Safety net: content that is too wide must never zoom the whole page out on a phone.
   (clip, not hidden, so sticky headers keep working.) */
html, body { overflow-x: clip; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 0.4s ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 100, 'WONK' 0;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); overflow-wrap: anywhere; }
h2, h3 { overflow-wrap: anywhere; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 0.75em; }

a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

[hidden] { display: none !important; }

[x-cloak] { display: none !important; }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    vertical-align: -0.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: var(--tap);
    padding: 0.55em 1.1em;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.button:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.button:active { transform: scale(0.98); }

.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.button--soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
.button--soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }

.button--quiet { background: transparent; border-color: transparent; color: var(--ink-soft); }
.button--quiet:hover { background: var(--surface-soft); color: var(--ink); }

.button--danger { color: var(--danger); }
.button--danger.is-confirming, .button--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.button--small { min-height: 34px; padding: 0.3em 0.8em; font-size: 0.875rem; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    flex: none;
}

.icon-button:hover { background: var(--surface-soft); color: var(--ink); }
.icon-button .icon { width: 1.35em; height: 1.35em; }

/* ---------------------------------------------------------------- form fields */

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: 1rem; }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; align-items: start; }
.field-row > .field, .field-row > div > .field { margin-top: 0; }
.field-row > * { min-width: 0; }

/* The add buttons stay in reach at the bottom of a new item, side by side even on a phone. */
.form-actions {
    position: sticky;
    bottom: -3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 0;
    background: var(--bg);
}
.form-actions .button { white-space: normal; line-height: 1.2; text-align: center; }

.label { font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.02em; }

.input, .select, .textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 0.55em 0.85em;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.textarea { min-height: 5.5em; resize: vertical; field-sizing: content; }

.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); }

/* Text that is edited in place: looks like text until it is touched. */
.inline-input {
    width: 100%;
    padding: 0.3em 0.45em;
    margin: -0.3em -0.45em;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: transparent;
    font: inherit;
    resize: none;
    field-sizing: content;
    transition: background-color 0.15s, border-color 0.15s;
}

.inline-input:hover { background: var(--surface-soft); }
.inline-input:focus { outline: none; background: var(--surface); border-color: var(--accent); }
textarea.inline-input { min-height: 2.2em; line-height: 1.5; }
.inline-input--title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; line-height: 1.25; }

.money-input { position: relative; }
.money-input::before { content: '€'; position: absolute; left: 0.85em; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }
.money-input .input { padding-left: 1.8em; }

/* Chips and segmented choices: radio buttons and checkboxes that look like buttons. */
.choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* A chip: <label class="choice"><input><span>…</span></label>. Only that span is the chip, so what sits
   inside it (an avatar with an initial, a name that updates itself) keeps its own shape. */
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    min-height: 38px;
    padding: 0.35em 0.9em;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.9375rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.choice > span:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice input:checked + span { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }

.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; min-height: var(--tap); }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; margin: 0; transition: background-color 0.2s; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- small elements */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.1em 0.6em;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge .icon { width: 1.05em; height: 1.05em; }
.badge--accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--done { background: color-mix(in srgb, var(--done) 14%, transparent); color: var(--done); }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    flex: none;
}
.avatar--photo { overflow: hidden; background: var(--surface-soft); }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.4s ease; }

.counter { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }

.empty { padding: 1.25rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); text-align: center; }

.thumb { width: 44px; height: 44px; border-radius: var(--radius-small); object-fit: cover; background: var(--surface-soft); flex: none; }
.thumb--placeholder { display: grid; place-items: center; color: var(--ink-soft); }

/* ---------------------------------------------------------------- app shell */

.app-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--header-height);
    padding: 0 max(16px, calc((100vw - 1240px) / 2));
    /* Opaque, without backdrop-filter: that would trap the menu sheet inside the header. Above the bottom bar. */
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

@media (max-width: 639px) {
    .app-header { gap: 0.5rem; padding: 0 12px; }
}

/* One menu for everything outside the five places: a dropdown on a computer, a sheet from the bottom on a phone. */
.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0 0.9rem 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.menu-button:hover, .menu-button[aria-expanded='true'] { border-color: var(--accent); color: var(--accent-strong); }
/* Private mode: a quiet eye while off, filled while on, so it is clear at a glance that the name is hidden. */
.private-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 40px;
    min-height: 40px;
    padding: 0 0.85rem 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-weight: 600;
}
.private-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }
.private-toggle.is-on { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
@media (max-width: 1279px) {
    .private-toggle { padding: 0; }
    .private-toggle span { display: none; }
}
@media (max-width: 959px) {
    .private-toggle { width: var(--tap); height: var(--tap); }
}
.app-menu { position: relative; }
.app-menu__backdrop { position: fixed; inset: 0; background: rgb(30 20 15 / 0.35); }
.app-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 300px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-raised);
}
.app-menu__head { display: flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0.25rem 0.25rem 0.6rem; }
.app-menu__profile { display: flex; align-items: center; gap: 0.6rem; margin-right: auto; padding: 0.3rem 0.6rem 0.3rem 0.3rem; border-radius: 999px; color: inherit; text-decoration: none; }
.app-menu__profile:hover { background: var(--surface-soft); }
.app-menu__languages { display: flex; gap: 0.4rem; padding: 0.25rem 0.75rem 0.5rem; }
.menu__hint { margin-left: auto; color: var(--ink-soft); font-size: 0.8125rem; }
.menu__item[aria-current='true'] { font-weight: 700; }
.menu__item[aria-current='true'] .icon { color: var(--accent); }

@media (min-width: 960px) {
    .app-menu__backdrop { display: none !important; }
}

@media (max-width: 959px) {
    .app-menu__panel {
        position: fixed;
        inset: auto 0 0 0;
        width: auto;
        max-height: 85vh;
        padding: 0.5rem 0.75rem calc(1rem + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
    }
    .app-menu__panel .menu__item { min-height: 50px; font-size: 1rem; }
    .menu-button span { display: none; }
    .menu-button { padding: 0; width: var(--tap); height: var(--tap); justify-content: center; }
}
@media (min-width: 380px) and (max-width: 959px) {
    .menu-button span { display: inline; }
    .menu-button { width: auto; padding: 0 0.9rem 0 0.7rem; }
}

.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; }
.brand__name { display: none; }

.child-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.25rem 0.85rem 0.25rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    max-width: 52vw;
    min-width: 0;
}
.child-chip__dot { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; }
.child-chip__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-nav { display: none; gap: 0.25rem; margin-left: 0.5rem; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 0.45rem;
    min-height: 40px; padding: 0 0.9rem; border-radius: 999px;
    color: var(--ink-soft); text-decoration: none; font-weight: 600;
}
.main-nav a:hover { background: var(--surface-soft); color: var(--ink); }
.main-nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-strong); }

.header-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }

.bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--ink-soft); text-decoration: none; font-size: 0.72rem; font-weight: 600;
}
.bottom-nav a .icon { width: 1.5em; height: 1.5em; }
.bottom-nav a[aria-current='page'] { color: var(--accent-strong); }
.bottom-nav a[aria-current='page'] .icon { background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; width: 2.6em; box-sizing: content-box; }

.page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 16px calc(var(--bottom-nav-height) + 40px);
}

.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.page-header h1 { margin-right: auto; }
.page-header__sub { flex-basis: 100%; margin: -0.5rem 0 0; color: var(--ink-soft); }

.tabs { display: flex; gap: 0.25rem; margin: -0.25rem 0 1.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs a {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: 40px; padding: 0 1rem; border-radius: 999px;
    color: var(--ink-soft); text-decoration: none; font-weight: 600; white-space: nowrap;
    border: 1px solid transparent;
}
.tabs a:hover { background: var(--surface-soft); }
.tabs a[aria-current='page'] { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }

.menu { position: relative; }
.menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 230px;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-raised);
}
.menu__panel--left { right: auto; left: 0; }
.menu__item {
    display: flex; align-items: center; gap: 0.65rem; width: 100%;
    min-height: 42px; padding: 0.4rem 0.75rem; border: 0; border-radius: var(--radius-small);
    background: none; color: var(--ink); text-align: left; text-decoration: none; font-size: 0.9375rem;
}
.menu__item:hover { background: var(--surface-soft); }
.menu__item .icon { color: var(--ink-soft); }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.menu__separator { height: 1px; margin: 0.35rem 0.5rem; background: var(--line); }
.menu__title { padding: 0.4rem 0.75rem 0.2rem; font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }

@media (min-width: 640px) {
    .brand__name { display: inline; }
}

/* From 960 px the navigation moves from the bottom bar into the header; until there is room for
   everything, the name next to the logo makes way for it. */
@media (min-width: 960px) {
    .main-nav { display: flex; }
    .bottom-nav { display: none; }
    .page { padding: 32px 32px 64px; }
    .brand__name { display: none; }
    .main-nav a { padding: 0 0.75rem; }
    .child-chip { max-width: 200px; }
}

@media (min-width: 1280px) {
    .brand__name { display: inline; }
    .main-nav a { padding: 0 0.9rem; }
    .child-chip { max-width: 280px; }
}

/* ---------------------------------------------------------------- cards and sections */

.card {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card__header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-bottom: 0.75rem; }
.card__header h2, .card__header h3 { margin-right: auto; min-width: 0; }
.card__header .icon { color: var(--accent); }

@media (max-width: 639px) {
    .card { padding: 0.9rem 0.75rem; }
    .card__header { padding: 0 0.25rem; }
    .card__header h2 { font-size: 1.2rem; }
    .page { padding-left: 12px; padding-right: 12px; }
    .page-header h1 { font-size: 1.6rem; }
}

.section + .section { margin-top: 2rem; }
.section__header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.section__header h2, .section__header h3 { margin-right: auto; }

/* minmax(0, …): a column takes its share of the screen and never grows to fit its widest row. */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 900px) {
    .columns--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .columns--wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
}

.stack { min-width: 0; }
.stack > * + * { margin-top: 1.25rem; }
.card, .rows, .row { min-width: 0; }

/* ---------------------------------------------------------------- rows (every preparation in every list) */

.rows { display: grid; gap: 0.5rem; }

.row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 60px;
    padding: 0.4rem 0.4rem 0.4rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}
.row:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

.row__main {
    display: grid;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
    min-height: var(--tap);
    padding: 0.3rem 0.4rem;
    border: 0;
    border-radius: var(--radius-small);
    background: none;
    text-align: left;
    align-content: center;
}

.row__title { font-weight: 600; overflow-wrap: anywhere; }
.row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; color: var(--ink-soft); font-size: 0.8125rem; }
.row__meta .icon { width: 1.05em; height: 1.05em; }
.row__meta-item { display: inline-flex; align-items: center; gap: 0.25em; }

.row__end { display: flex; align-items: center; gap: 0.15rem; margin-left: auto; }
.row__thumbs { display: flex; }
.row__thumbs img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 2px var(--surface); }
.row__thumbs img + img { margin-left: -8px; }

.row__add { padding: 0.3em 0.75em; }
.row__add-label { display: none; }
@media (min-width: 420px) { .row__add-label { display: inline; } }

.row.is-finished { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.row.is-finished .row__title { color: var(--ink-soft); }
.row.is-skipped { opacity: 0.6; background: transparent; border-style: dashed; }
.row.is-skipped .row__title { text-decoration: line-through; text-decoration-color: var(--ink-soft); }
.row.is-suggestion { background: transparent; border-style: dashed; }

.row--compact { min-height: 52px; }

/* The status circle in front of each row: the one tap that finishes something. */
.status {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--accent);
    flex: none;
}
.status:disabled { cursor: default; }
.status__circle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid color-mix(in srgb, var(--ink-soft) 45%, transparent);
    border-radius: 50%;
    background: var(--surface);
    color: #fff;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}
.status:not(:disabled):hover .status__circle { border-color: var(--accent); transform: scale(1.06); }
.status__circle .icon { width: 17px; height: 17px; stroke-width: 3; }
.status--done .status__circle { background: var(--accent); border-color: var(--accent); }
.status--partial .status__circle { background: conic-gradient(var(--accent) var(--share, 50%), var(--surface) 0); border-color: var(--accent); }
.status--progress .status__circle { border-color: var(--accent); border-style: dashed; }
.status--skipped .status__circle { border-style: dashed; color: var(--ink-soft); background: transparent; }
.status--question .status__circle { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.status--question .status__circle .icon { stroke-width: 2.4; }
.status--appointment .status__circle { border-radius: 9px; }

.row-actions { position: relative; }

.suggestion-actions { display: flex; gap: 0.25rem; }

/* "Regelen": every thing still to arrange with the ways to get it, one tap each. */
.arrange-quick { display: grid; }
.arrange-quick__row { display: grid; gap: 0.35rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.arrange-quick__row:nth-child(1 of :not([hidden])) { border-top: 0; padding-top: 0; }
.arrange-quick__row[hidden] { display: none; }
.arrange-quick__main { display: grid; gap: 0.15rem; padding: 0.2rem 0.4rem; border: 0; border-radius: var(--radius-small); background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.arrange-quick__main:hover { background: var(--surface-soft); }
.arrange-quick__chips { display: flex; flex-wrap: wrap; gap: 0.3rem; padding-left: 0.2rem; }
.chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    min-height: 32px; padding: 0.2rem 0.7rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--ink-soft); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.chip .icon { width: 1.05em; height: 1.05em; }

/* Suggestions whose moment has passed: five at a time; answering one moves the next one up. */
.catch-up__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.4rem 0; border-top: 1px solid var(--line); }
.catch-up__row:nth-child(1 of :not([hidden])) { border-top: 0; padding-top: 0; }
.catch-up__row[hidden], .catch-up__row:nth-child(n+6 of :not([hidden])) { display: none; }
.catch-up__main { display: grid; gap: 0.15rem; flex: 1 1 14rem; min-width: 0; padding: 0.3rem 0.4rem; border: 0; border-radius: var(--radius-small); background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.catch-up__main:hover { background: var(--surface-soft); }
.catch-up__actions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: auto; }

/* On a phone the accept/dismiss buttons of a suggestion get their own line under the title. */
@media (max-width: 559px) {
    .row.is-suggestion { flex-wrap: wrap; }
    .row.is-suggestion .row__main { flex-basis: calc(100% - var(--tap) - 0.25rem); }
    .row.is-suggestion .row__end { width: 100%; justify-content: flex-end; padding: 0 0 0.15rem; }
}

/* Groups of rows that hide themselves when filters leave nothing in them. */
.group { margin-top: 1.5rem; }
.group:first-child { margin-top: 0; }
.group__title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem 0.25rem; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.group__title .counter { font-size: 0.8125rem; letter-spacing: 0; }
.group--overdue .group__title { color: var(--danger); }
.group:not(:has(.row:not([hidden]))) { display: none; }
.group.is-always-shown { display: block; }
.contact-new:not(:empty) { margin-bottom: 0.5rem; }
.contact-new + .group { margin-top: 0; }

details.fold { margin-top: 1.5rem; }
details.fold > summary {
    display: flex; align-items: center; gap: 0.5rem; list-style: none;
    min-height: var(--tap); padding: 0 0.25rem; cursor: pointer;
    font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .icon { transition: transform 0.2s; }
details.fold[open] > summary .icon:first-child { transform: rotate(90deg); }
details.fold > .rows, details.fold > .fold__body { margin-top: 0.5rem; }

/* ---------------------------------------------------------------- quick add */

.quick-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'input submit' 'kinds kinds';
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.quick-add > .choices { grid-area: kinds; }
.quick-add > button[type='submit'] { grid-area: submit; }
@media (min-width: 640px) {
    .quick-add { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'input kinds submit'; }
}
.quick-add__input {
    grid-area: input;
    min-width: 0;
    min-height: var(--tap);
    padding: 0 0.75rem;
    border: 0;
    background: none;
}
.quick-add__input:focus { outline: none; }
.quick-add:focus-within { border-color: var(--accent); }
.quick-add .choices { flex: 0 1 auto; }
.quick-add .choice > span { min-height: 36px; padding: 0.25em 0.75em; font-size: 0.875rem; }

.inline-add { display: flex; align-items: center; gap: 0.25rem; padding: 0 0.35rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.inline-add:focus-within { border-style: solid; border-color: var(--accent); background: var(--surface); }
.inline-add .icon { color: var(--ink-soft); margin-left: 0.6rem; }
.inline-add input { flex: 1; min-height: 48px; padding: 0 0.5rem; border: 0; background: none; }
.inline-add input:focus { outline: none; }

/* ---------------------------------------------------------------- filters */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0 1.25rem; }

/* On a phone the less used filters fold away behind one button; on a computer they are simply there. */
.filters__toggle { display: none; }
.filters__more { display: contents; }
/* Where the filters would push the list off the first screen (Spullen), they fold away everywhere. */
.filters--folded .filters__toggle { display: inline-flex; }
.filters--folded .filters__more { display: none; }
.filters--folded .filters__more.is-open { display: grid; gap: 0.75rem; width: 100%; }
@media (max-width: 639px) {
    .filters__toggle { display: inline-flex; }
    .filters__more { display: none; }
    .filters__more.is-open { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
    .filter-panel .filters__more.is-open { display: grid; gap: 0.75rem; }
    .filters .search-field { max-width: none; }
    .filter-panel { padding: 0.6rem; }
    .filter-panel__search { flex-wrap: nowrap; }
    .filter-panel__search .search-field { flex: 1; min-width: 0; }
    .filter-panel__label { flex-basis: 100%; min-width: 0; }
}
.search-field { position: relative; flex: 1 1 200px; max-width: 320px; }
.search-field .icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }
.search-field .input { padding-left: 2.4rem; border-radius: 999px; }
.filters .select { width: auto; border-radius: 999px; padding-right: 2rem; }

/* ---------------------------------------------------------------- drawer */

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__backdrop { position: absolute; inset: 0; background: rgb(30 20 15 / 0.32); }
.drawer__panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(640px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: var(--shadow-raised);
}
.drawer__header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 60px;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.drawer__header-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); font-weight: 600; font-size: 0.9375rem; }
.drawer__header-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem 1.25rem 3rem; overscroll-behavior: contain; }
.drawer__footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Going through a plan: one question at a time, answers as big buttons, the way on at the bottom. */
.walk { display: flex; flex-direction: column; gap: 1rem; }
.walk__topic { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.walk__question { margin: 0; font-size: 1.45rem; line-height: 1.25; }
.walk__context { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.walk__answers { display: grid; gap: 0.5rem; }
.walk__option { justify-content: flex-start; min-height: 52px; padding-inline: 1rem; text-align: left; white-space: normal; }
.walk__own { display: grid; gap: 0.5rem; }
.walk__own .button { justify-self: start; }
.walk__skip { align-self: flex-start; }
.walk__answer { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.85rem 1rem; border-radius: var(--radius-small); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.walk__answer .icon { flex: none; margin-top: 0.15em; }
.walk__nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.walk__next { margin-left: auto; }
.walk:has(.htmx-request) > * { opacity: 0.55; transition: opacity 0.15s 0.05s; }
.walk__end { display: grid; justify-items: center; gap: 0.9rem; padding: 2.5rem 0; text-align: center; }
.walk__end-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); }
.walk__end-icon .icon { width: 30px; height: 30px; }
.walk__end h2 { margin: 0; }
/* Loading: the shape of what is coming (a panel, rows) with a soft shine moving over it. */
.skeleton {
    display: block;
    height: 0.85rem;
    border-radius: 6px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 30%, color-mix(in srgb, var(--ink) 3%, transparent) 50%, color-mix(in srgb, var(--ink) 7%, transparent) 70%);
    background-size: 300% 100%;
    animation: skeleton-shine 1.4s ease-in-out infinite;
}
@keyframes skeleton-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skeleton--icon { width: 20px; height: 20px; }
.skeleton--title { height: 1.5rem; }
.skeleton--chip { height: 2.4rem; border-radius: 999px; }
.skeleton--label { height: 0.7rem; margin-top: 0.6rem; }
.skeleton--field { height: 2.75rem; border-radius: 12px; }
.skeleton--small { height: 0.65rem; }
.skeleton--circle { width: 26px; height: 26px; border-radius: 50%; flex: none; margin: 0 0.3rem; }
.skeleton-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.drawer-skeleton .drawer__body { display: grid; gap: 0.6rem; align-content: start; }
.drawer-skeleton .drawer__header-title { gap: 0.5rem; }
.skeleton-row-item { align-items: center; gap: 0.5rem; padding-block: 0.85rem; }
.skeleton-row-item__text { display: grid; gap: 0.45rem; flex: 1; }

/* Along the top of the screen while something loads that you wait for (assets/js/loading.js). */
.loading-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.loading-bar.is-active { opacity: 1; }
.loading-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: 0 3px 3px 0; background: var(--accent); animation: loading-bar 1.1s ease-in-out infinite; }
@keyframes loading-bar { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
    .loading-bar::before { animation: none; width: 100%; opacity: 0.6; }
}

.drawer-enter { transition: opacity 0.2s ease; }
.drawer-enter .drawer__panel, .drawer-leave .drawer__panel { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.drawer-hidden { opacity: 0; }
.drawer-hidden .drawer__panel { transform: translateX(40px); }
.drawer-leave { transition: opacity 0.18s ease; }

.saved-indicator { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--done); font-size: 0.8125rem; font-weight: 700; }

.drawer-section { margin-top: 1.75rem; }
.drawer-section:first-child { margin-top: 0; }
.drawer-section__title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.drawer-section__title .icon { width: 1.1em; height: 1.1em; }
.drawer-section__title > :last-child:not(:first-child) { margin-left: auto; }
.drawer-meta { margin-top: 2rem; color: var(--ink-soft); font-size: 0.8125rem; }

.more { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.more > summary { display: flex; align-items: center; gap: 0.4rem; min-height: var(--tap); cursor: pointer; color: var(--ink-soft); font-weight: 600; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary .icon { transform: rotate(90deg); }

/* ---------------------------------------------------------------- toasts */

.toasts {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
    z-index: 60;
    display: grid;
    gap: 0.5rem;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
@media (min-width: 960px) { .toasts { bottom: 24px; right: 24px; } }

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.6rem 0.7rem 1rem;
    border-radius: var(--radius);
    background: #2c2621;
    color: #fff;
    box-shadow: var(--shadow-raised);
    pointer-events: auto;
    font-weight: 500;
}
.toast .icon { color: #9fd6b0; }
.toast--error { background: var(--danger); }
.toast--error .icon { color: #fff; }
.toast__message { flex: 1; }
.toast__undo { padding: 0.35rem 0.7rem; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.14); color: #fff; font-weight: 700; }
.toast__undo:hover { background: rgb(255 255 255 / 0.24); }
.toast-enter { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s; }
.toast-hidden { transform: translateY(12px); opacity: 0; }
.toast-leave { transition: opacity 0.2s; }

/* ---------------------------------------------------------------- picker (searchable dropdown that can add choices) */

.picker { position: relative; }
.picker__control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    min-height: var(--tap);
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    cursor: text;
}
.picker__control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.picker__chip {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.2rem 0.15rem 0.65rem; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 0.875rem; font-weight: 600;
}
.picker__chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: inherit; }
.picker__chip button:hover { background: rgb(0 0 0 / 0.06); }
.picker__chip .icon { width: 14px; height: 14px; }
.picker__value { padding-left: 0.45rem; }
/* An input is about 170 px wide by itself; start from 80 px so pickers fit narrow columns on a phone. */
.picker__search { flex: 1 1 80px; width: 80px; min-width: 60px; min-height: 32px; padding: 0 0.45rem; border: 0; background: none; }
.picker__search:focus { outline: none; }
.picker__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 45;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    box-shadow: var(--shadow-raised);
}
.picker__option {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    min-height: 40px; padding: 0.35rem 0.6rem; border: 0; border-radius: 8px;
    background: none; text-align: left;
}
.picker__option:hover, .picker__option.is-active { background: var(--surface-soft); }
.picker__option.is-selected { color: var(--accent-strong); font-weight: 700; }
.picker__option .icon { color: var(--accent); }
.picker__option-hint { margin-left: auto; color: var(--ink-soft); font-size: 0.8125rem; }
.picker__create { color: var(--accent-strong); font-weight: 600; }
.picker__empty { padding: 0.5rem 0.6rem; color: var(--ink-soft); font-size: 0.875rem; }

/* People toggles: tap a parent to assign them. */
.people-toggle { display: flex; gap: 0.4rem; }
.people-toggle .choice > span { padding-left: 0.35rem; }
.people-toggle .avatar { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- dashboard */

.hero {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: calc(var(--radius) + 6px);
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent) 22%, transparent) 0, transparent 38%),
        linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--line);
    overflow: hidden;
}
.hero__main { display: grid; gap: 1rem; align-content: start; min-width: 0; }
@media (min-width: 900px) {
    .hero { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 1.5rem; }
}
/* The first name (typed here) with the last name (chosen under "Gegevens aanpassen") right after it. */
.hero__name { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.3em; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero__family-name { font-family: var(--font-display); font-weight: 500; line-height: 1.25; }

/* The baby this week: "zo groot als een papaya", weight and length, a few facts. */
.baby-week { display: grid; gap: 0.85rem; align-content: start; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: rgb(255 255 255 / 0.72); }
.baby-week__head { display: flex; align-items: center; gap: 0.9rem; }
.baby-week__emoji {
    display: grid; place-items: center; flex: none;
    width: 64px; height: 64px;
    border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%;
    background: color-mix(in srgb, var(--warning) 14%, var(--surface));
    font-size: 2.1rem; line-height: 1;
}
.baby-week__label { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.baby-week__size { display: block; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; color: var(--accent-strong); }
.baby-week__numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.baby-week__number { display: grid; justify-items: center; padding: 0.45rem 0.5rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.8125rem; font-weight: 600; }
.baby-week__number strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; line-height: 1.15; color: var(--ink); }
.baby-week__facts { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.4; }
.baby-week__facts li { position: relative; padding-left: 1rem; }
.baby-week__facts li::before { content: ''; position: absolute; left: 0.2rem; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.baby-week__more { display: inline-flex; align-items: center; gap: 0.3rem; justify-self: start; font-size: 0.8125rem; color: var(--ink-soft); }
.baby-week__more .icon { width: 14px; height: 14px; }
.baby-week__toggle { display: none; }
@media (max-width: 639px) {
    /* On a phone the overview gets to the point: the comparison and the numbers, the facts a tap away. */
    .baby-week { gap: 0.55rem; padding: 0.7rem 0.8rem; cursor: pointer; }
    .baby-week__head { gap: 0.65rem; }
    .baby-week__emoji { width: 44px; height: 44px; font-size: 1.5rem; }
    .baby-week__label { font-size: 0.6875rem; }
    .baby-week__size { font-size: 1.05rem; }
    .baby-week__toggle { display: grid; flex: none; margin-left: auto; color: var(--ink-soft); transition: transform 0.15s; }
    .baby-week.is-open .baby-week__toggle { transform: rotate(180deg); }
    .baby-week__number { display: flex; align-items: baseline; justify-content: center; gap: 0.3rem; padding: 0.2rem 0.5rem; font-size: 0.75rem; }
    .baby-week__number strong { font-size: 1.05rem; }
    .baby-week:not(.is-open) :is(.baby-week__facts, .baby-week__more) { display: none; }
}
.hero__name .inline-input { width: auto; max-width: 100%; field-sizing: content; font-family: var(--font-display); font-size: inherit; font-weight: 500; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.hero__week { font-family: var(--font-display); font-size: 1.15rem; }
.hero__progress { display: grid; gap: 0.35rem; max-width: 560px; }
.hero__progress .progress { height: 10px; background: rgb(255 255 255 / 0.7); }
.hero__progress-labels { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--ink-soft); }
.hero__settings { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: end; margin-top: 0.5rem; }
.hero__details > summary {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: var(--tap); padding: 0 0.9rem; border-radius: 999px;
    background: rgb(255 255 255 / 0.6); color: var(--ink-soft); font-weight: 600; cursor: pointer; list-style: none;
}
.hero__details > summary::-webkit-details-marker { display: none; }
.hero__details[open] > summary { color: var(--accent-strong); }
@media (max-width: 639px) {
    /* On a phone the child takes a few lines, so "Nu aan de beurt" is in view without scrolling. */
    .hero { padding: 0.9rem; gap: 0.7rem; margin-bottom: 1rem; }
    .hero__main { gap: 0.5rem; }
    .hero__name { font-size: 1.75rem; padding-right: calc(var(--tap) + 0.25rem); }
    .hero__phase, .hero__progress-labels { display: none; }
    .hero__facts { column-gap: 0.75rem; }
    .hero__week { font-size: 1.05rem; }
    .hero__progress .progress { height: 8px; }
    .hero__details > summary { position: absolute; top: 0.75rem; right: 0.75rem; justify-content: center; width: var(--tap); padding: 0; }
    .hero__details-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .hero__settings .field { flex: 1 1 140px; }
    .hero__settings .input { width: 100%; }
}
.hero__settings .input { width: auto; background: rgb(255 255 255 / 0.75); }

.dashboard-list { display: grid; gap: 0.5rem; }

.project-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { display: grid; gap: 0.75rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.project-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); }
.project-card__head { display: flex; align-items: center; gap: 0.75rem; }
.project-card__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.project-card__icon .icon { width: 1.4em; height: 1.4em; }
.project-card__name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.project-card__counts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.project-card.is-ready .project-card__icon { background: var(--accent); color: #fff; }

.mini-project { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.35rem 0.75rem; padding: 0.5rem 0.25rem; color: inherit; text-decoration: none; border-radius: var(--radius-small); }
.mini-project:hover { background: var(--surface-soft); }
.mini-project .progress { grid-column: 2 / 4; height: 6px; }

/* ---------------------------------------------------------------- timeline (what we have done) */

/* Without assets/js/history.js: one column along a line on the left. With it (.is-laid-out) every card
   gets its place; on a wide screen (.is-two-sided) on both sides of a line down the middle. */
.timeline-summary { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.5rem 0 1.75rem; }
.timeline { position: relative; padding-bottom: 0.5rem; }
.timeline__line {
    position: absolute; top: 12px; bottom: 12px; left: 19px; width: 2px; border-radius: 2px;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 35%, var(--line)));
}
.timeline.is-two-sided .timeline__line { left: calc(50% - 1px); }

.timeline__entry { --tone: var(--accent); position: relative; margin-bottom: 1rem; padding-left: 48px; }
.timeline__entry--decision { --tone: var(--accent-strong); }
.timeline__entry--appointment { --tone: var(--warning); }
.timeline__entry--items { --tone: color-mix(in srgb, var(--warning) 60%, var(--accent)); }
.timeline.is-laid-out .timeline__entry { position: absolute; left: 0; right: 0; margin: 0; }
.timeline.is-two-sided .timeline__entry { width: 50%; }
.timeline.is-two-sided .timeline__entry.is-left { right: auto; padding: 0 40px 0 0; }
.timeline.is-two-sided .timeline__entry.is-right { left: 50%; right: auto; padding: 0 0 0 40px; }

/* The dot on the line, and the short stroke from the dot to its card. */
.timeline__marker {
    position: absolute; z-index: 1; top: 14px; left: 4px;
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid var(--tone); background: var(--surface); color: var(--tone);
    box-shadow: 0 0 0 4px var(--bg);
}
.timeline__marker .icon { width: 16px; height: 16px; }
.timeline__entry::before { content: ''; position: absolute; top: 29px; left: 36px; width: 12px; height: 2px; background: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.timeline.is-two-sided .is-left .timeline__marker { left: auto; right: -16px; }
.timeline.is-two-sided .is-right .timeline__marker { left: -16px; }
.timeline.is-two-sided .is-left::before { left: auto; right: 16px; width: 24px; }
.timeline.is-two-sided .is-right::before { left: 16px; width: 24px; }

.timeline__card {
    display: grid; gap: 0.4rem; width: 100%; padding: 0.85rem 1rem 0.95rem;
    border: 1px solid var(--line); border-top: 3px solid var(--tone); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); color: inherit; font: inherit; text-align: left;
}
button.timeline__card { cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
button.timeline__card:hover { border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); border-top-color: var(--tone); transform: translateY(-1px); box-shadow: var(--shadow-raised); }
.timeline__date { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.timeline__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.timeline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.7rem; font-size: 0.8125rem; color: var(--ink-soft); }
.timeline__meta .icon { width: 1.05em; height: 1.05em; }
.timeline__done { font-weight: 700; color: var(--tone); }
.timeline__outcome { display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.45rem 0.7rem; border-radius: var(--radius-small); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; line-height: 1.35; }
.timeline__outcome .icon { flex: none; margin-top: 0.2em; }
.timeline__detail { display: flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; color: var(--ink-soft); }
.timeline__note { font-size: 0.875rem; line-height: 1.45; color: var(--ink-soft); }
.timeline__people { justify-self: start; }
.timeline__items { display: grid; gap: 0.2rem; margin: 0 -0.25rem; }
.timeline__item { display: flex; align-items: center; gap: 0.55rem; padding: 0.25rem; border: 0; border-radius: var(--radius-small); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.timeline__item:hover { background: var(--surface-soft); }
.timeline__item img, .timeline__item-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--surface-soft); color: var(--ink-soft); }

/* "3 weken later", just above the card, on the side of the line. */
.timeline__gap { display: block; margin-bottom: 0.3rem; font-size: 0.75rem; font-style: italic; color: var(--ink-soft); white-space: nowrap; }
.timeline.is-laid-out .timeline__entry .timeline__gap { position: absolute; top: -20px; left: 48px; margin: 0; }
.timeline.is-two-sided .is-left .timeline__gap { left: auto; right: 40px; }
.timeline.is-two-sided .is-right .timeline__gap { left: 40px; }

/* Where it starts and where we are now: pills on the line. */
.timeline__cap {
    position: relative; z-index: 1; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.45rem;
    margin: 0 0 1.25rem; padding: 0.4rem 0.9rem; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700;
    box-shadow: 0 0 0 4px var(--bg);
}
.timeline__cap .icon { width: 1.1em; height: 1.1em; }
.timeline__cap-date { font-weight: 500; opacity: 0.85; }
.timeline__cap--today { margin: 0.5rem 0 0; border: 2px solid var(--accent); background: var(--surface); color: var(--accent-strong); }
.timeline__cap .timeline__gap { position: absolute; top: -22px; left: 0.5rem; margin: 0; font-weight: 400; }
.timeline.is-laid-out .timeline__cap { position: absolute; left: 0; margin: 0; }
.timeline.is-laid-out [data-cap="start"] { top: 0; }
.timeline.is-two-sided .timeline__cap { left: 50%; transform: translateX(-50%); }
.timeline.is-two-sided .timeline__cap .timeline__gap { left: 50%; transform: translateX(-50%); }

/* ---------------------------------------------------------------- uitzet */

.category-grid { columns: 1; column-gap: 1.25rem; }
@media (min-width: 900px) { .category-grid { columns: 2; } }
.category { break-inside: avoid; margin-bottom: 1.75rem; }
.category__header { display: flex; align-items: center; gap: 0.6rem; margin: 0 0.25rem 0.6rem; }
.category__header h2 { margin-right: auto; font-size: 1.3rem; }
.category__header .icon { color: var(--accent); width: 1.4em; height: 1.4em; }
.category:not(:has(.row:not([hidden]))):not(.is-empty) { display: none; }

.item-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.item-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; text-align: left; padding: 0; color: inherit; box-shadow: var(--shadow); }
.item-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.item-card__photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--surface-soft); display: grid; place-items: center; color: var(--ink-soft); }
.item-card__photo .icon { width: 2.2em; height: 2.2em; opacity: 0.6; }
.item-card__body { display: grid; gap: 0.3rem; padding: 0.75rem 0.85rem; align-content: start; }
.item-card__title { font-weight: 700; }
.item-card__meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.item-line { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 60px; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.item-line:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.item-line:has(> .item-line__main) { gap: 0.15rem; padding: 0.25rem; }
.item-line__main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 0.25rem;
    border: 0;
    border-radius: var(--radius-small);
    background: none;
    color: inherit;
    text-align: left;
}
.item-line__copy {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: auto;
    min-width: var(--tap);
    height: auto;
    min-height: var(--tap);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-small);
    font-size: 0.75rem;
    font-weight: 600;
}
.item-line__text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.item-line__title { font-weight: 600; overflow-wrap: anywhere; }
.item-line.is-gone { opacity: 0.55; }

.fulfillment { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; padding: 0.85rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.fulfillment__big { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }

.filter-panel { display: grid; gap: 0.75rem; padding: 1rem; margin-bottom: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-panel__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.filter-panel__label { min-width: 110px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.filter-panel .choice > span { min-height: 32px; padding: 0.2em 0.7em; font-size: 0.875rem; }

/* A photo field: the photo as cropped, shown whole; tap it to crop again. */
.photo-field { display: grid; gap: 0.5rem; }
.photo-field__frame {
    display: grid;
    place-items: center;
    width: 100%;
    height: 240px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    overflow: hidden;
    cursor: pointer;
}
.photo-field__frame img { width: 100%; height: 100%; object-fit: contain; }
.photo-field__frame.is-empty { border: 2px dashed var(--line); background: var(--surface); color: var(--ink-soft); height: 140px; }
.photo-field__frame.is-empty:hover { border-color: var(--accent); color: var(--accent-strong); }
.photo-field__empty { display: grid; justify-items: center; gap: 0.25rem; font-weight: 600; }
.photo-field__empty .icon { width: 2em; height: 2em; }
.photo-field__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.photo-field__link { display: flex; gap: 0.4rem; align-items: center; }
.photo-field__link .input { flex: 1; min-width: 0; }
.photo-field__link .button { flex: none; }
.photo-field--round .photo-field__link { width: min(320px, 80vw); }

.photo-field--round { justify-items: center; flex: none; }
.photo-field--round .photo-field__frame { width: 110px; height: 110px; border-radius: 50%; }
.photo-field--round .photo-field__frame img { object-fit: cover; }
.photo-field--round .photo-field__actions .button span { display: none; }
.photo-field--round .photo-field__actions .button { padding: 0.3em 0.55em; }

/* The crop dialog: the photo large on a dark background, the tools underneath, within thumb reach. */
.cropper-dialog {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    background: #141210;
    color: #fff;
}
/* Cropper sizes itself to this element, so it must take its size from the screen, not from the photo. */
.cropper-dialog__stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; margin: 12px; }
.cropper-dialog__stage img { display: block; max-width: 100%; max-height: 100%; }
.cropper-dialog__bar {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem 16px calc(0.75rem + env(safe-area-inset-bottom));
    background: #1f1b18;
}
.cropper-dialog__tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }
.cropper-dialog__tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: var(--tap);
    padding: 0 0.85rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-weight: 600;
}
.cropper-dialog__tool:hover { background: rgb(255 255 255 / 0.08); }
.cropper-dialog__tool.is-active { background: #fff; color: #1f1b18; }
.cropper-dialog__actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.cropper-dialog__cancel { color: #fff; }
.cropper-dialog__cancel:hover { background: rgb(255 255 255 / 0.1); color: #fff; }
.cropper-dialog .cropper-view-box { outline-color: #fff; outline-width: 2px; }
/* Round: what is inside the circle is what you get, like a profile photo in a chat app. */
.cropper-dialog.is-round .cropper-view-box, .cropper-dialog.is-round .cropper-face { border-radius: 50%; }
.cropper-dialog.is-round .cropper-view-box { outline: 0; box-shadow: 0 0 0 2px #fff; }
.cropper-dialog.is-round .cropper-modal { opacity: 0.6; }

.photo-drop {
    display: grid; place-items: center; gap: 0.25rem;
    width: 100%; aspect-ratio: 16 / 7; max-height: 220px;
    border: 2px dashed var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink-soft); cursor: pointer; overflow: hidden; position: relative;
}
.photo-drop:hover { border-color: var(--accent); color: var(--accent-strong); }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop .icon { width: 2em; height: 2em; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop.has-photo { border-style: solid; }
.photo-drop__change { position: absolute; right: 0.6rem; bottom: 0.6rem; z-index: 1; }

/* ---------------------------------------------------------------- decisions */

.options { display: grid; gap: 0.75rem; }
@media (min-width: 560px) { .options { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: start; } }
.option { display: grid; gap: 0.5rem; align-content: start; padding: 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.option.is-chosen { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.option__title { font-weight: 700; }
.option__list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.option__pros li::marker { content: '+  '; color: var(--done); font-weight: 800; }
.option__cons li::marker { content: '–  '; color: var(--danger); font-weight: 800; }

.outcome { padding: 1rem; border-radius: var(--radius); background: var(--accent-soft); }
.outcome .label { color: var(--accent-strong); }

.history { display: grid; gap: 0.5rem; }
.history__entry { padding: 0.6rem 0.85rem; border-left: 3px solid var(--line); color: var(--ink-soft); font-size: 0.9rem; }

.decision-summary { display: grid; gap: 0.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.decision-summary:last-child { border-bottom: 0; }
.decision-summary__question { color: var(--ink-soft); font-size: 0.9rem; }
.decision-summary__outcome { font-family: var(--font-display); font-size: 1.15rem; }
.decision-summary__reasoning { color: var(--ink-soft); }

/* ---------------------------------------------------------------- steps */

.steps { display: grid; gap: 0.15rem; }
.step { display: flex; align-items: center; gap: 0.35rem; min-height: var(--tap); padding: 0.15rem 0.25rem; border-radius: var(--radius-small); }
.step textarea.inline-input { min-height: 0; padding-top: 0.45em; padding-bottom: 0.45em; }
.step:hover { background: var(--surface); }
.step input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0 0.4rem; cursor: pointer; }
.step .inline-input { flex: 1; width: auto; min-width: 0; margin: 0; }
.step.is-done .inline-input { color: var(--ink-soft); text-decoration: line-through; }
.step .icon-button { opacity: 0; }
.step:hover .icon-button, .step:focus-within .icon-button { opacity: 1; }

/* ---------------------------------------------------------------- plans (screen and paper share the layout) */

.plan-doc { max-width: 900px; margin: 0 auto; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.plan-doc__header { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.plan-doc__title { font-size: 2.4rem; letter-spacing: 0.02em; }

@media (max-width: 599px) {
    .plan-doc { padding: 1.1rem; }
    .plan-doc__header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .plan-doc__title { font-size: 1.7rem; letter-spacing: 0.01em; }
    .plan-section__header { flex-wrap: wrap; }
}
.plan-doc__photo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-strong); position: relative; overflow: hidden; }
.plan-doc__photo img { width: 100%; height: 100%; object-fit: cover; }
.plan-doc__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 0.5rem; }
.plan-fact { display: grid; }
.plan-fact__label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.plan-fact__value { font-weight: 700; }
.plan-fact.is-left-off .plan-fact__value { opacity: 0.45; text-decoration: line-through; }
.plan-fact__decision { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: -4px 0 -4px 0.15rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); vertical-align: middle; cursor: pointer; }
.plan-fact__decision:hover { background: var(--accent-soft); color: var(--accent-strong); }
.plan-fact__decision .icon { width: 15px; height: 15px; }
.plan-doc__intro { margin-bottom: 1.5rem; }

.plan-section { margin-top: 1.75rem; }
.plan-section__header { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.4rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--accent-soft); }
.plan-section__header h2 { margin-right: auto; color: var(--accent-strong); }
.plan-section.is-hidden-section .plan-entries, .plan-section.is-hidden-section .plan-section__tools { opacity: 0.45; }

.plan-entries { display: grid; gap: 0.6rem 1.5rem; }
@media (min-width: 720px) { .plan-entries { grid-template-columns: 1fr 1fr; } }

.plan-entry { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.4rem; margin: -0.4rem; border: 0; border-radius: var(--radius-small); background: none; text-align: left; width: 100%; }
button.plan-entry:hover { background: var(--surface-soft); }
.plan-entry__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); flex: none; position: relative; }
.plan-entry__icon .icon { width: 1.45em; height: 1.45em; stroke-width: 1.5; }
.plan-entry.is-avoid .plan-entry__icon { background: var(--danger-soft); color: var(--danger); }
.plan-entry__text { display: grid; gap: 0.05rem; min-width: 0; }
.plan-entry__label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.plan-entry__wording { font-weight: 700; }
.plan-entry.is-avoid .plan-entry__wording::before { content: ''; }
.plan-entry__explanation { font-size: 0.9rem; color: var(--ink-soft); }
.plan-entry.is-waiting { opacity: 0.6; }
.plan-entry.is-waiting .plan-entry__icon { background: transparent; border: 2px dashed var(--line); }

.plan-section__tools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 0.25rem; }
.icon-grid label { display: grid; place-items: center; height: 44px; border-radius: var(--radius-small); cursor: pointer; color: var(--ink-soft); }
.icon-grid label:hover { background: var(--surface-soft); color: var(--ink); }
.icon-grid input { position: absolute; opacity: 0; pointer-events: none; }
.icon-grid input:checked + .icon { color: var(--accent-strong); }
.icon-grid label:has(input:checked) { background: var(--accent-soft); }

/* ---------------------------------------------------------------- lists (settings) */

/* Something just added, shown before the server confirms it (assets/js/optimistic.js). */
.is-pending { opacity: 0.55; pointer-events: none; }
.pending-text { flex: 1; min-width: 0; padding: 0.3em 0.45em; overflow-wrap: anywhere; }
.options:empty, .attachment-list:empty { display: none; }
.plan-entries:has(> *) + .plan-section__empty { display: none; }

.list-editor { display: grid; gap: 0.35rem; }
.list-editor__row { display: flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.25rem; border-radius: var(--radius-small); background: var(--surface); border: 1px solid var(--line); }
.list-editor__row .inline-input { margin: 0; }
.list-editor__grip { cursor: grab; color: var(--ink-soft); padding: 0 0.25rem; display: grid; place-items: center; height: var(--tap); }
.chip-editor { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.chip-editor__chip { display: inline-flex; align-items: center; gap: 0.1rem; padding: 0.1rem 0.15rem 0.1rem 0.25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.chip-editor__chip input { width: auto; min-width: 2ch; max-width: 18ch; border: 0; background: none; padding: 0.25rem 0.35rem; field-sizing: content; }
.chip-editor__chip input:focus { outline: none; }
.chip-editor__chip button { width: 26px; height: 26px; }
.chip-editor__add { width: 9rem; min-width: 0; max-width: 100%; min-height: 36px; padding: 0 0.75rem; border: 1px dashed var(--line); border-radius: 999px; background: none; }
.chip-editor__add:focus { outline: none; border-style: solid; border-color: var(--accent); }
.sortable-ghost { opacity: 0.4; }

/* ---------------------------------------------------------------- budget */

.money-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1.5rem; }
.money-tile { padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.money-tile__label { color: var(--ink-soft); font-weight: 600; font-size: 0.875rem; }
.money-tile__amount { font-family: var(--font-display); font-size: 1.9rem; }
@media (max-width: 639px) {
    .money-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
    .money-tile { padding: 0.7rem 0.75rem; }
    .money-tile__label { font-size: 0.75rem; }
    .money-tile__amount { font-size: 1.2rem; }
    .money-table th, .money-table td { padding: 0.5rem 0.25rem; font-size: 0.875rem; }
}
.money-table { width: 100%; border-collapse: collapse; }
.money-table th, .money-table td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.money-table th { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 700; }
.money-table td.amount, .money-table th.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- search */

.search-overlay { position: fixed; inset: 0; z-index: 55; background: rgb(30 20 15 / 0.32); display: grid; align-items: start; justify-items: center; padding: 10vh 16px 16px; }
.search-overlay__panel { width: min(640px, 100%); max-height: 75vh; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-raised); overflow: hidden; }
.search-overlay__input { display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem; border-bottom: 1px solid var(--line); }
.search-overlay__input input { flex: 1; min-height: 60px; border: 0; background: none; font-size: 1.1rem; }
.search-overlay__input input:focus { outline: none; }
.search-results { overflow-y: auto; padding: 0.5rem; }
.search-results__group { padding: 0.6rem 0.6rem 0.2rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.search-result { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 46px; padding: 0.4rem 0.6rem; border: 0; border-radius: var(--radius-small); background: none; text-align: left; color: inherit; text-decoration: none; }
.search-result:hover { background: var(--surface-soft); }
.search-result .icon { color: var(--accent); }

/* ---------------------------------------------------------------- sign in */

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__card { width: min(400px, 100%); padding: 2rem; border-radius: calc(var(--radius) + 6px); background: var(--surface); box-shadow: var(--shadow-raised); }
.login__brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.login__error { padding: 0.6rem 0.85rem; margin-bottom: 1rem; border-radius: var(--radius-small); background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.login__card--wide { width: min(560px, 100%); }
@media (max-width: 639px) { .login__card { padding: 1.5rem 1.1rem; } }
.signup__partner { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- families (admin area and account) */

.admin-family.is-fresh { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.admin-family__parents { display: grid; gap: 0.6rem; }
.admin-parent { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.admin-parent__main { display: grid; min-width: 0; flex: 1 1 10rem; }
.admin-parent__main strong { overflow-wrap: anywhere; }
.admin-parent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.admin-parent__actions .switch { min-height: 36px; font-size: 0.875rem; }
.admin-family__children { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.admin-family__children > span { display: inline-flex; align-items: center; gap: 0.3em; }
.admin-family__children .icon { width: 1.05em; height: 1.05em; color: var(--accent); }

.impersonation { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35rem 0.75rem; padding: 0.45rem 16px; background: var(--warning-soft); color: var(--warning); font-size: 0.875rem; font-weight: 600; }
.impersonation > span { display: inline-flex; align-items: center; }
.impersonation a { display: inline-flex; align-items: center; gap: 0.3em; color: inherit; text-decoration: underline; }
.impersonation .icon { width: 1.1em; height: 1.1em; }

/* ---------------------------------------------------------------- print */

.print-only { display: none; }

@media print {
    @page { size: A4; margin: 14mm 14mm 16mm; }
    :root { --bg: #fff; --shadow: none; --shadow-raised: none; }
    body { background: #fff; font-size: 10.5pt; }
    .app-header, .bottom-nav, .toasts, .drawer, .no-print, .plan-section__tools, .search-overlay { display: none !important; }
    .print-only { display: block; }
    .page { padding: 0; max-width: none; }
    .plan-doc { border: 0; padding: 0; box-shadow: none; max-width: none; }
    .plan-entries { grid-template-columns: 1fr 1fr; }
    .plan-entry, .plan-section__header, .row, .decision-summary, .print-block { break-inside: avoid; }
    .plan-entry.is-waiting, .plan-section.is-hidden-section, .plan-fact.is-left-off, .plan-fact__decision { display: none; }
    .plan-entry__icon { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .card { border: 0; padding: 0; box-shadow: none; }
    a { color: inherit; text-decoration: none; }
    details.fold:not([open]) { display: none; }
}

/* Plain printable documents (shopping list, contacts, checklists). */
.print-doc { max-width: 820px; margin: 0 auto; }
.print-doc h1 { margin-bottom: 0.25rem; }
.print-doc__sub { color: var(--ink-soft); margin-bottom: 1.5rem; }
.print-doc h2 { margin: 1.5rem 0 0.5rem; font-size: 1.2rem; color: var(--accent-strong); }
.print-list { list-style: none; margin: 0; padding: 0; }
.print-list li { display: flex; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.print-box { width: 14px; height: 14px; margin-top: 4px; border: 1.5px solid var(--ink-soft); border-radius: 3px; flex: none; }
.print-box.is-checked { background: var(--ink-soft); }
.print-list__main { flex: 1; }
.print-list__aside { color: var(--ink-soft); white-space: nowrap; }
.print-toolbar { display: flex; gap: 0.5rem; justify-content: flex-end; margin-bottom: 1rem; }
