:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #ccfbf1;
  --accent: #f97316;
  --danger: #dc2626;
  --radius: 14px;
  --tabbar: 0px; /* no bottom bar: everything is in the ☰ menu */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* dark: chosen in Settings, or following the phone */
:root[data-theme="dark"] {
    --bg: #121212;
    --card: #1e1e1e;
    --ink: #f5f5f4;
    --muted: #a8a29e;
    --line: #2e2e2e;
    --brand: #2dd4bf;
    --brand-ink: #042f2e;
    --brand-soft: #134e4a;
  }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #121212;
    --card: #1e1e1e;
    --ink: #f5f5f4;
    --muted: #a8a29e;
    --line: #2e2e2e;
    --brand: #2dd4bf;
    --brand-ink: #042f2e;
    --brand-soft: #134e4a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- shell */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; flex: 1; }
.iconbtn {
  border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: var(--ink);
}
.iconbtn:active { background: var(--line); }
main { padding: 12px 16px calc(var(--tabbar) + var(--safe-b) + 88px); max-width: 760px; margin: 0 auto; }

.fab {
  position: fixed; inset-inline-end: 18px; bottom: calc(var(--tabbar) + var(--safe-b) + 18px); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--brand); color: var(--brand-ink); font-size: 30px; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}

.banner {
  background: #fef3c7; color: #78350f; padding: 8px 16px; font-size: 14px; text-align: center;
}

