/* Layout: app shell. Side rail on wide screens, bottom tab bar on phones.
   Calm eucalypt neutrals; each parent gets one steady colour (harbour blue, ochre). */
:root {
  --bg: #F2F5F1; --surface: #FFFFFF; --surface-2: #E9EEE8; --surface-3: #DDE5DC; --line: #D3DCD2;
  --ink: #17221C; --ink-2: #47554D; --ink-3: #74827A;
  --accent: #2C6A4D; --accent-ink: #FFFFFF; --accent-soft: #D9EADF;
  --pa: #2D6A93; --pa-soft: #D7E6F1; --pa-ink: #FFFFFF;
  --pb: #A9601A; --pb-soft: #F4E2CE; --pb-ink: #FFFFFF;
  --pc: #7B4C93; --pc-soft: #EBDDF2; --pc-ink: #FFFFFF;
  --hol: #C9B46A; --hol-soft: rgba(201, 180, 106, .16);
  --good: #2F7D4F; --good-soft: #DCEFE2; --warn: #9A6410; --warn-soft: #F6E8CC; --crit: #B03A36; --crit-soft: #F6DCDA;
  --shadow: 0 1px 2px rgba(23, 34, 28, .06), 0 6px 20px rgba(23, 34, 28, .06);
  --f-ui: 'Lexend', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 12px; --r-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1512; --surface: #161E1A; --surface-2: #1D2722; --surface-3: #26322C; --line: #2C3832;
    --ink: #E6EEE9; --ink-2: #B0BDB5; --ink-3: #85938B;
    --accent: #6BC195; --accent-ink: #0C1912; --accent-soft: #1D3a2B;
    --pa: #79B2DD; --pa-soft: #1C3346; --pa-ink: #0B1722;
    --pb: #E3A05E; --pb-soft: #3B2A18; --pb-ink: #1E1206;
    --pc: #C79BE0; --pc-soft: #33223D; --pc-ink: #1A0F22;
    --hol: #B9A45C; --hol-soft: rgba(185, 164, 92, .14);
    --good: #6BC195; --good-soft: #1C3a2B; --warn: #E2B25A; --warn-soft: #3A2E15; --crit: #EE8A84; --crit-soft: #3E1E1C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1512; --surface: #161E1A; --surface-2: #1D2722; --surface-3: #26322C; --line: #2C3832;
  --ink: #E6EEE9; --ink-2: #B0BDB5; --ink-3: #85938B;
  --accent: #6BC195; --accent-ink: #0C1912; --accent-soft: #1D3a2B;
  --pa: #79B2DD; --pa-soft: #1C3346; --pa-ink: #0B1722;
  --pb: #E3A05E; --pb-soft: #3B2A18; --pb-ink: #1E1206;
  --pc: #C79BE0; --pc-soft: #33223D; --pc-ink: #1A0F22;
  --hol: #B9A45C; --hol-soft: rgba(185, 164, 92, .14);
  --good: #6BC195; --good-soft: #1C3a2B; --warn: #E2B25A; --warn-soft: #3A2E15; --crit: #EE8A84; --crit-soft: #3E1E1C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 600; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent); }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- demo strip ---------- */
.demo-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .82rem; }
.demo-strip .tag { font-family: var(--f-mono); font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: var(--bg); letter-spacing: .04em; }
.demo-strip .grow { flex: 1 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 99px; cursor: pointer; font-size: .8rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.save-chip { font-size: .75rem; color: var(--ink-3); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100% - 40px); }
.rail { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: linear-gradient(90deg, var(--pa) 0 50%, var(--pb) 50% 100%); color: #fff; }
.brand-name { font-weight: 600; font-size: 1rem; line-height: 1.15; }
.brand-sub { font-size: .7rem; color: var(--ink-3); }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: .93rem; }
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.nav-btn svg { width: 19px; height: 19px; flex: none; }
.nav-btn .count { margin-left: auto; background: var(--crit); color: #fff; font-size: .7rem; border-radius: 99px; padding: 0 7px; font-weight: 600; }
.rail-foot { margin-top: auto; display: grid; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.main { min-width: 0; padding-block: 20px 96px; padding-inline: clamp(16px, 3vw, 36px); max-width: 1180px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar .title-wrap { display: grid; gap: 2px; min-width: 0; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabbar { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar button { border: 0; background: transparent; display: grid; justify-items: center; gap: 2px; font-size: .68rem; color: var(--ink-3); padding: 4px 0; cursor: pointer; position: relative; }
  .tabbar button[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
}

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: .9rem; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--crit); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn[disabled], .btn.locked { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--crit); color: #fff; font-size: .68rem; display: grid; place-items: center; padding: 0 5px; font-weight: 600; }
label.field { display: grid; gap: 5px; font-size: .84rem; color: var(--ink-2); font-weight: 500; min-width: 0; }
.field input, .field select, .field textarea, input.inp, select.inp, textarea.inp { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; color: var(--ink); font-size: .93rem; font-weight: 400; }
.field textarea, textarea.inp { min-height: 84px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.toggle { position: relative; width: 42px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .15s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.stack > .btn, .card > .btn { justify-self: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.pa { background: var(--pa-soft); color: var(--pa); }
.pill.pb { background: var(--pb-soft); color: var(--pb); }
.pill.lock { background: var(--surface-2); color: var(--ink-3); }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; flex: none; }
.av.A { background: var(--pa); color: var(--pa-ink); }
.av.B { background: var(--pb); color: var(--pb-ink); }
.av.V, .av.system { background: var(--surface-3); color: var(--ink-2); }
.av.lg { width: 34px; height: 34px; font-size: .85rem; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.banner.accent { background: var(--accent-soft); border-color: transparent; }
.banner.warn { background: var(--warn-soft); border-color: transparent; }
.banner.crit { background: var(--crit-soft); border-color: transparent; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner .grow { flex: 1; min-width: 0; }
.paid-lock { position: relative; }
.paid-lock::after { content: 'Paid plan'; position: absolute; top: 8px; right: 8px; font-size: .68rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: var(--bg); }
.greyed { opacity: .5; pointer-events: none; filter: grayscale(.4); }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.new-tag { font-size: .62rem; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); text-transform: uppercase; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { font-size: 1.25rem; min-width: 9ch; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend i.hol { background: repeating-linear-gradient(135deg, var(--hol) 0 2px, transparent 2px 6px); border: 1px solid var(--hol); }
.legend i.ho { border: 2px solid var(--ink); border-radius: 50%; width: 10px; height: 10px; }
.legend i.pend { border: 2px dashed var(--warn); }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); min-width: 340px; }
.cal .dh { padding: 7px 8px; font-size: .72rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.day { position: relative; min-height: 104px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; border-top: 0; border-left: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: var(--bg); color: var(--ink-3); }
.day.out .bars { opacity: .45; }
.day.hol { background-image: repeating-linear-gradient(135deg, var(--hol-soft) 0 6px, transparent 6px 12px); }
.day.today .dnum { background: var(--ink); color: var(--bg); }
.day.pending { box-shadow: inset 0 0 0 2px var(--warn); }
.day .top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.dnum { font-family: var(--f-mono); font-size: .8rem; font-weight: 500; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.day .marks { display: flex; gap: 3px; align-items: center; min-width: 0; }
.mk { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; }
.mk svg { width: 13px; height: 13px; }
.mk.ho { border: 1.5px solid var(--ink); }
.mk.pub { background: var(--crit-soft); color: var(--crit); }
.mk.act { background: var(--accent-soft); color: var(--accent); }
.mk.sp { background: var(--warn-soft); color: var(--warn); }
.bars { display: grid; gap: 3px; margin-top: auto; }
.bar { display: flex; align-items: center; gap: 4px; border-radius: 5px; padding: 1px 5px; font-size: .68rem; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.bar.A { background: var(--pa-soft); color: var(--pa); box-shadow: inset 3px 0 0 var(--pa); }
.bar.B { background: var(--pb-soft); color: var(--pb); box-shadow: inset 3px 0 0 var(--pb); }
.bar .nm { overflow: hidden; text-overflow: ellipsis; }
.hol-label { font-size: .64rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .day { min-height: 74px; padding: 4px 3px 5px; }
  .bar { padding: 0 3px; font-size: .62rem; }
  .bar .nm { display: none; }
  .bar::before { content: attr(data-i); }
  .hol-label { display: none; }
  .day .marks .mk:not(.ho) { display: none; }
}

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wd { border-radius: 10px; padding: 8px 6px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 5px; text-align: center; cursor: pointer; min-width: 0; }
.wd.today { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.wd .wl { font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.wd .wn { font-family: var(--f-mono); font-size: .95rem; }
.wd .dots { display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; }
.wd .dots span { width: 9px; height: 9px; border-radius: 50%; }
.wd .dots .A { background: var(--pa); } .wd .dots .B { background: var(--pb); }
.wd .hoflag { font-size: .62rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .wd .hoflag .t { display: none; } .wd { padding: 6px 2px; } }

/* countdown */
.next-ho { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.ho-swatch { display: flex; align-items: center; gap: 0; }
.ho-swatch .av { border: 2px solid var(--surface); }
.ho-swatch .arrow { width: 16px; color: var(--ink-3); }
@media (max-width: 560px) { .next-ho { grid-template-columns: minmax(0, 1fr); } }

/* ---------- requests ---------- */
.req { display: grid; gap: 10px; }
.req-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.req .what { font-weight: 600; font-size: 1rem; }
.req .reason { padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: .9rem; }
.req .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); }
.timer { font-family: var(--f-mono); font-size: .78rem; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.compare .side { border-radius: 10px; padding: 9px 11px; border: 1px solid var(--line); font-size: .84rem; }
.compare .side b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- history ---------- */
.log { display: grid; }
.log-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.log-item:last-child { border-bottom: 0; }
.log-item .act { font-weight: 600; font-size: .9rem; }
.log-item .det { font-size: .86rem; color: var(--ink-2); }
.hash { font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 560px) { .log-item { grid-template-columns: auto minmax(0, 1fr); } .log-item .hash { grid-column: 2; } }

/* ---------- children ---------- */
.kid-head { display: flex; gap: 14px; align-items: center; }
.kid-av { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; background: var(--accent-soft); color: var(--accent); flex: none; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.info-cell { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 3px; min-width: 0; align-content: start; }
.info-cell .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.info-cell .v { font-size: .9rem; overflow-wrap: anywhere; }
.enc { display: inline-flex; gap: 5px; align-items: center; font-size: .74rem; color: var(--good); font-weight: 500; }
.enc svg { width: 13px; height: 13px; }
.pattern, .pattern-labels { max-width: 460px; }
.pattern { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pattern button, .pattern span { aspect-ratio: 1.6; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-size: .7rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.pattern .A { background: var(--pa-soft); color: var(--pa); border-color: var(--pa); }
.pattern .B { background: var(--pb-soft); color: var(--pb); border-color: var(--pb); }
.pattern-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: .66rem; color: var(--ink-3); text-align: center; text-transform: uppercase; }

/* ---------- extras ---------- */
.extra { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: start; }
.extra .decide { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.decide .seg button[aria-pressed="true"][data-v="keep"] { background: var(--good); color: #fff; }
.decide .seg button[aria-pressed="true"][data-v="remove"] { background: var(--crit); color: #fff; }

/* ---------- stats ---------- */
.split-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; font-size: .72rem; font-weight: 600; }
.split-bar div { display: grid; place-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.split-bar .A { background: var(--pa); color: var(--pa-ink); }
.split-bar .B { background: var(--pb); color: var(--pb-ink); }

/* ---------- overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10, 16, 13, .45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 720px) { .overlay { align-items: center; padding: 24px; } }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; box-shadow: var(--shadow); }
@media (min-width: 720px) { .sheet { border-radius: 18px; } }
.sheet.wide { max-width: 860px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-body { padding: 16px 20px 20px; overflow-y: auto; display: grid; gap: 14px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.steps { display: flex; gap: 6px; padding: 0 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.steps span { flex: 1 1 60px; height: 4px; border-radius: 99px; background: var(--surface-3); }
.steps span.on { background: var(--accent); }

/* toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 80; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 881px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }

/* notification list */
.notes { display: grid; }
.note { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; }
.note .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.note.unread .dot { background: var(--accent); }
.note.urgent .dot { background: var(--crit); }

/* kids view */
.kidview { background: linear-gradient(180deg, var(--pa-soft), var(--pb-soft)); border-radius: 20px; padding: 22px; display: grid; gap: 18px; }
.kv-tonight { font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.kv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.kv-day { background: var(--surface); border-radius: 14px; padding: 10px 4px; text-align: center; display: grid; gap: 6px; justify-items: center; min-width: 0; }
.kv-day .house { width: 34px; height: 34px; }
.kv-day.A .house { color: var(--pa); } .kv-day.B .house { color: var(--pb); }
.kv-day.today { outline: 3px solid var(--ink); }

.codebox { font-family: var(--f-mono); font-size: .74rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; white-space: pre; overflow: auto; max-height: 260px; }
.kbd-list { display: grid; gap: 6px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }

/* moon = who has the kids overnight */
.moon { display: inline-grid; place-items: center; flex: none; }
.moon svg { width: 11px; height: 11px; }
.bar .moon svg { width: 10px; height: 10px; }
.wd .dots { gap: 2px; }
.wd .dots .m { width: auto; height: auto; border-radius: 0; background: none !important; display: inline-grid; }
.wd .dots .m svg { width: 15px; height: 15px; }
.wd .dots .m.A { color: var(--pa); } .wd .dots .m.B { color: var(--pb); }
.tonight-row .moon svg { width: 16px; height: 16px; }
.tonight-row .moon.A { color: var(--pa); } .tonight-row .moon.B { color: var(--pb); }
.legend .lm svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.kv-day .kvm svg { width: 16px; height: 16px; }
.kv-day.A .kvm { color: var(--pa); } .kv-day.B .kvm { color: var(--pb); }
/* events and activities on the calendar */
.chips { display: grid; gap: 2px; min-width: 0; }
.chip { display: flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 600; border-radius: 5px; padding: 1px 5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip svg { width: 11px; height: 11px; flex: none; }
.chip.act { background: var(--accent-soft); color: var(--accent); }
.chip.ev { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.mk { width: 20px; height: 20px; }
.mk svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .chip { padding: 1px 2px; justify-content: center; }
  .chip span { display: none; }
  .chip svg { width: 12px; height: 12px; }
}
.event-list { display: grid; gap: 8px; }
.event-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.event-row.ev { border-color: var(--warn); background: var(--warn-soft); }
.event-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.event-row.ev .event-ico { background: var(--surface); color: var(--warn); }
.event-ico svg { width: 20px; height: 20px; }
.datebox { text-align: center; line-height: 1.1; font-family: var(--f-mono); }
.datebox b { display: block; font-size: 1.1rem; }
.datebox span { font-size: .68rem; text-transform: uppercase; color: var(--ink-3); }
.kind-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
/* doctors */
.clinics { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.clinic { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; background: var(--surface); }
.clinic .cname { font-size: 1.05rem; font-weight: 600; }
.clinic .cdoc { font-size: .95rem; }
.clinic .caddr { font-size: .84rem; color: var(--ink-2); }
.call-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.call { background: var(--good); border-color: var(--good); color: #fff; font-size: 1rem; padding: 10px 16px; text-decoration: none; }
:root[data-theme="dark"] .btn.call { color: #0C1912; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.call { color: #0C1912; } }
.btn.call svg { width: 18px; height: 18px; }
.subhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--ink-3); }
.info-cell .v { font-size: .95rem; }

/* third parent */
.av.C { background: var(--pc); color: var(--pc-ink); }
.bar.C { background: var(--pc-soft); color: var(--pc); box-shadow: inset 3px 0 0 var(--pc); }
.pattern .C { background: var(--pc-soft); color: var(--pc); border-color: var(--pc); }
.wd .dots .m.C, .tonight-row .moon.C, .kv-day.C .kvm, .kv-day.C .house { color: var(--pc); }
.split-bar .C { background: var(--pc); color: var(--pc-ink); }
.pill.pc { background: var(--pc-soft); color: var(--pc); }

/* child tokens (emoji / photo / initials) */
.toks { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.tok { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; overflow: hidden; flex: none; border: 2px solid; }
.tok.A { border-color: var(--pa); background: var(--pa-soft); color: var(--pa); }
.tok.B { border-color: var(--pb); background: var(--pb-soft); color: var(--pb); }
.tok.C { border-color: var(--pc); background: var(--pc-soft); color: var(--pc); }
.tok img { width: 100%; height: 100%; object-fit: cover; }
.tok .em { font-size: .95rem; line-height: 1; }
@media (max-width: 640px) { .tok { width: 20px; height: 20px; border-width: 1.5px; } .tok .em { font-size: .72rem; } }
/* colour-only view */
.day.tint-A { background-color: var(--pa-soft); box-shadow: inset 0 3px 0 var(--pa); }
.day.tint-B { background-color: var(--pb-soft); box-shadow: inset 0 3px 0 var(--pb); }
.day.tint-C { background-color: var(--pc-soft); box-shadow: inset 0 3px 0 var(--pc); }
.day.tint-mixed { box-shadow: inset 0 3px 0 var(--ink-3); }
.day.today.tint-A, .day.today.tint-B, .day.today.tint-C { outline: 2px solid var(--ink); outline-offset: -2px; }
.tint-label { margin-top: auto; display: flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; color: var(--ink-2); }
.tint-label .moon svg { width: 11px; height: 11px; }
.day.tint-A .tint-label { color: var(--pa); } .day.tint-B .tint-label { color: var(--pb); } .day.tint-C .tint-label { color: var(--pc); }
.tint-demo { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; background: var(--pa-soft); color: var(--pa); box-shadow: inset 0 3px 0 var(--pa); font-size: .75rem; font-weight: 600; justify-self: start; }
@media (max-width: 640px) { .tint-label span:not(.moon) { display: none; } .tint-label { font-size: 0; } .chip { font-size: .62rem; } }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; cursor: pointer; }
.emoji-grid button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.kid-av { overflow: hidden; }
.kid-av img { width: 100%; height: 100%; object-fit: cover; }

.wd-ev { display: grid; place-items: center; height: 16px; color: var(--accent); }
.wd-ev svg { width: 14px; height: 14px; }
.wd-ev.ev { color: var(--warn); }
.list-view { display: grid; gap: 6px; }
.lrow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.lrow:hover { background: var(--surface-2); }
.lrow.today { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.lrow.pending { box-shadow: inset 0 0 0 2px var(--warn); }
.kv-pick summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }

.lrow .chip span { display: inline !important; }
.lrow .chip { justify-content: flex-start; padding: 2px 6px; font-size: .74rem; }

/* kid placement inside a day */
.day > .top { order: 0; }
.day > .hol-label { order: 1; }
.day > .chips { order: 2; }
.kidwrap { display: flex; width: 100%; min-width: 0; order: 3; }
.kidwrap .toks, .kidwrap .bars, .kidwrap .tint-label { margin-top: 0; }
.kidwrap.pos-tl, .kidwrap.pos-tc, .kidwrap.pos-tr { order: 1; }
.kidwrap.pos-c { order: 1; margin-block: auto; }
.kidwrap.pos-bl, .kidwrap.pos-bc, .kidwrap.pos-br { order: 3; margin-top: auto; }
.kidwrap.pos-tl, .kidwrap.pos-bl { justify-content: flex-start; }
.kidwrap.pos-tc, .kidwrap.pos-bc, .kidwrap.pos-c { justify-content: center; }
.kidwrap.pos-tr, .kidwrap.pos-br { justify-content: flex-end; }
.kidwrap .bars { width: 100%; }
.kidwrap.pos-tc .bars, .kidwrap.pos-bc .bars, .kidwrap.pos-c .bars, .kidwrap.pos-tr .bars, .kidwrap.pos-br .bars { width: auto; max-width: 100%; }
.kidwrap.pos-tc .toks, .kidwrap.pos-bc .toks, .kidwrap.pos-c .toks { justify-content: center; }
.kidwrap.pos-tr .toks, .kidwrap.pos-br .toks { justify-content: flex-end; }
.kidwrap.pos-tr .bars, .kidwrap.pos-br .bars { justify-items: end; }
.kidwrap.pos-tc .bars, .kidwrap.pos-bc .bars, .kidwrap.pos-c .bars { justify-items: center; }
/* scale */
.cal .tok { width: calc(26px * var(--ks, 1)); height: calc(26px * var(--ks, 1)); font-size: calc(.75rem * var(--ks, 1)); }
.cal .tok .em { font-size: calc(.95rem * var(--ks, 1)); }
.cal .bar { font-size: calc(.68rem * var(--ks, 1)); }
.cal .bar .moon svg { width: calc(10px * var(--ks, 1)); height: calc(10px * var(--ks, 1)); }
.cal .tint-label { font-size: calc(.7rem * var(--ks, 1)); }
.cal .tint-label .moon svg { width: calc(11px * var(--ks, 1)); height: calc(11px * var(--ks, 1)); }
@media (max-width: 640px) {
  .cal .tok { width: calc(20px * var(--ks, 1)); height: calc(20px * var(--ks, 1)); }
  .cal .tok .em { font-size: calc(.72rem * var(--ks, 1)); }
}
/* next to the date */
.kids-date { display: inline-flex; gap: 2px; align-items: center; flex-wrap: wrap; min-width: 0; margin-right: auto; margin-left: 4px; }
.kids-date .tok { width: calc(18px * var(--ks, 1)); height: calc(18px * var(--ks, 1)); border-width: 1.5px; font-size: calc(.62rem * var(--ks, 1)); }
.kids-date .tok .em { font-size: calc(.7rem * var(--ks, 1)); }
.kids-date .moon svg { width: calc(14px * var(--ks, 1)); height: calc(14px * var(--ks, 1)); }
.kids-date .moon.m-A { color: var(--pa); } .kids-date .moon.m-B { color: var(--pb); } .kids-date .moon.m-C { color: var(--pc); }
/* layout panel */
.layout-panel { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; padding: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.pos-btn { width: 40px; height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); position: relative; cursor: pointer; padding: 0; }
.pos-btn.empty { background: transparent; border-color: transparent; cursor: default; }
.pos-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.pos-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); }
.pos-btn.on .pos-dot { background: var(--accent); }
.p-tl { top: 4px; left: 4px; } .p-tc { top: 4px; left: calc(50% - 5px); } .p-tr { top: 4px; right: 4px; }
.p-c { top: calc(50% - 5px); left: calc(50% - 5px); }
.p-bl { bottom: 4px; left: 4px; } .p-bc { bottom: 4px; left: calc(50% - 5px); } .p-br { bottom: 4px; right: 4px; }
input[type=range] { accent-color: var(--accent); width: 100%; }

.cal-pos-date .chips { margin-top: 6px; gap: 4px; }
.cal-pos-date .chip { font-size: .74rem; padding: 3px 6px; white-space: normal; }
.cal-pos-date .chip span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 640px) { .cal-pos-date .chip span { display: none; } }

/* ---------- brand lockup + logo ideas ---------- */
.lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.lockup > svg { flex: none; display: block; }
.lockup > span { display: flex; flex-direction: column; min-width: 0; }
.lockup .brand-name { font-weight: 600; font-size: 1.02rem; line-height: 1.15; letter-spacing: -.01em; }
.lockup .brand-sub { font-size: .72rem; color: var(--ink-3); line-height: 1.25; }
.mhead { display: none; }
@media (max-width: 880px) { .mhead { display: flex; align-items: center; padding: 2px 0 14px; } }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.logo-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: var(--surface); }
.logo-card.on { border-color: var(--pa); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pa) 25%, transparent); }
.logo-card p { margin: 0; flex: 1; }
.logo-show { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.logo-show > svg { display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.12)); }
.logo-minis { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-minis svg { display: block; }
.logo-plain { color: var(--ink); display: inline-flex; }
.logo-lockups { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.logo-lockups > .tiny { flex-basis: 100%; }
.lockup-dark { background: #14202C; color: #F1F4F8; padding: 10px 14px; border-radius: 12px; }
.lockup-dark .brand-sub { color: #A9B6C4; }

/* ---------- live site: welcome ---------- */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.welcome-card { max-width: 520px; width: 100%; padding: 28px; }
.welcome-card h1 { margin: 0; font-size: 1.6rem; }
body.live .new-tag { display: none; }
.school-nf { border-color: var(--warn); background: var(--warn-soft); }
