/* Baby Steps design system (ds.css).
   Derived from Evelien's "Baby Steps first design" (2026-11-19). Every screen links this file;
   screen-specific layout stays in the page. Living style guide: /design.
   Type: Fredoka for headings and numbers (500/600), Nunito for text (400-800).
   Colour: navy ink on a soft periwinkle background, one red accent (Tell, alerts, birthdays),
   and three label colours: Moment = blue, Milestone = green, Quote = yellow.
   Shape: pills (999px) for chips/tags/buttons, 18-24px radius for cards, 44px round icon buttons. */
@import url("/fonts/fonts.css");

:root {
  /* colour */
  --bg: #F3F5FF; --card: #fff; --ink: #1E2440; --ink-2: #3B4682; --muted: #5A6080; --line: #D5DAF0; --soft: #E9ECFA;
  --red: #E5482F; --red-soft: #FFE9E4; --red-ink: #8A2A17; --peach: #FFD3C9; --bday: #C93A23;
  --blue-soft: #EEF1FF; --blue-ink: #2F3E9E;
  --moment: #E3E9FF; --moment-ink: #2F3E9E; --milestone: #DDF5E8; --milestone-ink: #1C6B45; --quote: #FFF1C7; --quote-ink: #7A5300;
  --on-dark-muted: #B8BEDD; --on-dark-soft: rgba(255,255,255,.1);
  /* type */
  --head: Fredoka, ui-rounded, system-ui, sans-serif;
  --text: Nunito, system-ui, -apple-system, sans-serif;
  /* shape + depth */
  --r-pill: 999px; --r-card: 18px; --r-panel: 24px; --r-sheet: 28px;
  --shadow: 0 1px 2px rgba(30,36,64,.05), 0 6px 18px rgba(30,36,64,.06);
  --shadow-sm: 0 1px 3px rgba(30,36,64,.08);
}

