/* Brand: Sasha & Lulu Atelier — logo teal #12AAC2 and red #EA2C26 on white.
   Type: Oswald (condensed caps, like the logo) + Atkinson Hyperlegible (body). */
:root {
  --ground: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f9fb;
  --ink: #15262b;
  --muted: #56696e;
  --line: #d6e8ec;
  --brand: #12aac2;          /* logo teal: decoration, marks */
  --brand-red: #ea2c26;      /* logo red: the "&", small highlights */
  --accent: #087a90;         /* deeper teal so white button text stays readable */
  --accent-ink: #ffffff;
  --accent-soft: #e0f4f8;
  --young: #f2b300;
  --young-ink: #3d2d00;
  --young-soft: #fff3cf;
  --older: #12aac2;
  --older-ink: #ffffff;
  --older-soft: #dcf3f7;
  --danger: #c0271f;
  --danger-soft: #fde6e4;
  --warn: #9a5b00;
  --warn-soft: #fff0d6;
  --ok: #177a4b;
  --ok-soft: #dcf2e6;
  --shadow: 0 1px 2px rgba(18, 60, 70, .06), 0 8px 24px rgba(18, 60, 70, .08);
  --radius: 14px;
  --display: "Oswald", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0e1719;
    --surface: #152125;
    --surface-2: #111c1f;
    --ink: #e8f3f5;
    --muted: #9db3b8;
    --line: #25373c;
    --brand: #3cc3db;
    --brand-red: #ff5a4f;
    --accent: #4fcbe1;
    --accent-ink: #062a31;
    --accent-soft: #173b43;
    --young-soft: #3a3013;
    --young-ink: #2b2000;
    --older-soft: #133a30;
    --danger: #ff8a7a;
    --danger-soft: #3d1f1c;
    --warn: #ffc56b;
    --warn-soft: #3a2c12;
    --ok: #6fd6a2;
    --ok-soft: #173427;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --ground: #0e1719;
    --surface: #152125;
    --surface-2: #111c1f;
    --ink: #e8f3f5;
    --muted: #9db3b8;
    --line: #25373c;
    --brand: #3cc3db;
    --brand-red: #ff5a4f;
    --accent: #4fcbe1;
    --accent-ink: #062a31;
    --accent-soft: #173b43;
    --young-soft: #3a3013;
    --young-ink: #2b2000;
    --older-soft: #133a30;
    --danger: #ff8a7a;
    --danger-soft: #3d1f1c;
    --warn: #ffc56b;
    --warn-soft: #3a2c12;
    --ok: #6fd6a2;
    --ok-soft: #173427;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 600; color: var(--brand); }
h2 { font-size: 1.25rem; font-weight: 500; }
h3 { font-size: 1rem; font-weight: 500; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.label { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 64px; display: grid; gap: 24px; }

/* ---------- top bar ---------- */
.bar {
  border-top: 4px solid var(--brand);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-inner { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-right: auto; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); white-space: nowrap; }
.wm em { font-style: normal; color: var(--brand-red); }
.wm small { font-size: .62rem; letter-spacing: .3em; color: var(--brand-red); margin-left: 6px; font-weight: 500; vertical-align: middle; }
.logo-tile { width: 150px; background: #fff; border-radius: 16px; padding: 10px; }
.tagline { font-family: var(--display); text-transform: uppercase; letter-spacing: .22em; color: var(--brand); font-size: .8rem; }
.mark { width: 26px; height: 26px; flex: none; border-radius: 50%; background:
  radial-gradient(circle at 30% 32%, var(--young) 0 22%, transparent 23%),
  radial-gradient(circle at 70% 36%, #e4572e 0 20%, transparent 21%),
  radial-gradient(circle at 48% 72%, var(--accent) 0 22%, transparent 23%),
  var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line); }
.who { font-size: .875rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) { .who { display: none; } .wm small { display: none; } .tab { padding-inline: 9px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; font-size: 1.3rem; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: .9rem; }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.code::placeholder { letter-spacing: .04em; text-transform: none; font-family: var(--body); font-size: 1rem; }
.input.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; text-transform: uppercase; font-size: 1.15rem; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: .9rem; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding-inline: 16px; padding-block: 32px; }
.login-card { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.login-head { display: grid; gap: 10px; }
.login-head .mark { width: 44px; height: 44px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.swatch-row { display: flex; gap: 6px; }
.swatch-row i { width: 22px; height: 8px; border-radius: 4px; display: block; }
.demo-box { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-grid .btn { padding: 0 8px; }
.demo-first { font-size: .875rem; color: var(--muted); }
.demo-first code { font-family: ui-monospace, Menlo, monospace; color: var(--ink); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- blobs (avatars) ---------- */
.blob {
  --c: var(--accent); --ci: #fff;
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  background: var(--c); color: var(--ci); font-family: var(--display); font-weight: 700; font-size: .95rem;
  border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%;
}
.blob.lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.young { background: var(--young-soft); color: var(--ink); border-color: transparent; }
.chip.young::before, .chip.older::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--young); }
.chip.older { background: var(--older-soft); color: var(--ink); border-color: transparent; }
.chip.older::before { background: var(--older); }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- level palette (paint wells) ---------- */
.wells { display: flex; gap: 6px; align-items: center; }
.wells i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: block; }
.wells i.on { border-color: transparent; background: var(--w); }

/* ---------- parent view ---------- */
.child-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.child-card .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: .95rem; }
.keep-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; color: var(--muted); font-size: .92rem; }
.keep-note b { color: var(--ink); }

.lesson { display: grid; gap: 12px; }
.lesson-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px solid var(--brand); }
.lesson-head h2::before { content: "&"; color: var(--brand-red); margin-right: 8px; }
.lesson-head .date { display: grid; gap: 4px; }
.lesson-note { color: var(--muted); }
.lesson-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }
.thumb { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); cursor: zoom-in; max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.thumb:hover img { transform: scale(1.03); }
.thumb .tagline { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: .72rem; font-weight: 700; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.journey-unused ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.journey li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.journey li:first-child b::after { content: " · now"; color: var(--muted); font-weight: 400; }
.journey .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--w); justify-self: center; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: grid; gap: 8px; justify-items: center; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty h2 { color: var(--ink); }

