/* Lignee Kids, « la veilleuse »: bright milk-white pages, ink-blue text, the night blue of the range for actions,
   one golden light (the dot of the logo) used sparingly. Geist for everything, Caveat for handwritten captions.
   Fonts served by the app itself (SIL OFL). */
@font-face { font-family: "Geist"; src: url("/static/fonts/geist-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/static/fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #FFFFFF;           /* milk white page */
  --surface: #FFFFFF;
  --surface-alt: #EEF3FB;  /* pale sky: banners, bands, the gift pass */
  --field: #FFFFFF;
  --ink: #1C2236;          /* ink blue */
  --ink-soft: #5B6275;     /* 6.1:1 on white */
  --line: #E2E7F0;         /* one-pixel hairlines */
  --segment: #E9EEF6;
  --faint: #B4BCCB;        /* decorative only */
  --night: #1B2A4A;        /* night blue: the welcome page, buttons, icons */
  --night-soft: #C5D0E6;   /* text on night (9:1) */
  --gold: #F5B83D;         /* the little light: the dot of the logo, on night or as a mark, never as text on white */
  --gold-deep: #8A5A00;    /* gold as text on white (5.9:1) */
  --cheek: #F7C9B6;        /* warm touch: avatars, the family's bubbles */
  --brand: var(--night);
  --brand-soft: var(--surface-alt);
  --accent: var(--night);  /* actions are night blue */
  --accent-soft: var(--surface-alt);
  --accent-ink: #FFFFFF;
  --bronze: var(--gold-deep); /* the warm accent of the text (hearts, « Kids ») */
  --sage: var(--bronze);
  --sage-soft: transparent;
  --danger: #B3261E;
  --radius-photo: 10px;
  --radius-sheet: 18px;
  --radius: 12px;
  --display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --shadow: 0 1px 2px rgba(28, 34, 54, .06), 0 10px 30px -14px rgba(28, 34, 54, .22);
  /* Always light: a family album is a bright place (no dark theme) */
  color-scheme: light;
  /* Type roles (one family, Geist): titles in a soft 500, everything people read in 400 */
  --fs-display: 2.25rem;   /* page greetings, the child's name */
  --fs-title: 1.375rem;    /* a memory, dialogs, month */
  --fs-heading: 1.1875rem; /* sections, days, cards */
  --fs-body: 1.0625rem;    /* captions, fields, text */
  --fs-meta: .9375rem;     /* labels, dates, actions */
  --fs-tiny: .8125rem;     /* tags on photos, status, tab labels */
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); letter-spacing: -.003em; font-kerning: normal; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.22; margin: 0 0 .5rem; letter-spacing: -.012em; }
h1 { font-size: var(--fs-display); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; } h2 { font-size: var(--fs-title); } h3 { font-size: var(--fs-heading); }
h1, h2, h3 { text-wrap: balance; }
b, strong { font-weight: 600; }
p { margin: 0 0 .75rem; text-wrap: pretty; }
:root { accent-color: var(--night); caret-color: var(--night); scrollbar-color: var(--faint) transparent; }
::selection { background: color-mix(in srgb, var(--gold) 40%, transparent); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--fs-meta); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* Reduced motion: movement goes, feedback stays (fades instead of scales and slides) */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .btn:active { transform: none; }
  .memory .burst { animation: burst-fade .8s ease-out; transform: translate(-50%, -50%); }
  .rec { animation: none; text-decoration: underline; }
}
@keyframes burst-fade { 20%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* Layout */
.page { max-width: 680px; margin: 0 auto; padding: 20px 18px 112px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); z-index: 5; border-bottom: 1px solid var(--line); }
/* The logo « la boucle »: an l written in one thread ending on a golden dot, then the name in Geist (as icons/logo-lockup.svg) */
.brand { display: inline-flex; align-items: center; font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; white-space: nowrap; color: var(--ink); }
.brand span { color: var(--ink-soft); font-weight: 400; margin-left: .26em; }
.brand::before { content: ""; flex: none; width: 26px; height: 30px; margin-right: 9px; background: url("/static/icons/logo.svg") left center / contain no-repeat; }
.topbar a.brand { text-decoration: none; }
.topbar .who { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-soft); }
.topbar .who #family-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .link { border: 0; background: none; color: var(--ink-soft); font-size: var(--fs-meta); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 4px; }
@media (max-width: 420px) { .topbar .who #family-name { display: none; } }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 1rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  transition: transform .12s ease, background-color .12s ease; }
.btn:hover { background: var(--surface-alt); border-color: color-mix(in srgb, var(--line) 50%, var(--night)); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--night); border-color: var(--night); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--night) 86%, #fff); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
label { display: block; font-weight: 500; font-size: var(--fs-meta); letter-spacing: -.005em; margin-bottom: 6px; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.picker { display: flex; align-items: center; justify-content: center; min-height: 64px; margin: 0; border: 1px dashed var(--faint); color: var(--ink); text-transform: none; letter-spacing: .005em; font-size: 1rem; border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 500; }
.picker:hover { border-color: var(--ink); }
.sr-only:focus-visible + .picker { outline: 3px solid var(--accent); outline-offset: 2px; }
.input, select.input, textarea.input { width: 100%; min-height: 56px; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--field); font-size: var(--fs-body); letter-spacing: .005em; }
.input:focus { border-color: var(--night); }
.input:focus-visible { outline: 3px solid color-mix(in srgb, var(--night) 22%, transparent); outline-offset: 0; border-radius: var(--radius); }
textarea.input { min-height: 96px; resize: vertical; }
.card { background: var(--surface); border-radius: var(--radius-sheet); border: 1px solid var(--line); }
/* Settings sections: a spaced capitals label over a hairline, then airy rows (no boxes) */
.section > h2:first-child { font: 600 var(--fs-heading)/1.3 var(--display); letter-spacing: -.015em; color: var(--ink); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin: 0 0 4px; }
.section + .section, .section + div, .card + .section { margin-top: 44px; }
.section > .member { padding: 18px 0; border-bottom: 1px solid var(--line); }
.pad { padding: 20px; }
.error { color: var(--danger); font-weight: 500; }
.notice { background: var(--surface-alt); border-radius: var(--radius-sheet); padding: 16px 18px; }
.notice.success { background: var(--sage-soft); box-shadow: none; }

/* Child filter: a dot of the child's colour, ink when selected */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--accent-ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pill, var(--accent)); display: inline-block; flex: none; }

/* A memory: prints first, then the child's name and age as the title. Not a card: it sits on the paper. */
.card.memory { background: none; box-shadow: none; border: 0; border-radius: 0; margin-bottom: 52px; }
.memory .media-grid { display: grid; gap: 4px; grid-template-columns: 1fr 1fr; }
.memory .media-grid .tile { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius-photo); overflow: hidden; background: var(--line); box-shadow: var(--shadow); cursor: zoom-in; color: inherit; }
.memory .media-grid .tile:focus-visible { outline-offset: 3px; }
.memory .media-grid img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; cursor: zoom-in; }
.memory .media-grid.one { grid-template-columns: 1fr; }
.memory .media-grid.one img { aspect-ratio: auto; max-height: 78vh; }
.memory .media-grid.three { grid-template-columns: 1.55fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 5 / 4; }
.memory .media-grid.three .tile:first-child { grid-row: 1 / span 2; }
.memory .media-grid.three img, .memory .media-grid.four img { aspect-ratio: auto; }
.memory .media-grid.four { grid-template-rows: 1fr 1fr; aspect-ratio: 1; }
.memory .media-grid .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(30, 26, 23, .45);
  color: #fff; font-family: var(--display); font-weight: 300; font-size: var(--fs-display); font-variant-numeric: tabular-nums; pointer-events: none; }
.memory audio { width: 100%; }
.memory .burst { position: absolute; left: 50%; top: 50%; color: #fff; pointer-events: none; transform: translate(-50%, -50%) scale(.4); opacity: 0;
  filter: drop-shadow(0 4px 14px rgba(30, 26, 23, .35)); animation: burst .8s ease-out; }