/* ---------- generic */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 4px 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 9px 14px; font-weight: 600;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 12px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--brand-soft); border-color: var(--brand); }
.chip.off { opacity: .45; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #999); flex: none; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented button { border: 0; background: var(--card); padding: 6px 12px; font-weight: 600; font-size: 14px; }
.segmented button.on { background: var(--brand); color: var(--brand-ink); }

/* ---------- forms / sheet */
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh;
  margin: auto auto 0; border-radius: 18px 18px 0 0;
  background: var(--card); color: var(--ink);
}
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 18px; } }
dialog.sheet::backdrop { background: rgba(0,0,0,.4); }
.sheet-head { display: flex; align-items: center; padding: 14px 16px 6px; gap: 8px; }
.sheet-head h2 { margin: 0; font-size: 18px; flex: 1; }
.sheet-body { padding: 6px 16px calc(16px + var(--safe-b)); overflow-y: auto; }
.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--bg); font-size: 16px; /* 16px stops iOS zooming */
}
textarea.input { min-height: 90px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions .spacer { flex: 1; }
.error { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.swatch.on { border-color: var(--ink); }

/* ---------- login */
.login { max-width: 360px; margin: 18vh auto 0; padding: 24px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 20px; }
.login h1 { margin: 12px 0 18px; }

/* ---------- calendar */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.month { padding: 6px; }
.month .dow, .month .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month .dow div { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.day {
  min-height: 62px; border: 0; background: transparent; border-radius: 10px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: start; overflow: hidden;
}
.day .num { font-size: 13px; font-weight: 600; text-align: center; width: 24px; height: 24px; line-height: 24px; margin: 0 auto; border-radius: 50%; }
.day.other .num { color: var(--muted); opacity: .5; }
.day.today .num { background: var(--accent); color: #fff; }
.day.sel { background: var(--brand-soft); }
.bar {
  font-size: 10px; line-height: 14px; height: 14px; border-radius: 4px; padding: 0 3px;
  background: var(--c, #999); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.more { font-size: 10px; color: var(--muted); text-align: center; }

.event {
  display: flex; gap: 10px; align-items: stretch; padding: 10px 12px; margin-bottom: 8px;
  width: 100%; text-align: start;
}
.event .stripes { display: flex; flex-direction: column; gap: 2px; width: 5px; border-radius: 3px; overflow: hidden; flex: none; }
.event .stripes i { flex: 1; background: var(--c); }
.event .time { width: 52px; flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.event .title { font-weight: 600; }
.badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: var(--line); color: var(--muted); }

/* ---------- lists */
.additem { display: flex; gap: 8px; margin-bottom: 12px; }
.additem .qty { width: 84px; flex: none; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--brand); flex: none; }
.item.done .name { text-decoration: line-through; color: var(--muted); }
.item .qty { color: var(--muted); font-size: 14px; }

/* ---------- meals */
.mealday { padding: 10px 12px; margin-bottom: 8px; }
.mealday.today { border-color: var(--accent); }
.mealday h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; }
.meal { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; width: 100%; border: 0; background: transparent; text-align: start; }
.meal .slot { width: 70px; flex: none; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* ---------- notes */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.note {
  border: 0; border-radius: var(--radius); padding: 12px; text-align: start; background: var(--c);
  color: #1c1917; min-height: 110px; display: flex; flex-direction: column; gap: 6px;
}
.note h3 { margin: 0; font-size: 15px; }
.note p { margin: 0; font-size: 14px; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; }

/* ---------- settings */
.person { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); width: 100%; background: transparent; border-inline-start: 0; border-inline-end: 0; border-top: 0; text-align: start; }
.person:last-child { border-bottom: 0; }
.person .dot { width: 16px; height: 16px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + var(--safe-b) + 90px); z-index: 50;
  background: #292524; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  max-width: 90vw; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* ---------- v2: accounts, kids, admin */
.stack { display: grid; gap: 10px; }
.pad { padding: 12px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.actions.wrap { flex-wrap: wrap; }
.group { margin: 12px 0; overflow: hidden; }
.group-head { padding: 10px 12px 0; }
.group-head h3 { margin: 0; font-size: 16px; }
.parent-group { margin-bottom: 8px; }
a.btn { display: inline-block; text-decoration: none; color: inherit; text-align: center; }
.badge { align-self: flex-start; white-space: nowrap; }
.cal-top { margin-bottom: 6px; }

/* ---------- v3: profiles, birthdays, co-parenting */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--c); }
.avatar.initial { display: inline-grid; place-items: center; color: #fff; font-weight: 700; }
.person .avatar { margin-inline-end: 2px; }
.photo-row { display: flex; align-items: center; gap: 16px; margin: 6px 0 10px; }
.contact-head { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 12px; }
.contact-head h3 { margin: 0; }
a.person { color: inherit; text-decoration: none; }
.cstrip { height: 4px; border-radius: 2px; background: var(--c); margin: 0 2px; }
.event.custody { border-style: dashed; }
.topbar .menu-btn { position: relative; margin-inline-start: -8px; font-size: 22px; }
.topbar .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.badge.warn { background: #fef3c7; color: #92400e; margin-inline-start: 6px; }
.tt-card { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.tt-card .name { font-weight: 700; }
.tt-status { margin: 10px 0; }
.tt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; }
.tt-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.tt-day { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 14px;
  background: color-mix(in srgb, var(--c) 35%, transparent); border: 2px solid transparent; }
.tt-day.none { background: var(--bg); color: var(--muted); }
.tt-day.today { border-color: var(--accent); }
.tt-day i { position: absolute; top: 1px; inset-inline-end: 4px; font-style: normal; font-size: 10px; }
.request { margin-bottom: 10px; }
.pattern-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; margin: 8px 0; }
.pattern-strip span { background: var(--c); color: #fff; font-size: 10px; font-weight: 700; text-align: center; border-radius: 4px; padding: 3px 0; }
.pattern-edit { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.pday { border: 0; border-radius: 8px; padding: 6px 2px; background: var(--c); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pday small { font-size: 9px; opacity: .9; }
.pday span { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- v4: coGo-Parent, child info, medicines */
.login .tagline { margin: -10px 0 16px; }
.kid-head { margin-bottom: 8px; }
.tabs3 { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-bottom: 8px; }
.tabs3 button { padding: 8px 4px; }
.info-card { display: grid; gap: 8px; }
.info-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: baseline; }
.info-row a, .info-item a { color: var(--brand); font-weight: 600; text-decoration: none; }
.info-item { padding: 6px 0; border-bottom: 1px solid var(--line); }
.info-item:last-child { border-bottom: 0; }
.pre { white-space: pre-wrap; }
.times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; font-size: 13px; margin-top: 4px; }
.times div { display: flex; flex-direction: column; background: var(--bg); border-radius: 8px; padding: 4px 2px; }
.times-edit .row { margin: 6px 0; }
.times-edit .tday { width: 40px; }
.times-edit .input { padding: 8px; }
.times.seven { grid-template-columns: repeat(7, 1fr); }
.times-edit .check.tday { width: 72px; flex: none; margin: 0; gap: 6px; }
.times-edit .input:disabled { opacity: 0.4; }
.list-edit { margin-bottom: 8px; }
.actions.sticky { position: sticky; bottom: 0; background: var(--card); padding: 10px 0; }
.dose-time { width: 52px; font-size: 16px; }
.item.dose.late { background: #fef2f2; }
.item.dose.done { opacity: .75; }
.med { margin-bottom: 8px; }
.med.stopped { opacity: .6; }
.time-row { margin-bottom: 6px; }
.time-row .input { max-width: 160px; }
.due-wrap { padding: 8px 16px 0; max-width: 760px; margin: 0 auto; display: grid; gap: 6px; }
.due { display: flex; align-items: center; gap: 8px; background: #ecfeff; border: 1px solid #a5f3fc; color: #164e63; border-radius: 12px; padding: 8px 10px; font-size: 14px; font-weight: 600; }
.due.overdue { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
/* dark: chosen in Settings, or following the phone */
:root[data-theme="dark"] .item.dose.late { background: #3b1111; }
:root[data-theme="dark"] .due { background: #083344; border-color: #155e75; color: #cffafe; }
:root[data-theme="dark"] .due.overdue { background: #450a0a; border-color: #7f1d1d; color: #fee2e2; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]):not([data-theme="dark"]) .item.dose.late { background: #3b1111; }
:root:not([data-theme="light"]):not([data-theme="dark"]) .due { background: #083344; border-color: #155e75; color: #cffafe; }
:root:not([data-theme="light"]):not([data-theme="dark"]) .due.overdue { background: #450a0a; border-color: #7f1d1d; color: #fee2e2; }
}

/* ---------- v5: calendar views, expenses, invitations */
.cal-views { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin-bottom: 8px; }
.cal-views button { padding: 7px 2px; }
.tabs4 { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin-bottom: 8px; }
.tabs4 button { padding: 8px 2px; font-size: 13px; }
.tabs5 { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; margin-bottom: 8px; }
.tabs5 button { padding: 6px 1px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabs5 .tab-ico { font-size: 16px; line-height: 1.2; }
.tt-day.split { background: var(--bg); }
.tt-split { position: absolute; inset: 0; display: flex; border-radius: 8px; overflow: hidden; }
.tt-split span { flex: 1; background: color-mix(in srgb, var(--c) 35%, transparent); }
.tt-split span + span { border-inline-start: 2px solid var(--card); }
.tt-day > span, .tt-day > i { position: relative; }
.tt-day > i { position: absolute; }
.tt-status-row + .tt-status-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tt-waiting { display: block; margin: 10px 0; }
.kid-checks { display: flex; flex-direction: column; gap: 2px; }
.kid-check { margin: 4px 0; font-weight: 500; }
.section-title.row { display: flex; align-items: center; }
.tg { padding: 4px; overflow: hidden; }
.tg-head, .tg-body { display: grid; grid-template-columns: 40px repeat(var(--n), 1fr); }
.tg-day { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 8px; }
.tg-day small { font-size: 11px; color: var(--muted); font-weight: 700; }
.tg-day b { font-size: 15px; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; text-align: center; }
.tg-day.today b { background: var(--accent); color: #fff; }
.tg-day.sel { background: var(--brand-soft); }
.tg-allday { min-height: 22px; border-inline-start: 1px solid var(--line); padding: 2px; display: flex; flex-direction: column; gap: 2px; }
.tg-allday .bar { border: 0; text-align: start; }
.tg-hour { font-size: 10px; color: var(--muted); text-align: end; padding-inline-end: 4px; box-sizing: border-box; border-top: 1px solid var(--line); }
.tg-col { position: relative; border-inline-start: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.tg-col.today { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.tg-ev { position: absolute; border: 0; border-radius: 6px; padding: 2px 4px; background: var(--c); color: #fff; font-size: 11px; line-height: 1.2;
  text-align: start; overflow: hidden; box-shadow: 0 0 0 1px var(--card); }
.chip-x { border: 0; background: transparent; margin-inline-start: 4px; font-size: 12px; color: var(--muted); }
.login.wide { max-width: 440px; margin-top: 6vh; }
.stack.left { text-align: start; }
.item.exp { align-items: flex-start; }
.item.exp.done .name { text-decoration: line-through; color: var(--muted); }
.exp-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.totals { margin: 8px 0; display: grid; gap: 4px; }
.times-edit .row .input { flex: 1; min-width: 0; }
.banner.acting { background: #7c2d12; color: #fff; }
.banner.acting a { color: #fff; font-weight: 700; }
.info-item .name { font-weight: 600; }
.list-edit .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list-edit .dates .field, .list-edit .dates .input { min-width: 0; width: 100%; box-sizing: border-box; }
a.plain { color: inherit; text-decoration: none; }
.check.pick { align-items: flex-start; padding: 6px 0; }
.check.pick input { margin-top: 3px; }
span.dot { display: inline-block; vertical-align: middle; }
.pw-box { position: relative; }
.pw-box .input { padding-inline-end: 72px; width: 100%; box-sizing: border-box; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; padding: 6px 10px; cursor: pointer; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.or-line:has(+ .google-btn.hidden) { display: none; }
.google-btn { text-align: center; text-decoration: none; }
.login-foot { text-align: center; margin-top: 16px; }
.gcal-box { margin-bottom: 8px; }
.ics-alt summary { cursor: pointer; color: var(--muted); margin: 6px 0; }
.install-btn { margin-top: 10px; }
.install-steps { padding-inline-start: 20px; }
.install-steps li { margin: 8px 0; }

.about-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.about-head img { border-radius: 12px; }
.about-head .name { font-weight: 700; font-size: 18px; }

/* ---------- ☰ menu */
dialog.menu { margin: 0; height: 100dvh; max-height: 100dvh; width: min(300px, 82vw); border: 0; border-radius: 0 18px 18px 0;
  padding: calc(10px + var(--safe-t)) 0 calc(10px + var(--safe-b)); background: var(--card); color: var(--ink); display: flex; flex-direction: column; }
dialog.menu:not([open]) { display: none; }
dialog.menu::backdrop { background: rgba(0,0,0,.4); }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 0 8px 10px 18px; border-bottom: 1px solid var(--line); }
.menu-head img { border-radius: 8px; }
.menu-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 13px 18px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.menu-list a .ico { font-size: 22px; width: 28px; text-align: center; }
.menu-list a.active { background: var(--brand-soft); color: var(--brand); }
.count-pill { min-width: 22px; height: 22px; border-radius: 11px; padding: 0 7px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.menu-foot { padding: 10px 18px 0; border-top: 1px solid var(--line); }

.lang-switch { text-align: center; margin-top: 10px; color: var(--muted); }
.lang-switch a { color: var(--brand); }

/* ---------- addresses */
.addr-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 10px; }
.addr-grid .field { min-width: 0; }
.addr-grid .span1 { grid-column: span 1; } .addr-grid .span2 { grid-column: span 2; } .addr-grid .span3 { grid-column: span 3; }
.addr-grid .span4 { grid-column: span 4; } .addr-grid .span6 { grid-column: span 6; }
.address.small { font-size: 14px; }
.home-addr { margin-bottom: 10px; }
.home-addr b { display: block; margin-bottom: 2px; }
.warn-card { border-color: #f59e0b; background: #fffbeb; }

/* ---------- right-to-left (Arabic) */
[dir="rtl"] dialog.menu { margin-left: auto; margin-right: 0; border-radius: 18px 0 0 18px; }
[dir="rtl"] .chev, [dir="rtl"] .person > .muted:last-child, [dir="rtl"] .tt-card > .muted:last-child { display: inline-block; transform: scaleX(-1); }
/* Times, dates, postcodes and phone numbers stay left-to-right inside Arabic text. */
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"] { direction: ltr; text-align: end; }
[dir="rtl"] .cal-head .iconbtn { transform: scaleX(-1); }

/* ---- messages (☰ → Messages) */
.chat-card { display: block; padding: 12px 14px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.chat-card .row { min-width: 0; }
.chat-card.unread b { color: var(--brand); }
.chat-card.left { opacity: .7; }
.kid-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.kid-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.kid-tag .dot { width: 8px; height: 8px; }
.picker-house { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 12px 0 0; }
.people-picker .check.pick { margin: 4px 0; font-weight: 500; }
.people-picker .avatar { flex: none; }
.check.pick.off { opacity: .55; }
main.chat-main { padding-bottom: calc(var(--safe-b) + 4px); }
.chat-head { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.chat-subject { font-size: 17px; margin: 0; overflow-wrap: anywhere; }
.chat-msgs { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.chat-older { align-self: center; }
.chat-day { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 2px; }
.chat-sys { align-self: center; text-align: center; font-size: 12px; color: var(--muted); max-width: 88%; }
.bubble-row { display: flex; align-items: flex-end; gap: 6px; max-width: 85%; align-self: flex-start; }
.bubble-row.mine { align-self: flex-end; }
.bubble-row .avatar { flex: none; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 16px; border-end-start-radius: 4px; padding: 7px 11px; min-width: 64px; }
.mine .bubble { background: var(--brand); color: var(--brand-ink); border-color: transparent; border-end-start-radius: 16px; border-end-end-radius: 4px; }
.bubble-name { font-size: 12px; font-weight: 700; color: var(--c); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: 11px; opacity: .75; text-align: end; margin-top: 2px; }
.chat-seen { align-self: flex-end; font-size: 11px; color: var(--muted); }
.chat-compose { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0 calc(8px + var(--safe-b)); border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; max-height: 160px; min-height: 42px; box-sizing: border-box; }

/* ---- v9.6: login extras and settings */
.login .forgot { margin: 6px 0 0; text-align: end; }
.passkey-btn { margin-bottom: 8px; }
.small-select { width: auto; max-width: 55%; padding: 6px 8px; font-size: 14px; }
.card > .pad { padding: 8px 16px 12px; margin: 0; }

/* ---- v9.7: places, activities, address search, now */
.tabs6 { display: grid; grid-template-columns: repeat(6, 1fr); width: 100%; margin-bottom: 8px; }
.tabs6 button { padding: 6px 1px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabs6 .tab-ico { font-size: 16px; line-height: 1.2; }
.suggest-wrap { position: relative; }
.suggest { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); overflow: hidden; max-height: 320px; overflow-y: auto; }
.suggest-item { display: block; width: 100%; text-align: start; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest-item:hover, .suggest-item:focus { background: var(--bg); }
.suggest-foot { font-size: 11px; color: var(--muted); text-align: end; padding: 4px 10px; }
.place-card .address, .place-line .address { display: block; color: inherit; margin: 4px 0; }
.place-card > div + div { margin-top: 2px; }
.place-row .name { font-weight: 600; }
.tg-col { position: relative; }
.tg-now { position: absolute; inset-inline: 0; height: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; inset-inline-start: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.now-line { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 12px; font-weight: 700; margin: 6px 0; }
.now-line::before, .now-line::after { content: ''; flex: 1; height: 2px; background: var(--danger); }
.now-line::before { flex: 0 0 10px; border-radius: 2px; }
.kid-actions { gap: 8px; margin: -4px 0 10px; flex-wrap: wrap; }

/* v9.8 sizes and measurements */
.row .input.sys { flex: 0 0 5.5rem; width: 5.5rem; }
.row.measure { gap: .4rem; align-items: center; }
.row.measure .input.num { flex: 0 0 6rem; width: 6rem; }