/* ---------- staff view ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 980px; margin: 0 auto; padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 12px 12px 10px; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { font-weight: 400; font-size: .8rem; margin-left: 4px; }

.step { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step-title { display: flex; gap: 12px; align-items: center; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-red); color: #fff; font-family: var(--display); font-weight: 700; flex: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input { min-height: 40px; flex: 1 1 180px; width: auto; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .875rem; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.kids { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kid { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; min-width: 0; }
.kid .blob { width: 36px; height: 36px; font-size: .8rem; }
.kid span { min-width: 0; display: grid; }
.kid b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid small { color: var(--muted); font-size: .75rem; }
.kid[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.kid[disabled] { opacity: .55; cursor: not-allowed; }
.selected-line { font-size: .9rem; color: var(--muted); }
.selected-line b { color: var(--ink); }

.drop { display: grid; place-items: center; gap: 6px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }
.drop b { color: var(--ink); font-size: 1.05rem; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.previews { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }

.list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .name { display: grid; gap: 4px; min-width: 0; }
.row .name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.row .ctrls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row select.input { min-height: 38px; padding: 6px 10px; width: auto; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; }
@media (max-width: 620px) {
  .row { grid-template-columns: auto minmax(0, 1fr); }
  .row .ctrls { grid-column: 1 / -1; justify-content: flex-start; }
}

.section-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- modal + lightbox ---------- */
.overlay { position: fixed; inset: 0; z-index: 70; background: rgba(12, 14, 22, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 22px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: #0b0d13; color: #f1f3f8; display: grid; grid-template-rows: auto 1fr auto; animation: fade .15s ease;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.lb-top, .lb-bottom { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.lb-top { justify-content: space-between; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 8px; }
.lb-stage img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; }
.lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
.lb-bottom { flex-wrap: wrap; justify-content: space-between; }
.lb-caption { display: grid; gap: 2px; font-size: .9rem; min-width: 0; }
.lb-caption span { color: #a3aabb; }
.lightbox .btn.ghost { color: #f1f3f8; border-color: rgba(255,255,255,.25); }
.lightbox .btn.ghost:hover { background: rgba(255,255,255,.08); }
.lightbox .btn.danger-ghost { color: #ff8a7a; border-color: rgba(255,138,122,.4); }
.lb-count { font-size: .85rem; color: #a3aabb; }

/* credential slip */
.slip { border: 2px solid var(--ink); border-radius: 12px; padding: 18px; display: grid; gap: 14px; background: var(--surface); }
.slip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.slip-val { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .12em; }
.slip ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: .92rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px); animation: rise .2s ease; }
.toast.err { background: var(--danger); color: #fff; }

.splash { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.demo-flag { background: var(--brand-red); color: #fff !important; color: var(--young-ink); font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .04em; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- version 2: families, kid picker, per-date notes ---------- */
.blob.xs { width: 24px; height: 24px; font-size: .62rem; }
.blob-stack { display: flex; }
.blob-stack .blob + .blob { margin-left: -18px; box-shadow: 0 0 0 3px var(--ground); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 6px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.pick:first-child { padding-left: 16px; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.family { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.family-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.family-head .name { display: grid; gap: 2px; min-width: 0; }
.family-head .sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.family-head .ctrls { display: flex; gap: 6px; flex-wrap: wrap; }
.family-foot { padding: 10px 16px; }
.family .row:last-of-type { border-bottom: 1px solid var(--line); }
.child-entry { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.children { display: grid; gap: 10px; }
.lesson-head .linkish { justify-self: start; font-size: .85rem; }
.lb-top .btn { min-height: 36px; }

/* ---------- version 3: phone-friendly ---------- */
.t-short { display: none; }
.grabber { display: none; }
.thumb .tagline { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; text-transform: none; letter-spacing: 0; }
input, select, textarea { font-size: max(16px, 1em); }   /* stops iPhones zooming in on tap */

@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  /* tabs share the full width */
  .tabs { padding: 0; gap: 0; }
  .tab { flex: 1 1 0; min-width: 0; text-align: center; padding: 12px 4px 10px; font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.2; }
  .tab .count { margin: 0; font-size: .72rem; }
  .t-long { display: none; }
  .t-short { display: inline; }

  /* windows open as sheets from the bottom */
  .overlay { place-items: end stretch; padding: 0; height: var(--vvh, 100%); inset: 0 0 auto 0; }
  .modal {
    max-width: none !important; width: 100%;
    max-height: calc(var(--vvh, 100vh) - 24px);
    border-radius: 20px 20px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: sheet-up .22s ease;
  }
  .grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
  .modal-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); background: var(--surface); margin: 0 -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
  .modal-actions .btn { flex: 1 1 auto; }
  .modal-actions > div { flex: 1 1 100%; display: flex; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }

  /* comfortable touch layout */
  .section-head .btn, .section-head select { width: 100%; }
  .family-head .ctrls, .row .ctrls { width: 100%; }
  .family-head .ctrls .btn, .row .ctrls .btn { flex: 1 1 0; }
  .lesson-tools { width: 100%; justify-content: space-between; }
  .wrap { padding-block: 16px 48px; gap: 20px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
.kid b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }

/* ---------- version 4: selecting photos ---------- */
.head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-tools select { width: auto; }
.select-hint { font-size: .92rem; color: var(--muted); }
.thumb.selectable { cursor: pointer; }
.thumb .tick { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.thumb.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumb.on img { opacity: .78; }
.thumb.on .tick { background: var(--accent); border-color: var(--accent); }
.selbar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 15; order: 99;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.selbar > span { margin-right: auto; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .head-tools { width: 100%; }
  .head-tools select { flex: 1 1 auto; }
  .head-tools .btn { width: auto !important; }
  .selbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .selbar .btn { flex: 1 1 0; }
  .selbar > span { flex: 1 1 100%; }
}
.wrap:has(.selbar) { padding-bottom: 140px; }
.thumb .tagline { max-height: calc(2.5em + 20px); overflow: hidden; }

/* ---------- version 5: account ---------- */
.bar .btn .blob.xs { margin-left: -8px; }
.acct-who { display: flex; gap: 14px; align-items: center; }
.acct-who b { font-size: 1.1rem; }
.acct-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.acct-sec summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.acct-sec summary::-webkit-details-marker { display: none; }
.acct-sec summary::after { content: "›"; font-size: 1.4rem; color: var(--muted); transition: transform .15s ease; }
.acct-sec[open] summary::after { transform: rotate(90deg); }
.acct-body { display: grid; gap: 12px; padding: 0 16px 16px; }
.warn-text { color: var(--warn); }

/* ---------- version 6: camera ---------- */
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.add-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-btns .btn { width: 100%; }
.drop { padding: 18px 16px; }
.cam { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-width: 100%; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: flash .35s ease; }
.cam-strip { display: flex; gap: 6px; overflow-x: auto; min-height: 0; }
.cam-strip img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
@keyframes flash { from { opacity: .8; } to { opacity: 0; } }

/* ---------- version 7: centred login screens ---------- */
.login-head { justify-items: center; text-align: center; }
.login-head .logo-tile { width: 170px; }
.login-head p { max-width: 34ch; }
.login-card > .small.muted { text-align: center; }
.demo-box { text-align: center; }
.login-head .logo-tile, .login-head .mark { display: block; margin-inline: auto; }

/* ---------- version 8: one photo box ---------- */
.drop { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; color: var(--muted); }
.drop svg { width: 32px; height: 32px; color: var(--accent); }
.drop b { font-size: 1.05rem; }

/* ---------- version 9: tighter 8px corners on photos and boxes ---------- */
:root { --radius: 8px; }
.thumb, .preview, .kid, .child-entry, .acct-sec, .cam, .slip, .demo-box, .selbar { border-radius: 8px; }
.lb-stage img { border-radius: 4px; }

/* ---------- version 9: tighter 4px corners on photos ---------- */
.thumb, .preview, .cam-strip img, .lb-stage img { border-radius: 4px; }

/* ---------- version 10: descriptions per child ---------- */
.note-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; color: var(--muted); }
.note-list b { color: var(--ink); font-weight: 700; margin-right: 4px; }
.note-list.compact { gap: 2px; color: #a3aabb; }
.note-list.compact b { color: #f1f3f8; }
.same-all { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.note-fields { display: grid; gap: 12px; }
.note-fields .field > span { display: flex; align-items: center; gap: 8px; }

/* ---------- version 11: sharper photo corners ---------- */
.thumb, .preview, .cam-strip img, .lb-stage img, .thumb.on { border-radius: 2px; }

/* ---------- version 12: "Modern atelier" type — Jost headings + Inter text ---------- */
:root {
  --display: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-weight: 500; letter-spacing: .1em; }
h1 { letter-spacing: .14em; }
.wm { font-weight: 500; letter-spacing: .14em; font-size: 1.15rem; }
.wm small { letter-spacing: .32em; }
.tab { letter-spacing: .1em; font-weight: 500; }
.blob { font-family: var(--body); font-weight: 600; }
/* IDs and codes: Inter with a plain round zero instead of a monospace slashed zero */
.input.code, .mono, .slip-val, .demo-first code { font-family: var(--body); font-variant-numeric: tabular-nums; }
.input.code { letter-spacing: .12em; font-weight: 500; }
.slip-val { letter-spacing: .08em; }

/* ---------- version 13: titles in Oswald (matches the logo), medium weight ---------- */
:root { --display: "Oswald", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif; }
h1, h2, h3 { font-weight: 500; letter-spacing: .02em; }
h1 { letter-spacing: .02em; }
.wm { font-weight: 500; letter-spacing: .03em; font-size: 1.3rem; }
.wm small { letter-spacing: .2em; }
.tab { font-weight: 500; letter-spacing: .04em; }
.brand, .tagline, .step-n { font-weight: 500; }
.tagline { letter-spacing: .12em; }
.label { letter-spacing: .12em; }

/* ---------- version 14: full-screen photo always fits the screen (width and height) ---------- */
.lightbox { height: 100vh; height: 100dvh; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.lb-stage { min-height: 0; overflow: hidden; padding: 0; }
.lb-stage img { position: absolute; inset: 0; margin: auto; width: auto; height: auto; max-width: calc(100% - 16px); max-height: 100%; object-fit: contain; }
.lb-nav { z-index: 1; }
.lb-bottom { position: relative; z-index: 1; background: #0b0d13; }

/* ---------- version 15: app-style bottom navigation on phones ---------- */
.bottom-nav { display: none; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .bar.has-bn .tabs { display: none; }
  .bar.has-bn .bar-inner > .btn { display: none; }        /* Account moves to the bottom bar */
  .bottom-nav {
    display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(18, 60, 70, .06);
  }
  .bottom-nav.three { grid-template-columns: repeat(3, 1fr); }
  .bn-item, .bn-add {
    border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 2px;
    display: grid; justify-items: center; gap: 3px; min-height: 52px; align-content: end;
    font-size: .7rem; font-weight: 600; letter-spacing: .01em; -webkit-tap-highlight-color: transparent;
  }
  .bn-item svg { width: 24px; height: 24px; }
  .bn-item[aria-current="page"] { color: var(--accent); }
  .bn-item[aria-current="page"] svg { stroke-width: 2.2; }
  .bn-circle {
    width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    margin-top: -30px; background: var(--brand-red); color: #fff;
    box-shadow: 0 6px 16px rgba(234, 44, 38, .35), 0 0 0 5px var(--surface);
    transition: transform .12s ease;
  }
  .bn-circle svg { width: 28px; height: 28px; }
  .bn-add:active .bn-circle { transform: scale(.94); }
  .bn-add[aria-current="page"] { color: var(--ink); }
  .bn-add > span:last-child { white-space: nowrap; }
  /* leave room for the bar */
  .wrap:has(~ .bottom-nav) { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .selbar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
  .wrap:has(.selbar) { padding-bottom: calc(200px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .bn-item span:last-child { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: center; line-height: 1.15; }
  /* parents: children become full-width tabs */
  .chips { flex-wrap: nowrap; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 8px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .pick { flex: 1 0 auto; justify-content: center; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; min-height: 48px; padding: 6px 12px; color: var(--muted); }
  .chips .pick:first-child { padding-left: 12px; }
  .chips .pick[aria-pressed="true"] { background: none; color: var(--ink); border-bottom-color: var(--accent); }
}

/* ---------- version 16: dropdowns with a roomier arrow ---------- */
select.input {
  -webkit-appearance: none; appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2356696e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}

/* ---------- version 17: Account menu, each change opens on its own ---------- */
.acct-menu { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.acct-row { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border: 0; background: var(--surface); color: var(--ink); font-weight: 600; text-align: left; cursor: pointer; }
.acct-row + .acct-row { border-top: 1px solid var(--line); }
.acct-row:hover { background: var(--surface-2); }
.acct-row span:last-child { font-size: 1.4rem; color: var(--muted); line-height: 1; }

/* ---------- version 18: page behind pop-ups stays still ---------- */
.overlay, .modal, .lightbox { overscroll-behavior: contain; }

/* ---------- version 19: a line between dates, not between a date and its photos ---------- */
.lesson-head { border-bottom: 0; padding-bottom: 0; }
.lesson + .lesson { border-top: 1px solid var(--line); padding-top: 24px; }

/* ---------- version 20: Account as a menu (sheet above the bottom bar on phones, drop-down on laptops) ---------- */
.acct-row { gap: 12px; justify-content: flex-start; }
.acct-row svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.acct-row span:nth-of-type(1) { flex: 1; }
.acct-row.danger, .acct-row.danger svg { color: var(--danger); }
.acct-drop {
  position: fixed; z-index: 65; width: 300px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px; display: grid; gap: 12px; animation: fade .12s ease;
}
.acct-drop .acct-who .blob.lg { width: 48px; height: 48px; font-size: 1rem; }
.acct-drop .acct-menu { border: 0; border-radius: 0; margin: 0 -14px -14px; border-top: 1px solid var(--line); }
.acct-drop .acct-row { min-height: 46px; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .overlay.acct-sheet { height: calc(var(--vvh, 100vh) - var(--bn-h, 0px)); z-index: 25; }
  .overlay.acct-sheet .modal { border-radius: 20px 20px 0 0; padding-bottom: 16px; box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
}
.acct-row.danger span:last-child { font-size: inherit; color: inherit; line-height: inherit; }

/* ---------- version 21: clear the red Add photos circle on phones ---------- */
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .overlay.acct-sheet .modal { padding-bottom: 48px; }
  .selbar { bottom: calc(var(--bn-clear, 112px) + env(safe-area-inset-bottom, 0px)) !important; }
  .wrap:has(.selbar) { padding-bottom: calc(230px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- version 22: tidier Students and Teachers lists on phones ---------- */
.phone-only { display: none !important; }
.btn.icon-only svg { flex: none; }
.more-btn { color: var(--muted); flex: none; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .phone-only { display: grid !important; }
  .desk-only { display: none !important; }
  .family-head { flex-wrap: nowrap; align-items: flex-start; }
  .family-head .name { flex: 1; }
  .row.kid-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .row.kid-row .ctrls { grid-column: auto; width: auto; flex-wrap: nowrap; gap: 8px; }
  .row.kid-row .ctrls .btn { flex: none; }
  .btn.icon-only { width: 40px; min-height: 40px; padding: 0; }
  .btn.icon-only .lbl { display: none; }
}
.acct-row.plain span:last-child { font-size: inherit; color: inherit; line-height: 1.3; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .row.kid-row .name b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
}

/* ---------- version 23: two columns of children on narrow phones (one column only below ~270px) ---------- */
.kids { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.kid { padding: 8px; gap: 8px; }
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .row.kid-row { gap: 10px; padding-inline: 12px; }
  .row.kid-row > .blob { width: 36px; height: 36px; font-size: .8rem; }
  .row.kid-row .sub span { white-space: nowrap; }
}

/* ---------- version 24: Take photo + Choose from gallery on phones ---------- */
.drop-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 6px; }
.drop-btns .btn { min-height: 48px; padding: 0 10px; gap: 6px; white-space: normal; text-align: center; line-height: 1.2; }
.drop-btns .btn svg { width: 20px; height: 20px; flex: none; color: currentColor; }
div.drop { cursor: default; }
@media (max-width: 340px) { .drop-btns { grid-template-columns: 1fr; } }
.drop-btns .btn { white-space: nowrap; }
@media (max-width: 480px) { .drop-btns { grid-template-columns: 1fr; max-width: 320px; margin-inline: auto; } }

/* v25: change a staff member's role (Teacher / Admin) */
.role-pick { display: grid; gap: 8px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--surface); }
.role-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.role-opt b { display: block; }
.role-opt small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.role-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.role-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