/* ---- base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--text); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
svg { display: block; }
.ico { width: 44px; height: 44px; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
/* ---- app feel: behave like a native app rather than a web page (Jaime/Evelien, 2026-11-20) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
button, a, [onclick], .cd, .day, .agrow, .card, article { touch-action: manipulation; }

/* ---- chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); }
.chip.peach { background: var(--red-soft); color: var(--red-ink); }
/* ---- bubble */
.bubble { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
/* ---- cards */
.card { flex: 1; min-width: 0; margin-bottom: 14px; background: #fff; border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 1px 2px rgba(30,36,64,.05), 0 4px 12px rgba(30,36,64,.05); }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tag { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.moment { background: var(--moment); color: var(--moment-ink); }
.milestone { background: var(--milestone); color: var(--milestone-ink); }
.quote { background: var(--quote); color: var(--quote-ink); }
.card .time { font-size: 13px; font-weight: 700; color: var(--muted); }
.card .time.approx { opacity: .55; }
.card p { margin: 0; font-size: 15px; line-height: 1.45; }
.card p.q { font: 500 21px/1.25 var(--head); }
.card p.ctx { margin-top: 4px; font-size: 13px; color: var(--muted); }
.card.fresh { animation: pop .6s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { text-align: center; color: var(--muted); padding: 34px 20px; background: #fff; border-radius: 18px; font-weight: 600; }
.empty b { display: block; color: var(--ink); font: 600 18px var(--head); margin-bottom: 4px; }
/* ---- layers */
.layer { position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; overflow-y: auto; }
.layer.show { display: flex; }
.layer .in { width: 100%; max-width: 480px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar h2 { margin: 0; font: 600 20px var(--head); }
/* ---- emo */
.emo { width: 44px; height: 44px; border-radius: 14px; background: var(--bg); border: 2px solid transparent; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.emo.sel { background: var(--quote); border-color: #E0A800; }
/* ---- forms */
.field { margin-top: 18px; background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); }
.field label { display: block; font-size: 13px; font-weight: 800; color: var(--muted); }
.field textarea { width: 100%; border: 0; outline: none; resize: none; font: 600 20px/1.35 var(--head); color: var(--ink); background: transparent; margin-top: 6px; min-height: 108px; }
.field textarea.small { font: 600 16px/1.35 Nunito, sans-serif; min-height: 44px; }
.field .whenrow { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field .whenrow span { display: flex; align-items: center; gap: 6px; }
.field .whenrow button { color: var(--blue-ink); font-weight: 800; }
.dateinputs { display: none; gap: 8px; margin-top: 10px; }
.dateinputs.show { display: flex; }
.dateinputs input { flex: 1; font: inherit; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.sect { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.sect b { font-size: 14px; font-weight: 800; }
.sect small { font-size: 12px; font-weight: 700; color: var(--muted); }
.seg { display: flex; background: #fff; border-radius: 16px; padding: 6px; gap: 4px; }
.seg button { flex: 1; height: 44px; border-radius: 12px; font-weight: 800; color: var(--muted); }
.seg button.on.milestone, .seg button.on.moment, .seg button.on.quote { color: inherit; }
.seg button.on.moment { background: var(--moment); color: var(--moment-ink); }
.seg button.on.milestone { background: var(--milestone); color: var(--milestone-ink); }
.seg button.on.quote { background: var(--quote); color: var(--quote-ink); }
.seg button:not(.on) { background: transparent; }
.emos { display: flex; gap: 8px; }
.emos .emo { flex: 1; height: 50px; width: auto; border-radius: 14px; background: #E9ECFA; font-size: 24px; }
.emos .emo.sel { background: #fff; border-color: var(--ink); }
.addbtn { margin-top: auto; height: 56px; border-radius: 28px; background: var(--ink); color: #fff; font: 600 17px var(--head); width: 100%; }
.delbtn { margin-top: 12px; color: #B42318; font-weight: 800; padding: 8px; }
.spacer { height: 24px; flex: none; }
/* ---- inputs: underlined, large (welcome, settings) */
.winput { display: block; width: 100%; margin-top: 6px; font: 600 20px var(--head); color: var(--ink); border: 0; border-bottom: 2px solid var(--line); background: transparent; padding: 6px 0; outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; }
.winput:focus { border-bottom-color: var(--red); }
.wwho { margin: 12px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
/* ---- sheet */
.sheetbg { position: fixed; inset: 0; z-index: 50; background: rgba(30,36,64,.4); display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg); border-radius: 28px 28px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; display: none; }
.sheet.show, .sheetbg.show { display: block; }
.sheet h2 { margin: 0 0 8px; font: 600 20px var(--head); }
.sheet .addbtn { margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(200px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; }
.field select.winput { background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6080' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center; padding-right: 26px; }
.field label + .winput { margin-top: 6px; }
.field .winput + label { margin-top: 16px; }
.btn { height: 56px; border-radius: var(--r-pill); font: 600 17px var(--head); width: 100%; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-soft { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.who-line { margin: 12px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
/* ---- photo */
.pic { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 2px 0 10px; background: var(--soft); }
.pic.big { max-height: 46vh; border-radius: var(--r-panel); margin: 16px 0 0; box-shadow: var(--shadow); }
.photostatus { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
/* ---- sound */
.soundpill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 10px; margin: 2px 0 8px; border-radius: var(--r-pill);
  background: var(--peach); color: var(--red-ink); font: 700 13px var(--text); font-variant-numeric: tabular-nums; }
.soundpill .pl { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-size: 10px; }
.soundpill.playing { background: var(--red); color: #fff; }
.soundpill.playing .pl { background: #fff; color: var(--red); }
.soundpill.big { height: 52px; padding: 0 20px 0 12px; font-size: 16px; margin: 16px 0 0; }
.soundpill.big .pl { width: 32px; height: 32px; border-radius: 16px; font-size: 13px; }