.memory .burst svg { width: 84px; height: 84px; display: block; }
@keyframes burst { 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 30% { transform: translate(-50%, -50%) scale(.95); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
.memory .body { padding: 18px 2px 0; }
.memory .title { font-family: var(--display); font-weight: 400; font-size: var(--fs-title); letter-spacing: 0; line-height: 1.2; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.memory .title .dots { display: inline-flex; gap: 3px; }
.memory .when { font-size: var(--fs-meta); color: var(--ink-soft); margin: 8px 0 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border-radius: 0; font-size: var(--fs-meta); font-weight: 400; letter-spacing: .01em; background: none; color: var(--ink); }
.milestone { color: var(--bronze); }
.badge.new { color: var(--ink); }
.memory .tags { gap: 6px; margin-bottom: 6px; }
.notice.new-since { background: none; border-left: 2px solid var(--bronze); border-radius: 0; padding: 4px 0 4px 16px; font-weight: 400; color: var(--ink); }
.caption { margin: 4px 0 0; max-width: 68ch; font-size: var(--fs-body); line-height: 1.6; }
.actions { display: flex; gap: 4px 22px; margin-top: 8px; flex-wrap: wrap; }
.actions .btn { min-height: 44px; padding: 0; border: 0; background: none; box-shadow: none; font-weight: 400; font-size: var(--fs-meta); letter-spacing: .005em; text-transform: none; color: var(--ink); }
.actions .btn:hover { background: none; color: var(--bronze); }
.actions .btn[aria-pressed="true"] { color: var(--bronze); }
.actions .btn[aria-pressed="true"] svg { fill: currentColor; }
.actions .btn.voice, .actions .btn.ghost { color: var(--ink-soft); }
.comments { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--line); }
.comment { font-size: var(--fs-meta); margin: 6px 0; max-width: 68ch; }
.comment b { font-weight: 500; margin-right: 4px; }
.comment audio { margin-top: 4px; height: 40px; }
.memory .video .frame { position: relative; border-radius: var(--radius-photo); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.memory .video video { display: block; width: 100%; max-height: 78vh; background: #000; }
.memory .video .duration { position: absolute; right: 12px; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(30, 26, 23, .7); color: #fff; font-size: var(--fs-tiny); font-variant-numeric: tabular-nums; pointer-events: none; }
.memory .video .video-note { margin: 8px 0 0; }
.memory .media-grid + .video, .memory .video + .video { margin-top: 4px; }

/* Day headings in the feed, like a diary */
.day { font: 400 var(--fs-heading)/1.3 var(--display); letter-spacing: 0; color: var(--ink); margin: 40px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hello { font-family: var(--display); font-weight: 300; font-size: var(--fs-display); letter-spacing: -.01em; color: var(--ink); line-height: 1.12; margin: 4px 0 14px; }

/* Timeline: the age in large type, then a magazine mosaic (large left, then large right) */
.age-counter { display: flex; justify-content: center; gap: 28px; margin: 12px 0 4px; }
.age-counter div { text-align: center; }
.age-counter small { display: block; font-size: var(--fs-meta); letter-spacing: .01em; color: var(--ink-soft); }
.age-counter b { display: block; font-weight: 300; font-size: var(--fs-display); line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.timeline-name { font-family: var(--display); font-weight: 300; font-size: var(--fs-display); line-height: 1.12; letter-spacing: -.01em; color: var(--ink); text-align: center; margin: 6px 0 2px; }
.month { margin-top: 36px; }
.month-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.month-head .age { font-family: var(--display); font-weight: 400; font-size: var(--fs-title); letter-spacing: 0; color: var(--ink); line-height: 1.15; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 4px; }
.thumbs button { border: 0; padding: 0; background: var(--surface); border-radius: var(--radius-photo); overflow: hidden; cursor: pointer; aspect-ratio: 1; position: relative; color: var(--ink); }
.thumbs button:nth-child(6n + 1) { grid-column: 1 / span 2; grid-row: span 2; }
.thumbs button:nth-child(6n + 4) { grid-column: 2 / span 2; grid-row: span 2; }
.thumbs button:only-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .text-tile { display: flex; align-items: center; padding: 14px; font-family: var(--sans); font-weight: 500; font-size: var(--fs-meta); line-height: 1.35; height: 100%; text-align: left; background: var(--surface); }
.thumbs .flag { position: absolute; left: 8px; bottom: 8px; font-size: var(--fs-tiny); font-weight: 400; letter-spacing: .01em; background: rgba(251, 250, 248, .94); color: var(--ink); padding: 3px 8px; border-radius: 2px; }
.thumbs button .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(30, 26, 23, .55); color: #fff; display: grid; place-items: center; font-size: 14px; pointer-events: none; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center;
  border: 0; background: none; cursor: pointer; font-size: var(--fs-tiny); font-weight: 400; letter-spacing: .005em; color: var(--ink-soft); }
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 400; }
.tab.add .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  margin-top: -26px; border: 4px solid var(--bg); box-shadow: 0 4px 12px rgba(28, 34, 54, .15); }
.tab.add .plus svg { stroke: #fff; width: 26px; height: 26px; }

/* Dialog */
dialog { border: 0; border-radius: 8px; padding: 0; width: min(560px, 94vw); background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(30, 26, 23, .3); }
dialog::backdrop { background: rgba(30, 26, 23, .5); backdrop-filter: blur(2px); }
dialog .head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
dialog .head h2 { margin: 0; }
dialog .content { padding: 4px 20px 20px; max-height: 75vh; overflow: auto; }
.picked { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.picked img, .picked .text-tile { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 16, 14, .96); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox .close { position: absolute; top: 14px; right: 14px; }

/* Members */
.member { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member.stacked { display: block; }
.member-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.member .link { border: 0; background: none; color: var(--accent); font-weight: 500; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 10px 0 0; }
.status { font-size: var(--fs-tiny); font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); white-space: nowrap; }
.status.active { background: none; color: var(--bronze); }
.copybox { font-family: ui-monospace, monospace; font-size: var(--fs-tiny); word-break: break-all; background: var(--bg); padding: 12px; border-radius: 10px; }
.gift-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; font-size: var(--fs-heading); }

/* Grandparents' album: larger type and targets, one level of navigation */
body.simple { font-size: 18px; }
body.simple h1, body.simple .hello { font-size: 2.5rem; }
body.simple .btn { min-height: 58px; font-size: var(--fs-body); }
body.simple .actions { gap: 10px; }
body.simple .actions .btn { min-height: 56px; flex: 1 1 150px; white-space: nowrap; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
body.simple .actions .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
body.simple .caption { font-size: 1.2rem; }
body.simple .memory .title { font-size: 1.8rem; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button { min-width: 46px; min-height: 46px; border-radius: 999px; border: 0; background: none; font: 400 var(--fs-tiny) var(--sans); letter-spacing: .08em; color: var(--ink-soft); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.rec { animation: pulse 1.2s infinite; color: var(--danger) !important; }
@keyframes pulse { 50% { opacity: .55; } }
.toggle-line { display: flex; gap: 14px; align-items: center; padding: 18px 4px; font-size: var(--fs-body); color: var(--ink-soft); cursor: pointer; }
.toggle-line input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }

/* Photo prints on the welcome pages: the one decorative moment */
.prints { position: relative; width: 300px; height: 168px; margin: 8px auto 16px; }
.print { margin: 0; background: #fff; padding: 7px 7px 26px; border-radius: 6px; box-shadow: 0 1px 2px rgba(28, 34, 54, .08), 0 10px 24px -8px rgba(28, 34, 54, .18); }
.print img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 3px; }
.print figcaption { font: 500 1.2rem/1 var(--hand); color: var(--ink); padding: 7px 2px 0; margin-bottom: -16px; }
.prints .print { position: absolute; width: 128px; }
.prints .print:nth-child(1) { left: 0; top: 18px; transform: rotate(-7deg); }
.prints .print:nth-child(2) { left: 86px; top: 0; transform: rotate(4deg); z-index: 1; }
.prints .print:nth-child(3) { left: 172px; top: 22px; transform: rotate(-3deg); z-index: 2; }

/* Legal pages */
.legal { max-width: 68ch; line-height: 1.65; }
.legal h1 { font-size: var(--fs-display); }
.legal h2 { margin-top: 1.8em; }
.legal .draft { padding: 12px 16px; border-radius: 14px; background: #FFF4E5; color: #5A4632; font-size: var(--fs-meta); }
.legal .table-wrap { overflow-x: auto; }
.legal table { border-collapse: collapse; width: 100%; font-size: var(--fs-meta); background: var(--surface); border-radius: 14px; overflow: hidden; }
.legal th, .legal td { border-bottom: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; }
.legal th { font-weight: 500; background: color-mix(in srgb, var(--surface) 92%, var(--line)); }
.legal-links { font-size: var(--fs-meta); color: var(--ink-soft); text-align: center; padding: 20px 0 28px; }
.legal-links a { color: inherit; }
.legal-links a + a { margin-left: 18px; }

/* Home: the grandparent invitation shows who it is for */
.invite-card { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 24px; align-items: center; }
.invite-card .print { transform: rotate(-3deg); }
@media (max-width: 520px) { .invite-card { grid-template-columns: 88px minmax(0, 1fr); gap: 14px 16px; align-items: start; } .invite-card .print { width: 88px; padding: 4px 4px 14px; margin: 4px 0 0; } .invite-card h2 { font-size: var(--fs-heading); align-self: center; margin: 0; }
  .invite-card > .stack { display: contents; } .invite-card > .stack > p { grid-column: 1 / -1; margin: 0; } .invite-card > .stack > div:last-child { grid-column: 1 / -1; } .invite-card > .stack > div:last-child .btn { width: 100%; } }

/* Two choices side by side (create an account / sign in) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px; background: var(--segment); }
.segmented button { border: 0; background: none; min-height: 44px; border-radius: 999px; font: 400 var(--fs-meta) var(--sans); color: #5E5952; cursor: pointer; }  /* 5.6:1 on the segment */
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 34, 54, .08); }
.auth-box .link { justify-self: start; border: 0; background: none; min-height: 44px; padding: 0; font: 400 var(--fs-meta) var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* More actions on a memory (delete lives here, away from like and comment) */
.more-actions { position: relative; margin-left: auto; }
.more-actions > summary { list-style: none; min-width: 44px; justify-content: center; color: var(--ink-soft); }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions .menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 4; min-width: 220px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 4px rgba(28, 34, 54, .06), 0 16px 32px -12px rgba(28, 34, 54, .22); }
.more-actions .menu .btn { width: 100%; justify-content: flex-start; padding: 0 14px; border-radius: 8px; }
.actions .more-actions .menu .btn.danger, .btn.danger { color: var(--danger); }
.actions .more-actions .menu .btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
.card-title { font-size: var(--fs-heading); }
button.link { display: inline-flex; align-items: center; min-height: 44px; }
.home .rail:not(:has(> :not(.hidden))) { display: none; }

/* Larger screens: each one gets its own layout (not the phone stretched) ------------------------- */
@media (min-width: 720px) {
  .thumbs { grid-template-columns: repeat(4, 1fr); }
  .thumbs button:nth-child(6n + 4) { grid-column: 3 / span 2; }
  .family-page { max-width: 680px; margin-inline: auto; }
}

/* Tablet in landscape and computer: navigation on the side, content uses the width */
@media (min-width: 1024px) {
  body.with-nav .topbar { padding-inline: 28px; }
  body.with-nav .tabbar { top: 73px; bottom: 0; right: auto; width: 240px; flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 2px; padding: 28px 16px; border-top: 0; border-right: 1px solid var(--line); background: var(--bg); backdrop-filter: none; }
  body.with-nav .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 48px; padding: 0 16px; border-radius: 999px; font-size: 1rem; color: var(--ink-soft); }
  body.with-nav .tab:hover { color: var(--ink); background: color-mix(in srgb, var(--bg) 94%, var(--ink)); }
  body.with-nav .tab[aria-current="page"] { color: var(--ink); background: var(--brand-soft); }
  body.with-nav .tab.add { order: -1; margin-bottom: 20px; background: var(--ink); color: var(--accent-ink); }
  body.with-nav .tab.add:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); color: var(--accent-ink); }
  body.with-nav .tab.add .plus { width: auto; height: auto; margin: 0; border: 0; box-shadow: none; background: none; }
  body.with-nav .tab.add .plus svg { width: 22px; height: 22px; }
  body.with-nav .page { max-width: none; margin: 0 0 0 240px; padding: 36px 48px 72px; }

  /* Home: the feed in a reading column, the side cards in a rail on the right */
  .home { display: grid; grid-template-columns: minmax(0, 680px) minmax(260px, 340px); column-gap: 56px; justify-content: center; align-items: start; }
  .home > .hello { grid-column: 1 / -1; }
  .home > .feed { grid-column: 1; grid-row: 2; }
  .home > .rail { grid-column: 2; grid-row: 2; position: sticky; top: 92px; }
  .home.no-rail, .home:not(:has(.rail > :not(.hidden))) { grid-template-columns: minmax(0, 680px); }
  .home .rail .invite-card { grid-template-columns: 1fr; }
  .home .rail .invite-card .print { width: 180px; margin: 4px auto 0; }
  .home .feed > .day:first-child { margin-top: 0; }

  /* Timeline: a wider mosaic, five across */
  .page[data-view="timeline"] > * { max-width: 1080px; margin-inline: auto; }
  .page[data-view="timeline"] .thumbs { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .page[data-view="timeline"] .thumbs button:nth-child(6n + 4) { grid-column: 4 / span 2; }

  /* Family: two columns of settings */
  .family-page { max-width: 1080px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 56px; align-items: start; }
  .family-page > * { margin-top: 0 !important; }
  .family-page > h1, .family-page > #invite-result { grid-column: 1 / -1; }
  dialog { width: min(640px, 90vw); }
}
@media (min-width: 1440px) {
  body.with-nav .page { padding-inline: 64px; }
}

/* Narrow screens with the language choice (family album): the logo keeps only its symbol, the name stays readable by screen readers */
@media (max-width: 480px) {
  .topbar:has(.lang-switch) .brand { width: 26px; overflow: hidden; }
  .lang-switch button { min-width: 44px; }
}

/* Home on phones and tablets: greeting, then the side cards (compact), then the feed;
   an empty album puts its first action before the invitation */
@media (max-width: 1023px) {
  .home { display: flex; flex-direction: column; }
  .home > .hello { order: 0; }
  .home > .rail { order: 1; margin-bottom: 8px; }
  .home > .feed { order: 2; }
  .home.empty > .feed { order: 1; margin-bottom: 20px; }
  .home.empty > .rail { order: 2; }
}

/* "Add a child", "I have a gift code": quiet disclosures aligned with the rows above */
.section details > summary { list-style: none; cursor: pointer; }
.section details > summary::-webkit-details-marker { display: none; }
.section details > summary.btn.ghost { justify-content: flex-start; padding: 0; min-height: 48px; text-decoration: underline; text-underline-offset: 4px; }

/* Adding a memory: the publish button stays in view while the form scrolls */
#add-dialog .content { padding-bottom: 0; }
#add-dialog #add-publish { position: sticky; bottom: 0; margin-top: 18px; box-shadow: 0 -16px 16px -4px var(--bg); }
#add-dialog .content > :last-child { margin-bottom: 20px; }

@media (min-width: 1024px) {
  /* Family: settings flow in two balanced columns (no hole beside a short section) */
  .family-page { display: block; columns: 2; column-gap: 56px; }
  .family-page > * { break-inside: avoid; margin: 0 0 44px !important; }
  .family-page > h1, .family-page > #invite-result { column-span: all; }
  .family-page > #invite-result:empty { display: none; }
}

/* Finishing: hover states, video placeholders, the comment field, icon buttons */
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.segmented button:not(.on):hover { color: var(--ink); }
button.link:hover, .member .link:hover, .topbar .link:hover { color: var(--ink); }
.text-tile.video-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1; padding: 8px; color: var(--ink-soft); text-align: center; overflow: hidden; }
.text-tile.video-tile .small { font-size: var(--fs-tiny); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.thumbs button .play svg { margin-left: 2px; }
.btn.ghost svg, .btn.close svg { width: 22px; height: 22px; }
dialog .head .btn.ghost { min-width: 48px; padding: 0; }
.lightbox .close { color: #fff; border-color: rgba(255, 255, 255, .5); min-width: 52px; padding: 0; }
.compose { margin-top: 12px; }
.compose .row .btn { min-height: 44px; padding: 0 20px; }

/* Sign in with Google or with a Lignee account: white buttons with their mark, then « or with your e-mail » */
.sso { display: grid; gap: 10px; }
.sso-btn { justify-content: center; gap: 12px; background: var(--surface); border-color: var(--line); font-weight: 500; }
.sso-btn svg { flex: none; stroke: none; width: 20px; height: 20px; }  /* the marks keep their own colours */
.sso-btn:hover { background: var(--surface-alt); }
.sso-terms { margin: 2px 0 0; }
.sso-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; color: var(--ink-soft); font-size: var(--fs-meta); }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* =====================================================================================================
   « La veilleuse » inside the app: night bands with the thread and the golden light, children as faces,
   the timeline as a thread with a light for each month, photos that develop. One orchestrated moment
   per screen (the thread drawing itself), then calm.
   ===================================================================================================== */

/* Photos develop the first time they appear, like a print coming out of the bath */
img.dev { filter: sepia(.55) saturate(.5) brightness(1.15) contrast(.88) blur(4px); opacity: .3; transition: filter 1.2s cubic-bezier(.2, .7, .2, 1), opacity .7s ease; }
img.dev.ready { filter: none; opacity: 1; }
img.dev.instant { transition: none; }

/* A like: the heart springs, a golden ring spreads */
.actions .btn { position: relative; }
.actions .btn.pop svg { animation: heart-pop .55s cubic-bezier(.2, 1.7, .4, 1); }
.actions .btn.pop::before { content: ""; position: absolute; left: -2px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  border: 2px solid var(--gold); pointer-events: none; animation: ring .6s ease-out forwards; }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* Faces of the children: the colour of each child as a ring, filled when chosen */
.avatar { --c: var(--night); flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, #fff); color: color-mix(in srgb, var(--c) 70%, var(--ink)); font: 600 1rem/1 var(--sans); letter-spacing: 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }
.avatar.all { position: relative; background: var(--surface-alt); box-shadow: inset 0 0 0 2px var(--line); }
.avatar.all i { position: absolute; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }
.avatar.all i:nth-child(1) { left: 7px; top: 9px; } .avatar.all i:nth-child(2) { right: 7px; top: 9px; } .avatar.all i:nth-child(3) { left: 14px; bottom: 7px; }
.kid-switch { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.kid-switch::-webkit-scrollbar { display: none; }
.kid { --c: var(--night); flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 5px; min-width: 64px; padding: 6px 6px 8px; border: 0; border-radius: 16px;
  background: none; cursor: pointer; color: var(--ink-soft); font: 400 var(--fs-tiny)/1.2 var(--sans); transition: background-color .2s ease, color .2s ease; }
.kid .avatar { width: 48px; height: 48px; font-size: 1.15rem; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), background-color .2s, color .2s; }
.kid:hover { background: var(--surface-alt); }
.kid[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.kid[aria-pressed="true"] .avatar { background: var(--c); color: #fff; transform: scale(1.06); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.kid[aria-pressed="true"] .avatar.all { background: var(--night); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--night); }
.kid-name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-sub { color: var(--ink-soft); font-weight: 400; font-size: .75rem; }
.night-band .kid, .on-night .kid { color: var(--night-soft); }
.night-band .kid:hover, .on-night .kid:hover { background: rgba(255, 255, 255, .07); }
.night-band .kid[aria-pressed="true"], .on-night .kid[aria-pressed="true"] { color: #fff; }
.night-band .kid .avatar, .on-night .kid .avatar { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, #fff); }
.night-band .kid[aria-pressed="true"] .avatar, .on-night .kid[aria-pressed="true"] .avatar { background: var(--c); box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--gold); }
.night-band .avatar.all i, .on-night .avatar.all i { border-color: var(--night); }

/* Night bands: the greeting of the home, the cover of each child, the family */
.night-band { position: relative; overflow: hidden; isolation: isolate; color: #fff; background: var(--night); border-radius: 26px;
  padding: 30px 28px 28px; margin: 0 0 30px; min-height: 260px;
  background-image: radial-gradient(120% 90% at 85% 100%, rgba(245, 184, 61, .16), transparent 55%), radial-gradient(80% 60% at 0% 0%, rgba(255, 255, 255, .06), transparent 60%); }
.night-band .cover-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: blur(2px) saturate(.8); transform: scale(1.04); }
.night-band .cover-photo + .veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, var(--night) 30%, rgba(27, 42, 74, .55) 70%, rgba(27, 42, 74, .8)); }
.night-band h1, .night-band h2 { color: #fff; }
.night-band .lead { color: var(--night-soft); max-width: 40ch; font-size: var(--fs-body); }
.night-band .copy { position: relative; z-index: 2; max-width: 56%; }
.night-band .stage { position: absolute; z-index: 1; right: 0; top: 0; bottom: 0; width: 48%; max-width: 420px; aspect-ratio: auto; }
.night-band .thread { position: absolute; inset: 5% 4% 3% auto; height: 92%; width: auto; aspect-ratio: 560 / 640; overflow: visible; }
.night-band .thread .line { stroke: rgba(255, 255, 255, .55); stroke-width: 3; }
.night-band .thread .glow { animation: glow 1.4s ease-out 2.6s forwards, breathe 6s ease-in-out 4s infinite; }
@keyframes breathe { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: .75; transform: scale(1.25); } }
.night-band .print.pinned { position: absolute; width: 34%; padding: 5px 5px 22px; opacity: 0; animation: settle .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.night-band .print.pinned img { aspect-ratio: 4 / 5; }
.night-band .print.pinned figcaption { font-size: 1.05rem; padding-top: 5px; margin-bottom: -14px; color: var(--ink); }
.night-band .print.pinned.p1 { --r: -6deg; right: 46%; top: 16%; animation-delay: .5s; }
.night-band .print.pinned.p2 { --r: 5deg; right: 10%; top: 8%; animation-delay: .8s; }
.night-band .print.pinned.p3 { --r: -2deg; right: 26%; top: 46%; animation-delay: 1.1s; }
.night-band .kid-switch { margin: 18px -6px 0; }
.night-band .btn { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; }
.night-band .btn:hover { background: rgba(255, 255, 255, .12); }
.night-band .btn.gold { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }
.night-band .btn.gold:hover { background: #f8c95e; }
.night-band .row { margin-top: 20px; }
.night-band .hello { color: #fff; font-weight: 300; margin: 0 0 8px; }

/* The cover of a child: the name in large type, the age in golden figures */
.child-cover { min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.child-cover .copy { max-width: 62%; }
.child-cover .child-name { font: 300 clamp(2.6rem, 7vw, 4.2rem)/1 var(--display); letter-spacing: -.035em; margin: 0 0 14px; color: #fff; }
.child-cover .born { color: var(--night-soft); font-size: var(--fs-meta); margin: 0; }
.age-gold { display: flex; gap: 22px; margin: 0 0 16px; }
.age-gold div { display: grid; }
.age-gold b { font: 300 clamp(2rem, 5vw, 2.8rem)/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.age-gold small { color: var(--night-soft); font-size: var(--fs-tiny); letter-spacing: .01em; margin-top: 4px; }
.growth { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.growth .chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font-size: var(--fs-meta); }
.growth .chip small { color: var(--night-soft); }

/* The timeline as a thread: a line down the side, a light for each month (golden for a milestone) */
.lifeline { position: relative; padding-left: 34px; }
.lifeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 40px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--night) 0, color-mix(in srgb, var(--night) 30%, transparent) 100%); }
.lifeline .month { position: relative; margin-top: 30px; }
.lifeline .month:first-child { margin-top: 6px; }
.lifeline .month::before { content: ""; position: absolute; left: -31px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--night); }
.lifeline .month.has-milestone::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent); }
.lifeline .month-head .age { font-weight: 500; }
.lifeline .end { position: relative; color: var(--ink-soft); font: 500 1.35rem/1.2 var(--hand); padding: 22px 0 0; }
.lifeline .end::before { content: ""; position: absolute; left: -29px; top: 26px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }

/* Empty places invite: dashed prints waiting on the thread */
.waiting { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px 30px; border-radius: 22px; background: var(--surface-alt); }
.waiting .frames { display: flex; gap: 10px; margin-bottom: 14px; }
.waiting .frames span { width: 74px; aspect-ratio: 4 / 5; border-radius: 6px; border: 1.5px dashed color-mix(in srgb, var(--night) 35%, transparent); background: rgba(255, 255, 255, .7); }
.waiting .frames span:nth-child(1) { transform: rotate(-6deg) translateY(6px); } .waiting .frames span:nth-child(3) { transform: rotate(5deg) translateY(4px); }
.waiting h2 { margin: 0; } .waiting p { color: var(--ink-soft); max-width: 44ch; margin: 0 0 10px; }
.waiting .row { justify-content: center; }

/* Storage, like a gauge */
.gauge { height: 10px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.gauge > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--night), #3C5A96); width: 0; transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.gauge.warn > div { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }

/* Screen changes: a short fade, the content arrives */
.page.enter > * { animation: enter .45s cubic-bezier(.2, .7, .2, 1) both; }
.page.enter > *:nth-child(2) { animation-delay: .05s; } .page.enter > *:nth-child(3) { animation-delay: .1s; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* Dialogs rise as sheets on phones, open softly on large screens */
dialog[open] { animation: sheet .35s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: veil .3s ease; }
@keyframes sheet { from { opacity: 0; transform: translateY(24px) scale(.985); } }
@keyframes veil { from { opacity: 0; } }
@media (max-width: 719px) {
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  dialog .content { max-height: calc(92vh - 70px); }
  @keyframes sheet { from { transform: translateY(100%); } }
}
.lightbox { animation: veil .25s ease; }
.lightbox img { animation: zoom-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes zoom-in { from { transform: scale(.94); opacity: .4; } }

/* Tab bar on phones: the active tab carries the golden light, the add button is the night with a golden ring */
.tab { position: relative; transition: color .2s ease; }
.tab:not(.add)::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold);
  transform: scale(0); transition: transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.tab[aria-current="page"]::after { transform: scale(1); }
.tab.add .plus { background: var(--night); box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(27, 42, 74, .3); transition: transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.tab.add:hover .plus, .tab.add:active .plus { transform: rotate(90deg); }

/* Large screens: the navigation is the night, with the logo, the family and the golden « Add » */
.nav-brand, .nav-foot { display: none; }
@media (min-width: 1024px) {
  body.with-nav .topbar { display: none; }
  body.with-nav .tabbar { top: 0; background: var(--night); border-right: 0; color: #fff; padding: 26px 18px 22px; width: 248px;
    background-image: radial-gradient(140% 50% at 0% 100%, rgba(245, 184, 61, .14), transparent 60%); }
  body.with-nav .nav-brand { display: flex; align-items: center; gap: 10px; order: -2; padding: 2px 10px 30px; color: #fff; font: 600 1.3rem/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
  body.with-nav .nav-brand img { width: 26px; height: 30px; }
  body.with-nav .nav-brand span { color: var(--gold); font-weight: 400; margin-left: -4px; }
  body.with-nav .tab { color: var(--night-soft); }
  body.with-nav .tab:hover { color: #fff; background: rgba(255, 255, 255, .07); }
  body.with-nav .tab[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .1); }
  body.with-nav .tab:not(.add)::after { left: auto; right: 16px; bottom: 50%; margin: 0 0 -3px; width: 6px; height: 6px; }
  body.with-nav .tab.add { background: var(--gold); color: var(--night); font-weight: 600; margin-bottom: 22px; }
  body.with-nav .tab.add:hover { background: #f8c95e; color: var(--night); }
  body.with-nav .tab.add .plus { box-shadow: none; background: none; color: var(--night); }
  body.with-nav .tab.add .plus svg { stroke: var(--night); }
  body.with-nav .nav-foot { display: grid; gap: 4px; margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .1); color: var(--night-soft); font-size: var(--fs-meta); }
  body.with-nav .nav-foot b { color: #fff; font-weight: 500; }
  body.with-nav .nav-foot button { justify-self: start; border: 0; background: none; padding: 0; min-height: 36px; color: var(--night-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
  body.with-nav .nav-foot button:hover { color: #fff; }
  body.with-nav .page { margin-left: 248px; padding-top: 32px; }
  .night-band { padding: 40px 44px 36px; min-height: 300px; }
  .child-cover { min-height: 340px; }
}
@media (max-width: 640px) {
  .night-band { border-radius: 22px; padding: 24px 20px 22px; margin-inline: -4px; }
  .night-band .copy, .child-cover .copy { max-width: none; }
  .night-band .stage { position: relative; width: 100%; max-width: none; height: 190px; margin: -6px 0 6px; }
  .night-band .thread { inset: 0 6% auto auto; height: 100%; }
  .night-band:not(.has-stage) .stage { position: absolute; inset: 0 0 auto auto; width: 46%; height: 70%; margin: 0; opacity: .7; }
  .night-band .print.pinned { width: 28%; }
  .night-band .print.pinned.p1 { right: 58%; top: 10%; } .night-band .print.pinned.p2 { right: 26%; top: 0; } .night-band .print.pinned.p3 { right: 2%; top: 30%; }
  .night-band.has-stage { display: flex; flex-direction: column; }
  .night-band.has-stage .stage { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  img.dev { transition: opacity .3s ease; filter: none; }
  .actions .btn.pop svg, .actions .btn.pop::before { animation: none; }
  .night-band .thread .glow { animation: none; opacity: .45; }
  .night-band .thread .line { animation: none; stroke-dashoffset: 0; }
  .night-band .thread .dot { animation: none; opacity: 1; }
  .night-band .print.pinned { animation: none; opacity: 1; transform: rotate(var(--r)); }
  .page.enter > *, dialog[open], .lightbox, .lightbox img { animation: none; }
  .kid .avatar, .tab.add .plus { transition: none; }
}
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suffix { position: relative; }
.suffix span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: var(--fs-meta); pointer-events: none; }
.suffix .input { padding-right: 64px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); transform: scale(1.06); }
.child-row .row { gap: 14px; flex-wrap: nowrap; }
.block-line { display: block; }
.row.spread { justify-content: space-between; }
.family-band { min-height: 220px; }
.family-band .kid-switch { margin-top: 12px; }
#add-mode { margin-bottom: 4px; }
/* The thread draws itself once per visit; afterwards it is simply there, and the light keeps breathing */
.night-band .thread .line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: thread 2.4s cubic-bezier(.45, .05, .25, 1) .2s forwards; }
.night-band .thread .dot { fill: var(--gold); opacity: 0; animation: light .7s ease-out 2.5s forwards; }
.night-band .thread .glow { fill: var(--gold); opacity: 0; filter: blur(14px); transform-origin: 416px 573px; }
body.lk-drawn .night-band .thread .line { animation: none; stroke-dashoffset: 0; }
body.lk-drawn .night-band .thread .dot { animation: none; opacity: 1; }
body.lk-drawn .night-band .thread .glow { animation: breathe 6s ease-in-out infinite; opacity: .45; }
body.lk-drawn .night-band .print.pinned { animation-duration: .6s; }
body.lk-drawn .night-band .print.pinned.p1 { animation-delay: .05s; } body.lk-drawn .night-band .print.pinned.p2 { animation-delay: .15s; } body.lk-drawn .night-band .print.pinned.p3 { animation-delay: .25s; }
@keyframes thread { to { stroke-dashoffset: 0; } }
@keyframes light { to { opacity: 1; } }
@keyframes glow { from { opacity: 0; transform: scale(.4); } to { opacity: .45; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(14px) rotate(calc(var(--r) * 1.8)); } to { opacity: 1; transform: rotate(var(--r)); } }

/* The gallery: the photos alone on the night, the words at the bottom, everything within reach of a thumb */
html.g-open, html.g-open body { overflow: hidden; }
.gallery { --fade: 1; position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; color: #fff;
  background: #090E1B; animation: veil .25s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
.gallery.closing { animation: veil .22s ease reverse forwards; }
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 6px 20px; transition: opacity .25s; }
.g-count { font: 500 var(--fs-meta)/1 var(--sans); color: var(--night-soft); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.g-tools { display: flex; gap: 4px; }
.g-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; text-decoration: none; }
.g-btn:hover { background: rgba(255, 255, 255, .16); }
.g-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.g-like[aria-pressed="true"] { color: var(--gold); }
.g-like[aria-pressed="true"] svg { fill: currentColor; }
.g-like.pop svg { animation: heart-pop .55s cubic-bezier(.2, 1.7, .4, 1); }
.g-stage { position: relative; overflow: hidden; min-height: 0; }
.g-track { display: flex; height: 100%; will-change: transform; }
.g-slide { flex: 0 0 100%; height: 100%; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 6px 12px; min-width: 0; min-height: 0; box-sizing: border-box; }
.g-slide img, .g-slide video { max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; width: auto; height: auto; object-fit: contain; border-radius: 4px; transform-origin: center; }
.g-slide img { cursor: zoom-in; animation: zoom-in .35s cubic-bezier(.2, .8, .2, 1); }
.gallery.zoomed .g-slide img { cursor: grab; border-radius: 0; }
.g-slide video { width: 100%; background: #000; }
.g-nav { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; display: none; place-items: center; }
.g-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-nav:hover { background: rgba(255, 255, 255, .2); }
.g-nav[disabled] { opacity: 0; pointer-events: none; }
.g-prev { left: 18px; } .g-next { right: 18px; }
.g-bottom { padding: 8px 20px calc(16px + env(safe-area-inset-bottom)); transition: opacity .25s; max-width: 760px; width: 100%; margin: 0 auto; }
.g-title { font: 500 var(--fs-heading)/1.25 var(--display); margin: 0; }
.g-caption { color: #E6EBF5; margin: 4px 0 0; max-height: 4.8em; overflow: auto; }
.g-when { color: var(--night-soft); font-size: var(--fs-meta); margin: 4px 0 0; }
.g-title:empty, .g-caption:empty, .g-when:empty { display: none; }
.g-strip { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.g-strip button { flex: none; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; opacity: .5; cursor: pointer; background: #222; transition: opacity .2s, box-shadow .2s; }
.g-strip button[aria-current] { opacity: 1; box-shadow: 0 0 0 2px var(--gold); }
.g-strip img { width: 100%; height: 100%; object-fit: cover; }
.g-details { margin-top: 12px; }
.g-details .btn { min-height: 44px; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; }
.gallery.chrome-off .g-top, .gallery.chrome-off .g-bottom, .gallery.zoomed .g-bottom { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .g-nav { display: grid; } .g-slide { padding: 6px 84px; } }
@media (max-width: 719px) { .g-strip { display: none; } }
@media (prefers-reduced-motion: reduce) { .gallery, .g-slide img { animation: none; } .g-track { transition: none !important; } }

/* Install banner (phones without the app) */
.install-banner { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; background: var(--night); color: #fff;
  animation: drop .45s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 6px 20px -12px rgba(27, 42, 74, .6); }
.topbar + .install-banner { top: 61px; }
.install-banner img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-banner .ib-text { display: grid; min-width: 0; line-height: 1.3; font-size: var(--fs-meta); }
.install-banner .ib-text b { font-weight: 600; }
.install-banner .ib-text span { color: var(--night-soft); font-size: var(--fs-tiny); }
.install-banner .btn.gold { margin-left: auto; min-height: 40px; padding: 0 16px; background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; flex: none; }
.install-banner .ib-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--night-soft); display: grid; place-items: center; cursor: pointer; }
.install-banner .ib-close:only-of-type { margin-left: auto; }
@keyframes drop { from { transform: translateY(-100%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .install-banner { animation: none; } }

.thumbs button:only-child { max-height: 560px; }
.night-band .copy > .kid-switch:first-child { margin: -8px -6px 14px; }
.family-band .copy { max-width: 72%; }
.family-band .stage { width: 30%; opacity: .8; }
@media (max-width: 640px) { .family-band .copy { max-width: none; } }
.import-source { padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.import-source + .import-source { margin-top: 12px; }
.import-progress { padding: 16px 18px; border-radius: 16px; background: var(--surface-alt); }

/* The retouch editor: the photo on the night, the tools under the thumb */
.editor { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 10px; background: #090E1B; color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); animation: veil .25s ease; }
.ed-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-top .btn { min-height: 44px; padding: 0 18px; }
.ed-top .btn.ghost { color: var(--night-soft); }
.ed-top .btn.gold { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }
.ed-stage { display: grid; place-items: center; min-height: 0; overflow: hidden; }
.ed-frame { max-width: 100%; max-height: 100%; display: grid; place-items: center; touch-action: none; }
.ed-canvas { max-width: 100%; max-height: calc(100vh - 340px); border-radius: 4px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); }
.editor.cropping .ed-canvas { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 0; cursor: grab; }
.ed-status { margin: 0; min-height: 1.2em; text-align: center; color: var(--night-soft); font-size: var(--fs-meta); }
.ed-tabs { background: rgba(255, 255, 255, .08); max-width: 520px; width: 100%; margin: 0 auto; }
.ed-tabs button { color: var(--night-soft); }
.ed-tabs button.on { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.ed-panel { display: grid; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; min-height: 172px; align-content: start; }
.ed-slider { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 12px; margin: 0; color: #fff; font-weight: 400; }
.ed-slider input { accent-color: var(--gold); width: 100%; }
.ed-slider output { text-align: right; color: var(--night-soft); font-variant-numeric: tabular-nums; font-size: var(--fs-tiny); }
.ed-auto { justify-self: start; min-height: 44px; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; }
.ed-auto[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }
.ed-ratios, .ed-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: none; color: #fff; cursor: pointer; font: inherit; font-size: var(--fs-meta); }
.chip-btn[aria-pressed="true"] { background: #fff; color: var(--night); border-color: #fff; }
.editor .btn:not(.gold):not(.ghost):not(.ed-auto) { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; min-height: 44px; }
.ed-hint { margin: 0; color: var(--night-soft); font-size: var(--fs-tiny); }
.ed-revert { color: var(--night-soft); justify-self: start; }
.g-edit.hidden { display: none; }

/* Top actions on phones: search, the bell, my account */
.top-actions { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-alt); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.badge-dot { position: absolute; top: 6px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--night);
  font: 700 .7rem/18px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: pop-in .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop-in { from { transform: scale(0); } }
.side-only { display: none; }
@media (min-width: 1024px) {
  body.with-nav .side-only { display: flex; }
  body.with-nav .tab .badge-dot { position: static; margin-left: auto; box-shadow: none; }
  .top-actions { display: none; }
}
@media (max-width: 1023px) { .topbar .who #family-name { display: none; } }

/* The bell */
.activity { list-style: none; padding: 0; margin: 0; display: grid; }
.activity li button { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.activity li:last-child button { border-bottom: 0; }
.activity li button:hover { background: var(--surface-alt); }
.activity .thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-alt); display: grid; place-items: center; }
.activity .what { font-size: var(--fs-meta); line-height: 1.4; }
.activity .when { display: block; color: var(--ink-soft); font-size: var(--fs-tiny); margin-top: 2px; }
.activity li.unread .what::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--gold); vertical-align: 1px; }

/* Search */
.search-box { position: relative; }
.search-box svg { position: absolute; left: 18px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-linecap: round; }
.search-box .input { padding-left: 52px; font-size: 1.1rem; min-height: 60px; border-radius: 999px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.filter { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; font-size: var(--fs-meta); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--night); color: #fff; border-color: var(--night); }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period .input { width: auto; min-height: 44px; padding: 8px 14px; }
.results-count { color: var(--ink-soft); font-size: var(--fs-meta); margin: 16px 0 10px; }
.story-tile { padding: 16px; border-radius: var(--radius-photo); background: var(--surface-alt); font-size: var(--fs-meta); line-height: 1.45; text-align: left; }
.story-tile b { display: block; margin-bottom: 4px; }

/* Account */
.account-head { display: flex; align-items: center; gap: 16px; }
.account-head .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row select.input { width: auto; min-height: 44px; padding: 8px 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; margin: 4px 0 8px; }
.checks label { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; min-height: 40px; cursor: pointer; }
.checks input { width: 22px; height: 22px; accent-color: var(--night); }
.sizes { display: flex; gap: 8px; }
.sizes button { min-width: 58px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.sizes button[aria-pressed="true"] { background: var(--night); color: #fff; border-color: var(--night); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.ed-auto:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ed-auto[aria-pressed="true"]:hover { background: var(--gold); color: var(--night); }
.ed-revert { border: 0; background: none; padding: 0; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-size: var(--fs-meta); }
/* Quiet text actions (add another link, revert, sign out) */
button.link { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-size: var(--fs-meta); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link:hover { color: var(--night); }
.night-band button.link, .editor button.link { color: var(--night-soft); }
a.tab { text-decoration: none; }
.admin-entry { justify-self: start; }
.admin-entry svg { width: 20px; height: 20px; }

/* Card actions as plain icons with their count (labels stay in the simplified album of the grandparents) */
.actions { gap: 4px 6px; align-items: center; }
.actions .btn.act { min-width: 48px; min-height: 48px; padding: 0 8px; gap: 7px; border-radius: 999px; }
.actions .btn.act svg { width: 26px; height: 26px; stroke-width: 1.5; }
.actions .btn.act:hover { background: var(--surface-alt); color: var(--ink); }
.actions .btn.act[aria-pressed="true"] { color: var(--gold-deep); }
.actions .btn.act .lbl { display: none; }
.actions .btn.act .count { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.actions .more-actions { margin-left: auto; }
body.simple .actions .btn.act { border-radius: 999px; padding: 0 12px; }
body.simple .actions .btn.act .lbl { display: inline; }
body.simple .actions .btn.act svg { width: 22px; height: 22px; }

/* The outline of a screen while it loads (never three dots on an empty page) */
.skel { display: grid; gap: 16px; }
.sk { display: block; border-radius: var(--radius, 18px); background: linear-gradient(100deg, var(--surface-alt) 30%, color-mix(in srgb, var(--surface-alt) 55%, #fff) 50%, var(--surface-alt) 70%); background-size: 220% 100%; animation: sk-shine 1.3s linear infinite; }
.sk.band { height: 280px; border-radius: 28px; }
.sk.line { height: 18px; width: 46%; }
.sk.card { height: 190px; }
@keyframes sk-shine { to { background-position: -220% 0; } }

/* Timeline: hearts and comments on the thumbnails, the end marker that loads the next page */
.thumbs button .tally { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 18px 8px 6px; color: #fff; font: 600 var(--fs-tiny)/1 var(--sans); background: linear-gradient(to top, rgba(9, 14, 27, .62), transparent); pointer-events: none; }
.thumbs button .tally span { display: inline-flex; align-items: center; gap: 4px; }
.thumbs button .tally svg { width: 15px; height: 15px; }
.thumbs button .tally span:first-child svg { color: #FF5B6E; }
.thumbs button .flag + .tally { padding-left: 8px; }
.thumbs button.broken img { visibility: hidden; }
.thumbs button.broken { background: var(--surface-alt); }
.strand-more { display: flex; justify-content: center; gap: 6px; padding: 28px 0; }
.strand-more span { width: 8px; height: 8px; border-radius: 50%; background: var(--night); opacity: .25; animation: sm-beat 1s ease-in-out infinite; }
.strand-more span:nth-child(2) { animation-delay: .15s; } .strand-more span:nth-child(3) { animation-delay: .3s; }
@keyframes sm-beat { 50% { opacity: .9; transform: translateY(-3px); } }
.strand .back-top { margin: 14px 0 0; }
.pick-row { display: flex; align-items: flex-start; gap: 2px; margin: -8px -6px 14px; overflow-x: auto; scrollbar-width: none; }
.pick-row::-webkit-scrollbar { display: none; }
.pick-row .kid-switch { margin: 0 !important; overflow: visible; flex: none; }
.pick-row .kid.several { flex: none; margin-top: 4px; }
.pick-row .kid.several .avatar { display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; }
.pick-row .kid.several .avatar svg { width: 20px; height: 20px; }
.group-cover .faces { display: flex; margin-bottom: 14px; }
.group-cover .faces .avatar { margin-right: -8px; box-shadow: 0 0 0 2px var(--night); }
.child-cover .group-name { font-size: clamp(1.9rem, 5.4vw, 3rem); line-height: 1.08; }

/* Choosing several children, family by family */
.multi-pick .pick-group { border: 1px solid var(--line); border-radius: 18px; padding: 6px 14px 8px; }
.multi-pick .pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.multi-pick .pick-head h3 { margin: 0; font: 600 var(--fs-body)/1.3 var(--sans); }
.multi-pick .pick { display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; border-top: 1px solid var(--line); }
.multi-pick .pick input { width: 22px; height: 22px; accent-color: var(--night); flex: none; }
.multi-pick .pick-name { display: grid; }
.multi-pick .pick-name small { color: var(--ink-soft); }

/* The month slider on the right edge */
.scrub { position: fixed; right: 0; top: 50%; z-index: 30; display: flex; align-items: center; gap: 10px; transform: translateY(-50%); pointer-events: none; }
.scrub-knob { pointer-events: auto; touch-action: none; width: 40px; height: 58px; border: 1px solid var(--line); border-right: 0; border-radius: 29px 0 0 29px; background: #fff; color: var(--night); box-shadow: 0 6px 20px rgba(27, 42, 74, .18); display: grid; place-items: center; cursor: grab; padding: 0 0 0 4px; }
.scrub-knob svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scrub-label { opacity: 0; background: var(--night); color: #fff; font: 600 var(--fs-body)/1 var(--sans); padding: 12px 16px; border-radius: 999px; white-space: nowrap; transition: opacity .15s; box-shadow: 0 8px 24px rgba(27, 42, 74, .3); }
.scrub.on .scrub-label { opacity: 1; }
.scrub.on .scrub-knob { background: var(--gold); border-color: var(--gold); cursor: grabbing; }
body:has(dialog[open]) .scrub, body:has(.gallery) .scrub { display: none; }
.month-list h3 { margin: 0 0 8px; font: 600 var(--fs-heading)/1.2 var(--display); }
.month-list .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.month-list .chips .btn { min-height: 44px; gap: 8px; text-transform: capitalize; }
.month-list .chips .btn small { color: var(--ink-soft); font-weight: 400; }

/* Heart and comment under the photo, in the full-screen gallery */
.g-social { display: flex; gap: 6px; margin: 10px 0 0 -10px; }
.g-social:empty { display: none; }
.g-act { display: inline-flex; align-items: center; gap: 8px; min-width: 52px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: #fff; font: 600 var(--fs-body)/1 var(--sans); cursor: pointer; }
.g-act svg { width: 28px; height: 28px; stroke-width: 1.5; }
.g-act:hover { background: rgba(255, 255, 255, .1); }
.g-act[aria-pressed="true"] svg { color: #FF5B6E; fill: currentColor; }
.g-act.pop svg { animation: heart-pop .55s cubic-bezier(.2, 1.7, .4, 1); }
@media (prefers-reduced-motion: reduce) { .sk, .strand-more span, .g-act.pop svg { animation: none; } }
.thumbs button .flag { top: 8px; bottom: auto; }

/* Wide screens: the welcome band spans the feed and the side column (it was left in the first column, wasting the right) */
@media (min-width: 1000px) { .home > .home-band { grid-column: 1 / -1; } }
.band-invite { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.band-invite p { margin: 0; flex: 1 1 240px; color: #C9D2E6; font-size: var(--fs-small); line-height: 1.5; max-width: 46ch; }
.band-invite .btn { flex: none; }

/* ---------- Timeline header: who (pills), the name, the age in words, then the growth ---------- */
.child-cover .pick-row { margin: 0 0 22px; gap: 8px; align-items: center; padding: 2px; }
.child-cover .pick-row .kid-switch { gap: 8px; padding: 0; }
.child-cover .pick-row .kid { display: inline-flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; padding: 5px 16px 5px 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #DCE3F2; font-size: var(--fs-meta); font-weight: 500; }
.child-cover .pick-row .kid:hover { background: rgba(255, 255, 255, .14); }
.child-cover .pick-row .kid .avatar { width: 34px; height: 34px; font-size: .95rem; transform: none; box-shadow: none; background: var(--c); color: #fff; }
.child-cover .pick-row .kid[aria-pressed="true"] { background: #fff; color: var(--night); font-weight: 600; }
.child-cover .pick-row .kid[aria-pressed="true"] .avatar { transform: none; box-shadow: none; }
.child-cover .pick-row .kid .kid-name { max-width: 140px; }
.child-cover .pick-row .kid.several { margin: 0; background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.child-cover .pick-row .kid.several .avatar { background: none; width: 26px; height: 26px; margin-left: 6px; }
.child-cover .pick-row .kid.several[aria-pressed="true"] { background: #fff; color: var(--night); box-shadow: none; }
.child-cover .pick-row .kid.several[aria-pressed="true"] .avatar { color: var(--night); }
.child-cover { min-height: 0; justify-content: flex-start; }
.child-cover .copy { max-width: 58%; }
.child-cover .child-name { margin: 0 0 6px; font-size: clamp(2.4rem, 6vw, 3.6rem); }
.child-cover .age-line { margin: 0 0 6px; color: var(--gold); font: 500 var(--fs-heading)/1.3 var(--sans); letter-spacing: 0; }
.child-cover .growth { margin-top: 18px; }
.child-cover .growth:empty { display: none; }
.child-cover .add-measure { min-height: 44px; gap: 6px; }
.child-cover .add-measure svg { width: 18px; height: 18px; }
@media (max-width: 719px) {
  .child-cover .copy { max-width: none; }
  .child-cover.has-stage .stage { height: 150px; }
  .child-cover .pick-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -18px; padding-right: 18px; }
}

/* A month with a handful of photos: equal tiles */
.thumbs.few button { grid-column: auto !important; grid-row: auto !important; }
@media (min-width: 1000px) { .page[data-view="timeline"] .thumbs.few { grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } }
.thumbs.few button:only-child { grid-column: auto !important; aspect-ratio: 1; max-width: 320px; }

/* ---------- My account: one list, each line opens its sheet ---------- */
.account-page { display: grid; gap: 22px; max-width: 640px; margin: 0 auto; }
.menu-list { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-row:last-child { border-bottom: 0; }
.menu-row:not(.static):hover { background: var(--surface-alt); }
.menu-row.static { cursor: default; }
.menu-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-alt); color: var(--night); display: grid; place-items: center; }
.menu-ico svg { width: 21px; height: 21px; }
.menu-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.menu-text b { font-weight: 600; }
.menu-text small { color: var(--ink-soft); font-size: var(--fs-meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-chev { flex: none; color: var(--ink-soft); display: grid; }
.menu-chev svg { width: 20px; height: 20px; }
.menu-row .sizes { flex: none; }
.menu-row .sizes button { min-width: 46px; min-height: 44px; }
.account-foot { margin: 0; text-align: center; font-size: var(--fs-meta); }
.account-page .legal-links, .account-page > .muted { justify-content: center; text-align: center; }
.notif .segmented { margin-top: 6px; }
.notif-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 10px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.notif-head > div { display: grid; gap: 2px; min-width: 0; }
.notif-head small { color: var(--ink-soft); font-size: var(--fs-meta); }
.notif-head select.input { width: auto; flex: none; min-height: 44px; padding: 8px 12px; max-width: 46%; }
.notif-card .checks { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.notif-card .checks.off { opacity: .4; pointer-events: none; }
.toggle-line input:disabled + span { opacity: .6; }

/* ---------- Viewer: zoom buttons, and on wide screens the caption beside the actions to leave room to the photo ---------- */
.g-btn[disabled] { opacity: .35; cursor: default; }
@media (max-width: 420px) { .g-btn { width: 42px; height: 42px; } .g-tools { gap: 6px; } }
@media (min-width: 900px) {
  .g-bottom { max-width: 1100px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 18px; align-items: center; padding-top: 10px; }
  .g-bottom > .g-title, .g-bottom > .g-caption, .g-bottom > .g-when { grid-column: 1; }
  .g-bottom > .g-social { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .g-bottom > .g-details { grid-column: 3; grid-row: 1 / span 3; margin: 0; }
  .g-bottom > .g-strip { grid-column: 1 / -1; margin-top: 10px; }
}

/* Review fixes */
.thumbs button .flag { max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrub { top: 62%; }
.notif-title { margin: 6px 0 -6px; font: 600 var(--fs-body)/1.3 var(--sans); }
.notif .toggle-line { padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.notice.warn { background: #FFF6E3; border: 1px solid #F0D59A; border-radius: 16px; padding: 16px; color: var(--ink); }
.import-failures ul { margin: 0; display: grid; gap: 10px; }
.import-failures li { padding-bottom: 10px; border-bottom: 1px solid #F0D59A; }
.import-failures li:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 1000px) { .home.no-rail, .home:not(:has(.rail > :not(.hidden))) { grid-template-columns: minmax(0, 820px); } }
@media (max-width: 719px) { .child-cover.has-stage .stage { height: 170px; margin-bottom: 16px; } }
@media (max-width: 719px) {
  .wide-only { display: none; }
  .menu-row.static { flex-wrap: wrap; }
  .menu-row.static .sizes { margin-left: 54px; }
  .notif-head { flex-wrap: wrap; }
  .notif-head select.input { max-width: none; width: 100%; }
}
@media (max-width: 719px) { .menu-row.static .menu-text { flex: 1 1 calc(100% - 60px); } }

/* ---------- Typography, layout and finish pass ---------- */
/* Fingers: links and small controls reach 44 px on touch screens */
@media (pointer: coarse) {
  button.link, a.link, .legal-links a, .account-foot a, .lead a { display: inline-flex; align-items: center; min-height: 44px; }
  .legal-links { padding: 8px 0 20px; }
  .ref { min-height: 36px; padding: 6px 10px; }
  .pager .btn, .small-btn { min-height: 44px; }
}
/* One rhythm between the blocks of a screen */
.account-page, .home .feed { --gap: 22px; }
.strand .lifeline .month + .month { margin-top: 28px; }
.month-head .age { font-weight: 600; }
/* Reading width: captions and helper texts never run past about 75 characters */
.memory .caption, .memory .body > p, .waiting p, .notice p, .faq p, .multi-pick > p { max-width: 62ch; }
/* Pressed state for everything that can be tapped, not only the main buttons */
.menu-row:active, .thumbs button:active, .kid:active, .watch-row:active, .tile-stat.go:active { transform: scale(.985); }
.thumbs button { transition: transform .12s ease; }
@media (hover: hover) { .thumbs button:hover img { filter: brightness(1.06); } .menu-row:not(.static):hover .menu-chev { color: var(--night); } }
:where(button, a, summary, select, input):focus-visible { outline: 2px solid var(--gold-deep, #8A5A00); outline-offset: 2px; }
.night-band :where(button, a):focus-visible, .gallery :where(button, a):focus-visible { outline-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .thumbs button, .menu-row, .kid { transition: none; transform: none !important; } }
.follow-block:empty { display: none; }
.follow-block .toggle-line .avatar { width: 32px; height: 32px; font-size: .9rem; flex: none; }
.follow-block .toggle-line { padding: 8px 4px; }

/* Answers at the end of a sheet */
.row.end { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
