:root {
  --bg: #f5f3ec;
  --surface: #fffefa;
  --surface-2: #f6f6ef;
  --ink: #1d3128;
  --ink-2: #506054;
  --ink-3: #59695e;
  --line: #cbd3c7;
  --line-2: #e1e5da;
  --brand: #215743;
  --brand-ink: #ffffff;
  --accent: #39684e;
  --warn-bg: #fff0e9;
  --warn: #963526;
  --ok: #397351;
  --today: #e5efdf;
  --off: #eceee6;
  --chip: #e8ece2;
  --warn-ink: #ffffff;
  --caution-text: #704b12;
  --caution-bg: #fff0cb;
  color-scheme: light;
  --shadow: 0 2px 6px #2339270c;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: Lora, Georgia, serif;
  --radius: 15px;
  --radius-s: 9px;
  --gutter: clamp(16px, 2.5vw, 48px);
}
@media (prefers-color-scheme: dark) {
 :root:not([data-theme="light"]) {
  --bg: #131d19;
  --surface: #1c2922;
  --surface-2: #233129;
  --ink: #f1f3e8;
  --ink-2: #becbbf;
  --ink-3: #a3b4a6;
  --line: #45564a;
  --line-2: #35463a;
  --brand: #abd9b8;
  --brand-ink: #112b1b;
  --accent: #b8d3a8;
  --warn-bg: #3a231e;
  --warn: #ffb7a2;
  --ok: #a5dcb1;
  --today: #293f30;
  --off: #222e26;
  --chip: #2c3a30;
  --warn-ink: #361710;
  --caution-text: #f4d496;
  --caution-bg: #382e1c;
  color-scheme: dark;
  --shadow: 0 2px 6px #0003;
 }
}
:root[data-theme="dark"] {
  --bg: #131d19;
  --surface: #1c2922;
  --surface-2: #233129;
  --ink: #f1f3e8;
  --ink-2: #becbbf;
  --ink-3: #a3b4a6;
  --line: #45564a;
  --line-2: #35463a;
  --brand: #abd9b8;
  --brand-ink: #112b1b;
  --accent: #b8d3a8;
  --warn-bg: #3a231e;
  --warn: #ffb7a2;
  --ok: #a5dcb1;
  --today: #293f30;
  --off: #222e26;
  --chip: #2c3a30;
  --warn-ink: #361710;
  --caution-text: #f4d496;
  --caution-bg: #382e1c;
  color-scheme: dark;
  --shadow: 0 2px 6px #0003;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#app { display: flex; flex-direction: column; min-height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; flex: 1 1 220px; }
.brand-mark { font-size: 28px; }
.brand-family { font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.brand-title { font-size: 22px; font-weight: 750; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav, .tools { display: flex; gap: 6px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 16px; min-height: 44px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.icon { width: 44px; padding: 0; font-size: 22px; line-height: 1; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 38px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- member filter chips (tabs per participant) ---------- */
.filters { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid transparent; background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 8px; min-height: 40px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); }
.chip .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--c, var(--chip)); }
.chip.on { border-color: var(--c, var(--brand)); }
.chip.off { opacity: .45; }

main { flex: 1; padding: 0 16px 96px; outline: none; }

/* ---------- month ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dow-h { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; }
.cell { background: var(--surface); border-radius: var(--radius-s); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; border: 1px solid var(--line-2); position: relative; min-width: 0; }
.cell.other { opacity: .45; }
.cell.today { background: var(--today); border-color: var(--accent); }
.cell.offday { background: var(--off); }
.cell-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cell-num { font-weight: 750; font-size: 17px; }
.cell.today .cell-num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 8px; }
.wx { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.cell-add { position: absolute; right: 4px; bottom: 4px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; color: var(--ink-2); }
.tag { font-size: 11.5px; padding: 1px 6px; border-radius: 6px; background: var(--chip); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag.hol { background: #e9f2ff; color: #1d4f91; }
.tag.bday { background: #fdeaf3; color: #9b1d5a; }
.tag.school { background: #eaf6ee; color: #1f6b43; }
.tag.note { background: #f4efe2; color: #6b5420; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.hol { background: #1c2c44; color: #9cc0ef; } :root:not([data-theme="light"]) .tag.bday { background: #3a1d2c; color: #f3a6c9; } :root:not([data-theme="light"]) .tag.school { background: #183025; color: #8fd6ae; } :root:not([data-theme="light"]) .tag.note { background: #302a1b; color: #e3cd8f; } }
.ev-mini { font-size: 12.5px; display: flex; gap: 4px; align-items: center; padding: 1px 4px; border-radius: 6px; border-left: 4px solid var(--c, var(--ink-3)); background: var(--surface-2); white-space: nowrap; overflow: hidden; }
.ev-mini span { overflow: hidden; text-overflow: ellipsis; }
.ev-mini.conflict { background: var(--warn-bg); }
.more { font-size: 12px; color: var(--ink-2); font-weight: 600; padding-left: 4px; }

/* ---------- week ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wcol { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-2); padding: 8px; min-height: 60vh; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wcol.today { background: var(--today); border-color: var(--accent); }
.wcol h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; }
.wcol h3 b { font-size: 22px; }

/* ---------- day ---------- */
.day-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.day-head h2 { margin: 0; font-size: 28px; flex: 1 1 260px; }
.day-wx { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
.day-wx .big { font-size: 34px; }
.banner { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.banner-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.pill.school { background: #eaf6ee; border-color: #cfe9d9; color: #1f6b43; }
.pill.note { background: #f4efe2; border-color: #e8dec3; color: #6b5420; cursor: pointer; }
.pill.hol { background: #e9f2ff; border-color: #cfe0fa; color: #1d4f91; }
.pill.bday { background: #fdeaf3; border-color: #f6cfe2; color: #9b1d5a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.school { background: #183025; border-color: #24483a; color: #8fd6ae; } :root:not([data-theme="light"]) .pill.note { background: #302a1b; border-color: #4a4026; color: #e3cd8f; } :root:not([data-theme="light"]) .pill.hol { background: #1c2c44; border-color: #2b4366; color: #9cc0ef; } :root:not([data-theme="light"]) .pill.bday { background: #3a1d2c; border-color: #5a2d44; color: #f3a6c9; } }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px 14px; border-left: 6px solid var(--c, var(--ink-3)); box-shadow: var(--shadow); cursor: pointer; }
.ev.past { opacity: .55; }
.ev.now { outline: 2px solid var(--accent); }
.ev.conflict { background: var(--warn-bg); }
.ev-time { font-weight: 750; font-size: 16px; }
.ev-time small { display: block; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.ev-title { font-size: 18px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-meta { color: var(--ink-2); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.ev-icons { display: flex; gap: 6px; font-size: 18px; align-items: center; }
.who { display: inline-flex; gap: 4px; }
.who i { font-style: normal; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--c); color: #fff; }
.badge-conflict { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--warn); border-radius: 6px; padding: 2px 6px; }
.conflict-text { color: var(--warn); font-size: 13.5px; font-weight: 600; }
.cols { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--c); }
.col h3 { margin: 4px 4px 2px; font-size: 16px; }
.col .ev { grid-template-columns: 1fr; gap: 2px; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 16px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }

/* ---------- year ---------- */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ymonth { background: var(--surface); border-radius: var(--radius); padding: 10px; border: 1px solid var(--line-2); }
.ymonth h3 { margin: 0 0 6px; font-size: 16px; cursor: pointer; }
.ygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12.5px; }
.ygrid b { color: var(--ink-3); font-weight: 600; font-size: 11px; }
.yday { padding: 4px 0; border-radius: 6px; cursor: pointer; position: relative; }
.yday.has::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.yday.today { background: var(--accent); color: #fff; font-weight: 700; }
.yday.hol { color: #1d4f91; font-weight: 700; }
.yday.offday { text-decoration: line-through; color: var(--ink-3); }

/* ---------- sheet (modal) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 30, .45); }
.sheet { position: relative; background: var(--surface); width: min(760px, 100%); max-height: min(92dvh, 920px); overflow: auto; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); padding: 0 0 16px; }
.sheet-head { position: sticky; top: 0; background: var(--surface); z-index: 2; display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { margin: 0; font-size: 22px; flex: 1; }
.sheet-body { padding: 16px 20px; }
.sheet-foot { position: sticky; bottom: -16px; background: var(--surface); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line-2); }
.sheet-foot .spacer { flex: 1; }
.steps { display: flex; gap: 4px; padding: 0 20px 10px; overflow-x: auto; }
.steps span { flex: 1; min-width: 28px; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--brand); }
.steps span.cur { background: var(--accent); }
.step-q { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.step-hint { color: var(--ink-2); margin: 0 0 14px; font-size: 14.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 10px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface-2); font-weight: 650; text-align: center; }
.tile .em { font-size: 32px; line-height: 1; }
.tile small { color: var(--ink-2); font-weight: 500; font-size: 12.5px; }
.tile.on { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, var(--surface)); }
.tile.new { border-style: dashed; color: var(--ink-2); }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { border: 2px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 8px 14px; min-height: 44px; font-weight: 600; }
.opt.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label, .lbl { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px; background: var(--surface-2); width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; }
.review { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px 12px; align-items: center; }
.review dt { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.review dd { margin: 0; font-weight: 600; }
.callout { border-radius: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); margin: 12px 0; }
.callout.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.callout b { color: var(--ink); }
.callout.warn b { color: var(--warn); }

/* ---------- setup ---------- */
.tabs { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; }
.tabs button { border: 0; background: var(--chip); border-radius: 999px; padding: 8px 14px; font-weight: 650; white-space: nowrap; min-height: 40px; }
.tabs button.on { background: var(--brand); color: var(--brand-ink); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); cursor: pointer; }
button.row { width: 100%; text-align: left; }
.row:hover { border-color: var(--line); }
.row .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--c, var(--chip)); flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .sub { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.swatches button.on { border-color: var(--ink); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 10px; border: 2px solid transparent; background: var(--surface-2); font-size: 22px; }
.emoji-pick button.on { border-color: var(--brand); }
.section-h { font-size: 15px; font-weight: 800; margin: 18px 0 8px; color: var(--ink); }

/* ---------- overlays: privacy, sleep, babysitter, welcome ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: #0c1118; color: #f2f5f8; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.clock { font-size: clamp(64px, 16vw, 180px); font-weight: 200; letter-spacing: -.02em; line-height: 1; }
.clock-date { font-size: clamp(20px, 3.5vw, 34px); opacity: .8; margin-top: 8px; }
.overlay .hint { opacity: .55; margin-top: 28px; font-size: 15px; }
.overlay.sleep { background: #000; color: #6d7480; }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; margin-top: 18px; }
.pinpad button { height: 76px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: inherit; font-size: 26px; }
.pin-dots { display: flex; gap: 12px; margin-top: 18px; min-height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.pin-dots i.f { background: currentColor; }
.pin-err { color: #ff9b80; min-height: 22px; margin-top: 8px; }
.sitter { background: #fff; color: #10151c; justify-content: flex-start; align-items: stretch; }
.sitter-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sitter-head h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); }
.sos { background: #c62828; color: #fff; border-radius: 16px; padding: 14px 20px; font-size: 22px; font-weight: 800; }
.sitter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.kid { border: 2px solid var(--c); border-radius: 18px; padding: 16px; }
.kid h2 { margin: 0 0 8px; font-size: 26px; display: flex; gap: 10px; align-items: center; }
.kid dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; margin: 0; font-size: 17px; }
.kid dt { font-weight: 700; color: #5b6573; }
.kid dd { margin: 0; }
.kid .alert { color: #b42318; font-weight: 800; }
.welcome { background: var(--bg); color: var(--ink); }
.welcome-card { background: var(--surface); border-radius: 24px; padding: 32px; max-width: 640px; box-shadow: var(--shadow); text-align: center; }
.welcome-card h1 { margin: 6px 0 10px; font-size: 34px; }
.welcome-card p { color: var(--ink-2); font-size: 17px; }
.welcome-card .opt-row { justify-content: center; margin-top: 20px; }

/* ---------- toasts & fab ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); }
.toast { background: #1d2733; color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); display: flex; gap: 12px; align-items: flex-start; }
.toast b { display: block; }
.toast .x { margin-left: auto; background: none; border: 0; color: #fff; font-size: 20px; }
.tools [data-action="menu"] { position: relative; }
.badge-dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; }
.fab { display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 32px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 6; }

/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { flex: 1 1 100%; order: 0; padding-right: 56px; }
  .brand-title { font-size: 19px; }
  .nav { order: 2; }
  .seg { order: 1; flex: 1; }
  .seg button { flex: 1; padding: 8px 6px; }
  .tools { order: 0; position: absolute; right: 12px; top: 8px; }
  .tools .btn.primary, .tools [data-action="note"] { display: none; }
  .fab { display: block; }
  main { padding: 0 12px 100px; }
  .filters { padding: 8px 12px; }
  .month { gap: 3px; }
  .cell { min-height: 74px; padding: 4px; }
  .cell .ev-mini span, .cell .tag, .cell .wx, .cell-add { display: none; }
  .cell .ev-mini { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--c); display: inline-block; }
  .cell-dots { display: flex; flex-wrap: wrap; gap: 3px; }
  .dow-h { font-size: 11px; padding: 2px; text-align: center; }
  .week { grid-template-columns: 1fr; }
  .wcol { min-height: 0; }
  .ev { grid-template-columns: 70px 1fr; }
  .ev-icons { grid-column: 2; }
  .day-head h2 { font-size: 22px; }
  .sheet-wrap { align-items: flex-end; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 94dvh; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .review { grid-template-columns: 100px 1fr auto; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* Shared controls and typography */
.glyph { width:1.15em; height:1.15em; display:inline-block; vertical-align:-.18em; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; flex:none }
:focus-visible { outline:3px solid var(--brand); outline-offset:2px }
button, input, select { accent-color:var(--brand) }
button { min-block-size:44px; min-inline-size:44px }
.topbar { padding:12px var(--gutter); gap:10px; border-top:4px solid var(--brand) }
.brand > div { min-width:0 }
.brand-mark { width:48px; height:48px; flex:none; display:grid; place-items:center; background:var(--brand); color:var(--brand-ink); border-radius:15px 15px 15px 4px }
.brand-family,.dow-h { font-size:.78rem; font-weight:700; letter-spacing:.09em; text-transform:uppercase }
.brand-title,.day-head h2,.sheet-head h2,.welcome h1,.sitter h1,.ymonth h3 { font-family:var(--display); font-weight:600; letter-spacing:-.035em }
.brand-title { font-size:clamp(20px,1.8vw,30px); line-height:1.24 }
.btn,.opt,.tabs button { border-radius:10px }
.btn.small,.seg button,.tabs button,.chip,.wcol [data-action],.pill[data-action],.ymonth h3 { min-height:44px }
.btn.primary { box-shadow:0 2px 4px #10261919 }
.btn.primary:hover { background:color-mix(in srgb,var(--brand) 90%,var(--ink)); color:var(--brand-ink) }
.seg { border-radius:12px; background:var(--chip) }
.seg button { border-radius:9px }
.seg button.on { color:var(--brand) }
.filters { padding:16px var(--gutter); gap:7px }
.chip { border:1px solid var(--line); box-shadow:none; padding:5px 13px 5px 7px }
.chip.on { background:var(--today); box-shadow:inset 0 0 0 1px var(--c,var(--brand)) }
.chip.off,.cell.other,.ev.past { opacity:1; color:var(--ink-2) }
.chip .dot,.row .av,.tile .em { background:color-mix(in srgb,var(--c,var(--brand)) 16%,var(--surface)); color:var(--brand) }
main { padding-inline:var(--gutter) }
.day-head { background:transparent; border-radius:0; box-shadow:none; padding:6px 0 18px; border-bottom:2px solid var(--brand) }
.day-head h2 { font-size:clamp(29px,3.3vw,52px); line-height:1.15 }
.day-head .seg { flex:none }
.banner { margin:14px 0 }
.pill { border-radius:8px }
.ev { border:1px solid var(--line); border-left:4px solid var(--c); grid-template-columns:clamp(105px,10vw,148px) minmax(0,1fr) auto; gap:18px; padding:14px 18px }
.ev-time { font-size:clamp(23px,2vw,32px); font-weight:700; letter-spacing:-.035em; font-variant-numeric:tabular-nums; border-right:1px solid var(--line); line-height:1.15 }
.ev-time small { margin-top:4px; letter-spacing:0; font-size:15px }
.ev-title { font-size:clamp(20px,1.65vw,27px); line-height:1.25; overflow-wrap:anywhere }
.ev-meta { font-size:16px; margin-top:4px }
.ev-meta .glyph,.ev-icons { color:var(--ink-2) }
.who { flex-wrap:wrap }
.who i { color:var(--ink); background:color-mix(in srgb,var(--c) 16%,var(--surface)); border-inline-start:3px solid var(--c); border-radius:5px }
.ev.conflict,.callout.warn { border-color:var(--warn) }
.badge-conflict { color:var(--warn-ink); background:var(--warn) }
.ev-meta[style] { color:var(--caution-text)!important; background:var(--caution-bg); width:fit-content; border-radius:6px; padding:3px 8px }
.col .ev-time { border:0 }
.month,.week { gap:1px; border:1px solid var(--line); background:var(--line); border-radius:14px; overflow:hidden }
.dow-h { background:var(--chip); padding:10px }
.cell,.wcol { border:0; border-radius:0; padding:9px }
.cell { padding-bottom:48px }
.cell.today,.wcol.today { background:var(--today); box-shadow:inset 0 3px var(--brand) }
.cell.today .cell-num,.yday.today,.badge-dot { background:var(--brand); color:var(--brand-ink) }
.cell-add { width:44px; height:44px; border:0; background:transparent; color:var(--brand) }
.tag { font-size:13px; line-height:1.5 }
.wcol h3 { border-bottom:1px solid var(--line); align-items:center; padding-bottom:5px }
.wcol h3 b { font-size:28px; margin-inline-start:2px }
.wcol .ev-mini { font-size:15px; padding:7px; border-left-width:3px; line-height:1.28 }
.wcol .btn { white-space:normal }
.year { grid-template-columns:repeat(auto-fit,minmax(min(100%,334px),1fr)) }
.yday { min-height:44px; display:grid; place-items:center }
.ymonth h3 { font-size:24px }
.yday.hol { color:var(--brand) }
.yday.today { color:var(--brand-ink) }
.sheet { padding-bottom:0; border:1px solid var(--line) }
.sheet-head,.sheet-body,.sheet-foot { padding-inline:clamp(16px,3vw,32px) }
.sheet-head { padding-block:16px; }
.sheet-head h2 { font-size:clamp(24px,3vw,32px) }
.sheet-foot { bottom:0; z-index:2; padding-bottom:max(14px,env(safe-area-inset-bottom)) }
.steps,.tabs { padding:12px clamp(16px,3vw,32px) }
.steps span { height:5px }
.step-q { font-size:24px; letter-spacing:-.02em }
.tile { border-width:1px; min-height:114px }
.tile.on,.opt.on { box-shadow:inset 0 0 0 1px var(--c,var(--brand)) }
.tile .em { border-radius:14px; min-width:46px; min-height:46px; display:grid; place-items:center; font-size:25px }
.review { background:var(--surface-2); padding:14px; border-radius:12px }
.review .btn { color:var(--brand); text-decoration:underline; text-underline-offset:3px }
.row { padding:13px 15px }
.row .sub { white-space:normal; font-size:15px }
.swatches button,.toast .x { width:44px; height:44px }
.sheet .btn { white-space:normal }
.overlay { background:#13241e }
.overlay .hint { opacity:1; color:inherit }
.welcome,.sitter { background:var(--bg); color:var(--ink) }
.welcome-card { border-top:5px solid var(--brand); margin-block:auto }
.welcome-card .glyph { color:var(--brand) }
.sitter-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)) }
.kid { background:var(--surface); border:1px solid var(--line); border-top:5px solid var(--c); padding:20px }
.kid dt,.kid h2 small { color:var(--ink-2)!important }
.kid h2 { flex-wrap:wrap; line-height:1.2 }
.kid dd { overflow-wrap:anywhere }
.kid .alert { color:var(--warn) }
.sos { border-radius:10px }
.overlay.sleep { color:#969f99 }
.toast { background:#203c30 }
.fab { border-radius:18px }
@media (prefers-reduced-motion:no-preference) {
  .sheet { animation:sheet-enter .17s ease-out }
  @keyframes sheet-enter { from { transform:translateY(12px); opacity:.7 } }
  .chip:active,.tile:active { transform:translateY(1px) }
}
@media (max-width:760px) {
  .topbar { padding:8px 12px; gap:5px }
  .brand { min-height:44px }
  .brand-mark { width:38px; height:38px; border-radius:11px; font-size:23px }
  .brand-title { font-size:18px }
  .brand-family { font-size:11px }
  .filters { padding:10px 12px }
  main { padding-inline:12px }
  .day-head { align-items:flex-start; gap:9px; padding-bottom:12px }
  .day-head h2 { flex-basis:100%; font-size:30px }
  .cell { padding:4px; min-height:76px }
  .month { min-width:308px }
  .year { padding-inline:0 }
  .ymonth { padding:6px; overflow-x:auto }
  .ygrid { grid-template-columns:repeat(7,minmax(44px,1fr)); gap:0 }
  .ev { grid-template-columns:78px minmax(0,1fr); padding:12px; gap:5px 10px }
  .ev-time { font-size:21px }
  .ev-meta { font-size:15px; gap:4px 10px }
  .ev-icons:empty { display:none }
  .sitter { padding:16px }
  .kid dl { grid-template-columns:minmax(76px,30%) 1fr }
  .review { grid-template-columns:auto minmax(0,1fr) auto; padding:8px; gap:6px; overflow-wrap:anywhere }
  .sheet { border-bottom:0 }
  .wcol { padding:12px }
}
@media(max-width:380px) { .nav { gap:2px } .nav .btn { padding-inline:8px } .topbar .seg button { padding-inline:3px } }


:root[data-theme="dark"] .tag.hol { background: #1c2c44; color: #9cc0ef; } :root[data-theme="dark"] .tag.bday { background: #3a1d2c; color: #f3a6c9; } :root[data-theme="dark"] .tag.school { background: #183025; color: #8fd6ae; } :root[data-theme="dark"] .tag.note { background: #302a1b; color: #e3cd8f; }
:root[data-theme="dark"] .pill.school { background: #183025; border-color: #24483a; color: #8fd6ae; } :root[data-theme="dark"] .pill.note { background: #302a1b; border-color: #4a4026; color: #e3cd8f; } :root[data-theme="dark"] .pill.hol { background: #1c2c44; border-color: #2b4366; color: #9cc0ef; } :root[data-theme="dark"] .pill.bday { background: #3a1d2c; border-color: #5a2d44; color: #f3a6c9; }
/* The inbox counter refreshes the menu button text at runtime. */
.tools [data-action="menu"] { font-size:0; }
.tools [data-action="menu"]::before { content:""; display:inline-block; width:20px; height:14px; border-block:2px solid currentColor; background:linear-gradient(currentColor,currentColor) center / 100% 2px no-repeat; }
.tools [data-action="menu"] .glyph { display:none }

[data-stab="members"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2020v-2a6%206%200%200%201%2012%200v2%20M5.5%207a3.5%203.5%200%201%200%207%200%203.5%203.5%200%201%200-7%200%20M16%204a3.5%203.5%200%200%201%200%207m1%203a5%205%200%200%201%204%205%22%2F%3E%3C%2Fsvg%3E") }
[data-stab="activities"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%2018%200%209%209%200%201%200-18%200%20M3%2012h18M12%203c-4%205-4%2013%200%2018m0-18c4%205%204%2013%200%2018%22%2F%3E%3C%2Fsvg%3E") }
[data-stab="places"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19%2010c0%205-7%2011-7%2011S5%2015%205%2010a7%207%200%201%201%2014%200z%20M10%2010a2%202%200%201%200%204%200%202%202%200%201%200-4%200%22%2F%3E%3C%2Fsvg%3E") }
[data-stab="contacts"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%203%203%204-2%203q2%205%207%207l3-2%204%203-2%203Q6%2021%203%206z%22%2F%3E%3C%2Fsvg%3E") }
[data-stab="school"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%2010%209-7%209%207%20M5%209v12h14V9%20M10%2021v-6h4v6%20M11%2010h2%22%2F%3E%3C%2Fsvg%3E") }
[data-stab="settings"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207h6m4%200h8M3%2017h10m4%200h4%20M9%204h4v6H9z%20M13%2014h4v6h-4z%22%2F%3E%3C%2Fsvg%3E") }
[data-n="app"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%202h12v20H6z%20M11%2018h2%22%2F%3E%3C%2Fsvg%3E") }
[data-n="email"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h18v13H3z%20m0%201%209%207%209-7%22%2F%3E%3C%2Fsvg%3E") }
[data-n="text"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%203h14v12l-6%206H5z%20M13%2021v-6h6%20M8%208h8m-8%204h5%22%2F%3E%3C%2Fsvg%3E") }
[data-pick-ride="bus"] .em { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%204h16v15H4z%20M4%2012h16%20M7%2019v2m10-2v2M7%2015h2m6%200h2%22%2F%3E%3C%2Fsvg%3E") }
[data-pick-ride="carpool"] .em { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m4%2010%202-6h12l2%206%20M3%2010h18v7H3z%20M5%2017v3m14-3v3%20M6%2013h2m8%200h2%22%2F%3E%3C%2Fsvg%3E") }
[data-pick-ride="walk"] .em { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M11%205a2%202%200%201%200%204%200%202%202%200%201%200-4%200%20M6%2013l5-5%204%204%204%201m-8-4-1%206%205%205m-5-5-4%206%22%2F%3E%3C%2Fsvg%3E") }
[data-pick-ride="self"] .em { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%2018%200%209%209%200%201%200-18%200%20M4%2010l8%204%208-4m-8%204v7%22%2F%3E%3C%2Fsvg%3E") }
[data-pick-ride=""] .em { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%200%2018%200%209%209%200%201%200-18%200%20M6%206l12%2012%22%2F%3E%3C%2Fsvg%3E") }
[title="Reminders set"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2016l2-3V9a5%205%200%200%201%2010%200v4l2%203z%20M10%2019q2%203%204%200%22%2F%3E%3C%2Fsvg%3E") }
[title="Shared"] { --ui-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2015V3m-4%204%204-4%204%204M5%2012v8h14v-8%22%2F%3E%3C%2Fsvg%3E") }
.icon-label { display:inline-block }
.icon-label::first-letter { font-size:0 }
[data-stab]::before,[data-n]::before,.ev-icons [title]::before,.tile .em[style]::before { display:inline-block }
[data-stab]::before,[data-n]::before,.ev-icons [title]::before,.tile[data-pick-ride]:is([data-pick-ride="bus"],[data-pick-ride="carpool"],[data-pick-ride="walk"],[data-pick-ride="self"],[data-pick-ride=""]) .em::before {
  content:""; width:19px; height:19px; vertical-align:-4px; background:currentColor; mask:var(--ui-icon) center / contain no-repeat;
}
.ev-icons [title],.tile[data-pick-ride]:is([data-pick-ride="bus"],[data-pick-ride="carpool"],[data-pick-ride="walk"],[data-pick-ride="self"],[data-pick-ride=""]) .em { font-size:0 }
@media(min-width:761px) { .ygrid { grid-template-columns:repeat(7,minmax(44px,1fr)) } }

/* Touch-ups after the redesign ------------------------------------------------------------- */
/* 1. Person filter chips: each person's own color, readable from across the kitchen. */
.chip .dot { background:var(--c,var(--brand)); color:#fff; box-shadow:0 0 0 2px var(--surface) }
.chip[data-action="filter"] { border-color:color-mix(in srgb,var(--c,var(--brand)) 45%,var(--line)) }
.chip.on { background:color-mix(in srgb,var(--c,var(--brand)) 14%,var(--surface)); border-color:var(--c,var(--brand)); box-shadow:inset 0 0 0 1px var(--c,var(--brand)) }
.chip[data-action="filter-all"] .dot { background:color-mix(in srgb,var(--brand) 16%,var(--surface)); color:var(--brand) }
/* 3. Current weather on today's view: big temperature like a phone's weather widget. */
.now-wx { gap:10px }
.now-wx .big { font-size:44px; line-height:1 }
.now-wx .now-temp { font-size:44px; font-weight:700; line-height:1; letter-spacing:-.02em; font-variant-numeric:tabular-nums }
.now-wx .now-meta { font-size:14px; font-weight:600; color:var(--ink-2); line-height:1.35 }
@media (max-width:760px) { .now-wx .big, .now-wx .now-temp { font-size:34px } }
/* 2. Week view day notes: compact tags again (they are tappable, but don't need a 44px-tall block). */
.wcol .tag[data-action] { min-height:0; padding:3px 8px; line-height:1.35 }

/* Profile photos as person icons (fall back to the emoji when there's no photo). */
.avatar-photo { width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block }
.chip .dot, .row .av, .tile .em, .h-av { overflow:hidden }
.chip .dot:has(.avatar-photo), .row .av:has(.avatar-photo), .tile .em:has(.avatar-photo) { padding:0 }
.tile .em .avatar-photo { width:46px; height:46px }
.h-av { display:inline-grid; place-items:center; width:1.4em; height:1.4em; border-radius:50%; vertical-align:middle; flex:none }
.photo-row { display:flex; gap:12px; align-items:center; margin:0 0 12px; padding:10px; border:1px solid var(--line); border-radius:14px }
.avatar-photo.big { width:56px; height:56px; border-radius:50%; flex:none }
.photo-row .sub { color:var(--ink-2); font-size:13px }
.btn.drive { margin-top:8px; display:inline-flex; align-items:center; gap:6px; text-decoration:none; color:var(--brand) }

/* Person chips on phones: never squeeze a chip (that crushed the round icons and cut names off) — the row scrolls sideways instead. */
.chip { flex:none }
.chip .dot { flex:none; width:28px; height:28px; font-size:16px; line-height:1 }
.chip .dot .glyph { width:17px; height:17px }
@media (max-width:760px) {
  .filters { gap:6px; scroll-padding-inline:12px }
  .chip { padding:4px 12px 4px 6px; font-size:14px; gap:6px }
  .chip .dot { width:30px; height:30px; font-size:17px }
}
/* Phones: big families wrap onto a 2nd/3rd row of chips (no sideways scrolling), and the day heading shrinks to make room. */
@media (max-width:760px) {
  .filters { flex-wrap:wrap; overflow-x:visible; row-gap:6px }
  .day-head h2 { font-size:22px; line-height:1.2 }
}

/* What to bring: one line per person (plus Everyone) */
.field.bring .bring-row { display:grid; grid-template-columns:minmax(90px,30%) 1fr; gap:10px; align-items:center; margin-top:6px }
.field.bring .bring-row label { text-transform:none; letter-spacing:0; font-size:15px; font-weight:600; color:var(--ink) }
@media (max-width:480px) { .field.bring .bring-row { grid-template-columns:1fr; gap:4px } }

/* Person-colored events: soft fill in the person's color + their photo/emoji in the corner */
.ev:not(.conflict) { background:color-mix(in srgb,var(--c) 15%,var(--surface)); border-color:color-mix(in srgb,var(--c) 35%,var(--line)) }
.ev-mini:not(.conflict) { background:color-mix(in srgb,var(--c) 20%,var(--surface)) }
.ev, .ev-mini { border-radius:14px }
.faces { display:inline-flex; flex:none; align-items:center }
.face { width:34px; height:34px; border-radius:50%; display:inline-grid; place-items:center; overflow:hidden; font-size:19px; line-height:1; background:color-mix(in srgb,var(--c) 30%,var(--surface)); box-shadow:0 0 0 2px var(--surface); flex:none }
.face + .face { margin-left:-8px }
.face .avatar-photo { width:100%; height:100%; object-fit:cover; display:block }
.face.more { font-size:12px; font-weight:700; color:var(--ink-2); background:var(--surface-2) }
.ev-mini { justify-content:space-between }
.ev-mini .face { width:22px; height:22px; font-size:13px; box-shadow:0 0 0 1.5px var(--surface) }
.ev-mini .face + .face { margin-left:-6px }
.ev-mini .face.more { font-size:10px }
.wcol .ev-mini { align-items:flex-start }
@media (max-width:760px) { .cell .ev-mini .faces { display:none } .cell .ev-mini:not(.conflict) { background:var(--c); border-radius:50% } }

/* ---------- left icon bar (tablet and bigger; phones keep the ☰ menu) ---------- */
.rail { display: none; }
@media (min-width: 761px) {
  #app { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  #app > :not(.rail) { grid-column: 2; }
  .rail { display: flex; flex-direction: column; align-items: center; gap: 6px; grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 0; height: 100dvh; padding: 14px 8px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; z-index: 6; }
  .rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 76px; min-height: 64px; padding: 8px 4px; border: 0; border-radius: 18px; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
  .rail-btn .glyph { width: 26px; height: 26px; }
  .rail-btn:hover { background: var(--surface-2); color: var(--ink); }
  .rail-btn.rail-add { background: var(--brand); color: var(--brand-ink); border-radius: 50%; width: 60px; min-height: 60px; height: 60px; justify-content: center; margin: 4px 0; }
  .rail-btn.rail-add span { display: none; }
  .rail-btn.rail-add .glyph { width: 30px; height: 30px; }
  .rail-btn[hidden] { display: none; }
  .rail-btn .badge-dot { top: 4px; right: 12px; }
  .rail-gap { flex: 1; min-height: 8px; }
  /* the bar now holds these, so the top bar gets simpler */
  .tools { display: none; }
}

/* ---------- clean header: family name · date · time · weather on one line ---------- */
.hdr-line { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; cursor: pointer; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.hdr-line .brand-mark { width: 40px; height: 40px; border-radius: 12px 12px 12px 4px; }
.hdr-fam { font-family: var(--display); font-size: clamp(20px, 1.9vw, 28px); font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hdr-now { display: flex; align-items: center; gap: 18px; margin-left: auto; flex: none; font-size: clamp(16px, 1.5vw, 21px); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.hdr-time { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.hdr-now > span + span::before { content: "·"; margin-right: 18px; color: var(--line); font-weight: 800; }
.brand { flex: 1 1 200px; }
.brand-title { font-size: clamp(18px, 1.5vw, 24px); }
@media (max-width: 760px) {
  .hdr-line { padding-right: 52px; gap: 8px; padding-bottom: 6px; }
  .hdr-line .brand-mark { width: 32px; height: 32px; border-radius: 10px 10px 10px 4px; }
  .hdr-line .brand-mark .glyph { width: 18px; height: 18px; }
  .hdr-fam { font-size: 17px; }
  .hdr-now { gap: 8px; font-size: 14px; }
  .hdr-now > span + span::before { margin-right: 8px; }
  .brand { padding-right: 0; min-height: 36px; }
  .brand-title { font-size: 17px; }
  .tools { top: 6px; }
}
@media (max-width: 760px) { .hdr-line { min-height: 46px; } }
@media (max-width: 430px) { .hdr-line .brand-mark { display: none; } .hdr-fam { font-size: 16px; } .hdr-now { gap: 5px; font-size: 13px; } .hdr-now > span + span::before { margin-right: 5px; } }

/* Phone home grid: big tiles at the top of the ☰ sheet (same buttons as the tablet icon bar) */
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.home-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 20px 20px 20px 6px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 700; }
.home-tile .glyph { width: 30px; height: 30px; color: var(--brand); }
.home-tile.add { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.home-tile.add .glyph { color: var(--brand-ink); }
.home-tile:active { transform: scale(.97); }
.home-tile .badge-dot { top: 8px; right: 10px; }
.list .row[hidden] { display: none; }

/* Round + button: a true circle in the corner, on phones and tablets */
.fab { display: flex; align-items: center; justify-content: center; border-radius: 50%; width: 64px; height: 64px; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); padding: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 0 2px 5px rgba(0, 0, 0, .12); transition: transform .12s ease, box-shadow .12s ease; }
.fab .glyph { width: 30px; height: 30px; stroke-width: 2.4; color: var(--brand-ink); }
.fab:active { transform: scale(.94); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
@media (min-width: 761px) { .fab { width: 72px; height: 72px; right: 28px; bottom: calc(28px + env(safe-area-inset-bottom)); } .fab .glyph { width: 34px; height: 34px; } }
@media print { .fab { display: none; } }

/* Rounder cards: soft corners with the tucked bottom-left corner from our calendar mark */
.ev { border-radius:22px 22px 22px 8px; border:1.5px solid color-mix(in srgb,var(--c, var(--ink-3)) 55%,var(--line)) }
.ev.conflict { border-color:var(--warn) }
.ev-mini { border-radius:10px 10px 10px 4px; border-left-width:0 }
@media (min-width:761px) { .cell .ev-mini { padding:2px 6px } }
.wcol .ev-mini { border-radius:16px 16px 16px 6px; border:1.5px solid color-mix(in srgb,var(--c, var(--ink-3)) 55%,var(--line)) }
.wcol .ev-mini.conflict { border-color:var(--warn) }
.col { border-radius:22px 22px 22px 8px }
.cell .ev-mini.conflict { border:1.5px solid var(--warn) }

/* Stage 1 · calendar toolbar and family sidebar */
.calendar-bar { display:flex; align-items:center; flex-wrap:wrap; gap:4px; width:100% }
.calendar-bar .btn,.calendar-bar select,.mini-head .btn { min-height:44px; min-width:44px }
.calendar-bar select { border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:var(--radius-s); font:inherit }
.calendar-bar .period { font-family:var(--display); margin-right:auto }
#calendarSide,.wide-toggle { display:none }
@media(min-width:761px) {
  #app { grid-template-columns:92px 328px minmax(0,1fr); grid-template-rows:auto 1fr }
  #app > .topbar { grid-column:2 / -1; grid-row:1 }
  #app > #calendarSide { display:block; grid-column:2; grid-row:2; padding:10px; background:var(--surface); border-right:1px solid var(--line) }
  #app > #main { grid-column:3; grid-row:2; width:100%; min-width:0 }
  #app.side-closed { grid-template-columns:92px 0 minmax(0,1fr) }
  #app.side-closed > #calendarSide,#filters,.calendar-bar .phone-home { display:none }
  .calendar-bar .wide-toggle { display:inline-flex }
  .workweek { grid-template-columns:repeat(5,minmax(0,1fr)) }
}
@media(min-width:761px) and (max-width:1050px) {
  #app {grid-template-columns:92px minmax(0,1fr)}
  #app > #main {grid-column:2}
  #app > #calendarSide { width:328px; align-self:start; z-index:4; box-shadow:var(--shadow) }
  #app.side-closed {grid-template-columns:92px minmax(0,1fr)}
}
.mini-head,.family-row { display:flex; align-items:center; min-height:44px; gap:10px }
.mini-head { justify-content:space-between; margin:12px 0 6px }
.mini-grid { display:grid; grid-template-columns:repeat(7,1fr); text-align:center }
.mini-grid button { background:transparent; border:0; color:var(--ink); min-height:44px; font:inherit; border-radius:var(--radius-s) }
.mini-grid .outside { color:var(--ink-3) }
.mini-grid .selected { background:var(--surface-2); box-shadow:inset 0 0 0 1px var(--brand) }
.mini-grid .current { background:var(--brand); color:var(--brand-ink) }
.family-row input { width:20px; height:20px }
#calendarSide > .primary {width:100%;min-height:44px}
.calendar-row { display:flex; gap:8px; align-items:center; width:100%; min-height:44px; text-align:left; font:inherit; color:var(--ink); background:var(--surface); border:0; border-left:4px solid var(--c); border-bottom:1px solid var(--line); padding:8px }
.schedule-day h2 { font-family:var(--display) }
.month .cell { height:clamp(160px,22vh,260px); padding-bottom:4px }
.month .cell-dots { flex:1 1 0; min-height:0; overflow:hidden; align-content:start }
.month .cell-dots > [hidden],.overflow-day[hidden] {display:none}
.month .cell.today .cell-num { display:grid; place-items:center; width:32px; height:32px; padding:0; border-radius:50% }
.overflow-day { align-self:start; min-height:44px; border:0; border-radius:var(--radius-s); font:inherit; color:var(--brand); background:var(--surface); font-weight:700 }
@media(max-width:760px) {
  .month .cell {height:116px}
  .overflow-day {width:100%; padding:0; font-size:12px}
  .calendar-bar .period {order:1; width:100%; justify-content:start}
}
@media(min-width:761px) {
  .overflow-day {max-width:calc(100% - 44px); line-height:1.1}
  #app .rail {grid-row:1 / 3}
}
@media(max-width:760px) {
  .topbar .hdr-line {padding-right:0}
}

/* Stage 2 · hour grid (Day, Work week, Week) */
.grid-bar { display:flex; justify-content:flex-end; margin:0 0 8px }
.tgrid { --gw:58px; --cmin:0px; border:1px solid var(--line); border-radius:22px 22px 22px 8px; background:var(--surface); overflow:hidden; margin-top:10px }
.tgrid.tg-people { --cmin:150px }
.tg-scroll { overflow:auto; height:70vh; overscroll-behavior:contain; -webkit-overflow-scrolling:touch }
.tg-in { display:grid; grid-template-columns:var(--gw) repeat(var(--n), minmax(var(--cmin), 1fr)); min-width:100% }
.tg-corner,.tg-h { position:sticky; top:0; z-index:3; background:var(--surface); border-bottom:1px solid var(--line) }
.tg-corner { left:0; z-index:5; display:flex; align-items:flex-end; justify-content:flex-end; padding:0 6px 6px; color:var(--ink-3); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em }
.tg-h { display:flex; flex-direction:column; gap:3px; padding:6px 4px; border-left:1px solid var(--line-2); min-width:0; max-height:150px; overflow:auto }
.tg-h.today { background:var(--today) }
.tg-h .tag,.tg-h .wx { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100% }
.tg-dname { display:flex; align-items:baseline; gap:6px; border:0; background:transparent; font:inherit; color:var(--ink-2); font-weight:700; min-height:44px; padding:0 4px; border-radius:var(--radius-s); text-align:left }
.tg-dname b { font-family:var(--display); font-size:22px; color:var(--ink) }
.tg-h.today .tg-dname b { display:inline-grid; place-items:center; width:36px; height:36px; border-radius:50%; background:var(--brand); color:var(--brand-ink) }
.tg-person { display:flex; align-items:center; gap:8px; font-weight:700; min-height:40px; padding:0 4px; border-bottom:3px solid var(--c, var(--line)) }
.tg-person .h-av { width:30px; height:30px; flex:none }
.tg-pill { font-size:13px; font-weight:600; padding:4px 8px; border-radius:10px 10px 10px 4px; background:color-mix(in srgb,var(--c) 22%,var(--surface)); border:1.5px solid color-mix(in srgb,var(--c) 55%,var(--line)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; min-height:30px }
.tg-hours { position:sticky; left:0; z-index:2; background:var(--surface); height:calc(24 * var(--hh)); border-right:1px solid var(--line) }
.tg-hours span { position:absolute; right:6px; transform:translateY(-50%); font-size:12px; font-weight:600; color:var(--ink-3); white-space:nowrap }
.tg-col { position:relative; height:calc(24 * var(--hh)); border-left:1px solid var(--line-2); cursor:copy;
  background-image:linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(color-mix(in srgb,var(--line-2) 45%,transparent) 1px, transparent 1px);
  background-size:100% var(--hh), 100% var(--hh); background-position:0 0, 0 calc(var(--hh) / 2) }
.tg-col.today { background-color:color-mix(in srgb,var(--today) 45%,transparent) }
.tg-col:hover { background-color:color-mix(in srgb,var(--today) 30%,transparent) }
.tg-ev { position:absolute; z-index:1; box-sizing:border-box; overflow:hidden; padding:3px 6px; display:flex; flex-direction:column; gap:1px; cursor:pointer;
  font-size:13px; line-height:1.2; color:var(--ink); border-radius:12px 12px 12px 4px;
  background:color-mix(in srgb,var(--c) 24%,var(--surface)); border:1.5px solid color-mix(in srgb,var(--c) 60%,var(--line)); box-shadow:0 1px 2px #0000000f }
.tg-ev:hover { z-index:2; box-shadow:var(--shadow), 0 0 0 2px color-mix(in srgb,var(--c) 45%,transparent) }
.tg-ev .tg-t { font-weight:700; overflow:hidden; text-overflow:ellipsis }
.tg-ev small { color:var(--ink-2); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.tg-ev .faces { position:absolute; right:4px; bottom:3px }
.tg-ev .face { width:20px; height:20px; font-size:12px }
.tg-ev.short { flex-direction:row; align-items:center; gap:6px; padding-top:0; padding-bottom:0 }
.tg-ev.short .tg-t { white-space:nowrap }
.tg-ev.short .faces { display:none }
.tg-ev.conflict { border-color:var(--warn); background:var(--warn-bg) }
.tg-now { position:absolute; left:0; right:0; height:2px; background:var(--brand); z-index:3; pointer-events:none }
.tg-now::before { content:""; position:absolute; left:-6px; top:-5px; width:12px; height:12px; border-radius:50%; background:var(--brand) }
.qa .field { margin-bottom:12px }
.qa-who { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px }
@media (max-width:760px) {
  .tgrid { --gw:44px; margin-top:6px }
  .tgrid.tg-people { --cmin:120px }
  .tg-hours span { font-size:10.5px; right:4px }
  .tg-ev { font-size:11.5px; padding:2px 3px }
  .tgrid.tg-week .tg-ev small,.tgrid.tg-week .tg-ev .faces { display:none }
  .tgrid.tg-week .tg-h .wx { display:none }
  .tgrid.tg-week .tg-dname { flex-direction:column; align-items:center; gap:0; padding:0; width:100% }
  .tgrid.tg-week .tg-dname b { font-size:18px }
  .tgrid.tg-week .tg-h.today .tg-dname b { width:30px; height:30px }
  .tgrid.tg-week .tg-h { padding:4px 2px }
  .tgrid.tg-week .tg-h .tag,.tgrid.tg-week .tg-pill { font-size:10.5px; padding:2px 3px; min-height:0 }
}
@media print { .tg-scroll { height:auto !important; overflow:visible } }
.tg-ev { container-type:inline-size }
@container (max-width:90px) { .tg-ev .faces,.tg-ev small { display:none } .tg-ev .tg-t { text-overflow:clip } }
.seg button { white-space:nowrap }
.tg-h { overflow-x:hidden; overflow-y:auto; scrollbar-width:none }
.tg-h::-webkit-scrollbar { display:none }

/* Stage 3 · Undo button in toasts */
.toast { align-items: center; }
.toast .toast-act { margin-left: auto; background: none; border: 0; color: #9fe3b9; font: inherit; font-weight: 700; letter-spacing: .02em; padding: 0 10px; min-height: 44px; border-radius: 10px; cursor: pointer; }
.toast .toast-act:hover, .toast .toast-act:focus-visible { background: rgba(255,255,255,.12); }
.toast .toast-act + .x { margin-left: 0; }

/* Stage 3 step 2: swipe to the next/previous day, week or month slides the calendar in */
@keyframes mkc-swipe-next { from { opacity:.35; transform:translateX(36px) } to { opacity:1; transform:none } }
@keyframes mkc-swipe-prev { from { opacity:.35; transform:translateX(-36px) } to { opacity:1; transform:none } }
#main.swipe-next { animation:mkc-swipe-next .26s ease-out }
#main.swipe-prev { animation:mkc-swipe-prev .26s ease-out }
@media (prefers-reduced-motion: reduce) { #main.swipe-next, #main.swipe-prev { animation:none } }

/* Stage 3 step 3: calendar look settings (grid hours, hide weekends, week numbers, compact) */
.tg-hours,.tg-col { height:calc(var(--hrs, 24) * var(--hh)) }
.month.no-wkend { grid-template-columns:repeat(5, minmax(0, 1fr)) }
.cell-l { display:inline-flex; align-items:center; gap:6px; min-width:0 }
.wk-no { font-size:11px; font-weight:700; color:var(--ink-3); letter-spacing:.02em }
body.dense .ev { padding:8px 12px; gap:10px }
@media (min-width:761px) { body.dense .cell .ev-mini,body.dense .wcol .ev-mini { font-size:12px; line-height:1.15; padding-top:1px; padding-bottom:1px } }
body.dense .cell .tag { font-size:11.5px; padding-top:0; padding-bottom:0 }
body.dense .cell-dots { gap:2px }
body.dense .tg-ev { font-size:12px; padding:2px 5px }
body.dense .tg-hours span { font-size:11px }

/* Family setup tabs: never squash; on phones, a tidy 3-across grid with full names */
.tabs button { flex:none }
@media (max-width:760px) {
  .tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; overflow:visible }
  .tabs button { min-width:0; white-space:normal; line-height:1.15; padding:6px 8px; display:flex; align-items:center; justify-content:center; text-align:center }
}

/* ---------- Stage 3 step 4: keyboard shortcut list (press ?) ---------- */
.kbd-list { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:12px 0 0; align-items:center }
.kbd-list dt { margin:0; white-space:nowrap; color:var(--ink-2) }
.kbd-list dd { margin:0 }
.kbd-list kbd { display:inline-block; min-width:28px; padding:2px 8px; text-align:center; font:600 .95rem var(--font); color:var(--ink);
  background:var(--surface-2); border:1px solid var(--line); border-bottom-width:2px; border-radius:var(--radius-s) }

/* ---------- Stage 3 step 5: right-click menu on events (desktop) ---------- */
.ctx-menu { position:fixed; z-index:60; min-width:190px; max-width:280px; padding:6px; background:var(--surface); color:var(--ink);
  border:1px solid var(--line); border-radius:var(--radius) var(--radius) var(--radius) 5px; box-shadow:0 10px 28px #0002, var(--shadow) }
.ctx-menu .ctx-title { padding:6px 10px 6px; font-size:12px; font-weight:700; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border-bottom:1px solid var(--line); margin-bottom:4px }
.ctx-menu button { display:block; width:100%; text-align:left; background:none; border:0; font:inherit; color:inherit; padding:8px 10px; border-radius:9px; cursor:pointer }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background:var(--surface-2); outline:none }
.ctx-menu button.danger { color:var(--warn) }

/* ---------- Stage 3 step 6: print this week or month (clean paper copy for the fridge) ---------- */
.print-area { display:none }
.print-pick { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px }
.print-pick .btn { flex-direction:column; min-height:76px; font-size:17px; white-space:normal }
.print-pick small { display:block; font-size:13px; font-weight:500; opacity:.85 }
@media print {
  @page { size:landscape; margin:10mm }
  html, body { background:#fff !important; color:#1b1f1d !important; height:auto !important; overflow:visible !important }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact }
  body.printing > :not(.print-area) { display:none !important }
  body.printing .print-area { display:block; font-size:11pt }
  .print-head { display:flex; align-items:center; gap:10px; margin:0 0 8px; font-family:Lora, serif }
  .print-head .brand-mark { width:36px; height:36px; border-radius:11px 11px 11px 3px; display:grid; place-items:center; background:var(--brand); color:#fff }
  .print-head .brand-mark svg { width:22px; height:22px }
  .print-head b { font-size:18pt; color:var(--brand) }
  .print-head span:last-child { margin-left:auto; font-size:15pt; font-weight:600 }
  .print-foot { margin-top:6px; font-size:8pt; color:#666; text-align:right }
  .print-area .cell-add, .print-area .overflow-day, .print-area .wcol > .btn, .print-area .wx { display:none !important }
  .print-area .month, .print-area .week { gap:0; border:1px solid #9aa59f; background:#9aa59f; border-radius:8px; overflow:hidden; min-width:0; grid-template-columns:repeat(7, minmax(0, 1fr)) }
  .print-area .month.no-wkend, .print-area .week.workweek { grid-template-columns:repeat(5, minmax(0, 1fr)) }
  .print-area .cell, .print-area .wcol { background:#fff; box-shadow:none; border:0; outline:1px solid #c9d0cc; min-height:0; padding:4px 5px; gap:2px; break-inside:avoid; opacity:1 }
  .print-area .cell, .print-area .month .cell { height:auto; min-height:30mm; padding-bottom:4px }
  .print-area .ev-mini { flex:none }
  .print-area .wcol { min-height:150mm }
  .print-area .cell.other { background:#f3f5f4; color:#777 }
  .print-area .cell.today, .print-area .wcol.today { background:#fff; box-shadow:inset 0 3px var(--brand) }
  .print-area .cell-num { font-size:11pt }
  .print-area .wcol h3 b { font-size:16pt }
  .print-area .dow-h { font-size:9pt; font-weight:700; text-align:center; background:#eef3f0; padding:3px 0; color:#333 }
  .print-area .month .cell-dots, .print-area .cell-dots { display:flex; flex:0 0 auto; flex-direction:column; flex-wrap:nowrap; gap:2px; overflow:visible; max-height:none; min-height:0 }
  .print-area .ev-mini, .print-area .cell .ev-mini { display:flex; width:auto; height:auto; font-size:8.5pt; line-height:1.2; padding:1px 4px; white-space:normal; border:0; border-left:3px solid var(--c); border-radius:4px;
    background:color-mix(in srgb, var(--c) 16%, #fff) !important; color:#1b1f1d }
  .print-area .wcol .ev-mini { font-size:9.5pt; padding:4px 5px }
  .print-area .ev-mini span, .print-area .cell .ev-mini span { display:inline; overflow:visible; white-space:normal; text-overflow:clip }
  .print-area .cell .tag, .print-area .tag { display:inline-block; font-size:8pt; padding:0 5px; white-space:normal }
  .print-area .face { width:16px; height:16px; font-size:9px }
}

/* ===== Stage 3 step 7: Gmail-style Inbox (InboxView in app.js) ===== */
.ibx-count { font-family:var(--font); font-size:.8rem; font-weight:700; background:var(--brand); color:var(--brand-ink); border-radius:999px; padding:2px 9px; vertical-align:middle; margin-left:6px }
.ibx-list { display:flex; flex-direction:column; border:1px solid var(--line-2); border-radius:var(--radius); overflow:hidden; background:var(--surface) }
.ibx-row { display:flex; align-items:center; gap:12px; width:100%; min-height:64px; padding:10px 14px; text-align:left; background:var(--surface-2); color:var(--ink-2); border:0; border-bottom:1px solid var(--line-2); cursor:pointer; font:inherit }
.ibx-row:last-child { border-bottom:0 }
.ibx-row:hover { background:var(--today) }
.ibx-row:focus-visible { outline:2px solid var(--brand); outline-offset:-2px }
.ibx-row.unread { background:var(--surface); color:var(--ink); box-shadow:inset 3px 0 var(--brand) }
.ibx-row.unread .ibx-from, .ibx-row.unread .ibx-subj, .ibx-row.unread .ibx-time { font-weight:700; color:var(--ink) }
.ibx-av { flex:none; width:38px; height:38px; display:grid; place-items:center; border-radius:13px 13px 13px 4px; background:var(--c, var(--brand)); color:var(--brand-ink); font-weight:700; font-size:1.05rem; overflow:hidden }
.ibx-av img { width:100%; height:100%; object-fit:cover }
.ibx-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px }
.ibx-top { display:flex; align-items:baseline; gap:8px }
.ibx-from { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500 }
.ibx-time { flex:none; font-size:.85rem; color:var(--ink-3) }
.ibx-line { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.93rem }
.ibx-prev { color:var(--ink-3); font-weight:400 }
.ibx-back { font-weight:600; margin-right:auto }
.ibx-who .grow { flex:1; min-width:0 }
.ibx-open .ibx-h { font-family:var(--display); font-size:1.35rem; margin:0 0 12px; color:var(--ink) }
.ibx-who { display:flex; align-items:center; gap:12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line-2) }
.ibx-sec { margin:0 0 12px; line-height:1.5 }
.ibx-quote { margin:0 0 12px; padding:8px 12px; border-left:3px solid var(--brand); background:var(--surface-2); border-radius:0 var(--radius-s) var(--radius-s) 0; color:var(--ink-2) }
.ibx-btns { margin-top:16px }
.ibx-btns .btn { min-height:44px; min-width:110px }

/* ---------- Themes (settings.theme → html[data-skin]); each keeps light colors ---------- */
.theme-pick { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px }
.theme-tile { display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:8px 8px 10px; border:2px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--ink); font:inherit; text-align:left; cursor:pointer; min-height:44px }
.theme-tile b { font-size:15px }
.theme-tile small { font-size:12.5px; color:var(--ink-2); line-height:1.25 }
.theme-tile[aria-checked="true"] { border-color:var(--brand); box-shadow:0 0 0 2px var(--brand) inset }
.theme-sw { display:block; width:100%; height:44px; border-radius:10px; margin-bottom:4px; border:1px solid #0002 }
.sw-steel { background:radial-gradient(#7c858c 1px,transparent 1.5px) 0 0/7px 9px,radial-gradient(#b9bec2 1px,transparent 1.5px) 3px 4px/9px 7px,linear-gradient(90deg,#4a5761 0 30%,#eceeef 30%) }
.sw-country { background:repeating-linear-gradient(0deg,#8e2f2514 0 6px,transparent 6px 12px),repeating-linear-gradient(90deg,#8e2f2514 0 6px,transparent 6px 12px),linear-gradient(90deg,#8e2f25 0 30%,#f3ead8 30%) }
.sw-beach { background:linear-gradient(90deg,#0f6e7e 0 30%,transparent 30%),linear-gradient(180deg,#bfe6e4,#f4ecdc) }

:root[data-skin="steel"] {
  --bg:#e9ebec; --surface:#fbfcfc; --surface-2:#eef0f1; --ink:#1f2529; --ink-2:#4b545a; --ink-3:#5a636a;
  --line:#c2c8cc; --line-2:#dce0e3; --brand:#3f4c56; --brand-ink:#ffffff; --accent:#566672;
  --today:#e1e7ec; --off:#e6e8e9; --chip:#e3e6e9; --ok:#3b6e52; --shadow:0 2px 6px #1d262c14; color-scheme:light;
}
:root[data-skin="steel"] body {
  background:
    radial-gradient(circle at 23% 31%,#4f585f66 0 1px,transparent 1.6px) 0 0/37px 41px,
    radial-gradient(circle at 71% 64%,#6d767d55 0 1.4px,transparent 2px) 0 0/53px 47px,
    radial-gradient(circle at 42% 88%,#8a929866 0 .9px,transparent 1.4px) 0 0/29px 31px,
    radial-gradient(circle at 88% 12%,#3e464c55 0 1.8px,transparent 2.4px) 0 0/71px 67px,
    radial-gradient(circle at 12% 77%,#ffffffcc 0 1.2px,transparent 1.8px) 0 0/43px 37px,
    radial-gradient(circle at 57% 18%,#a7aeb366 0 2.2px,transparent 3px) 0 0/83px 79px,
    radial-gradient(ellipse 60% 40% at 30% 20%,#c9ced233,transparent),
    radial-gradient(ellipse 50% 50% at 80% 70%,#d4d8db44,transparent),
    #e7e9ea;
}
:root[data-skin="steel"] .topbar, :root[data-skin="steel"] .rail {
  background: repeating-linear-gradient(90deg,#ffffff40 0 1px,transparent 1px 3px), linear-gradient(180deg,#f7f8f9,#dfe3e6 55%,#eef0f2);
}
:root[data-skin="steel"] .rail { background: repeating-linear-gradient(180deg,#ffffff40 0 1px,transparent 1px 3px), linear-gradient(90deg,#f7f8f9,#dfe3e6 55%,#eef0f2); }
:root[data-skin="steel"] .fab, :root[data-skin="steel"] .rail-btn.rail-add, :root[data-skin="steel"] .btn.primary {
  background: linear-gradient(180deg,#6a7781,#3f4c56 55%,#33404a); border-color:#2d3943;
}

:root[data-skin="country"] {
  --bg:#f3ead8; --surface:#fffaf0; --surface-2:#f7eedc; --ink:#3a2a1e; --ink-2:#664f3e; --ink-3:#725c4b;
  --line:#d6c2a2; --line-2:#e9dabf; --brand:#8e2f25; --brand-ink:#ffffff; --accent:#5f6d2f;
  --today:#f6e1c1; --off:#ede2cd; --chip:#eee0c6; --ok:#5a6f2e; --shadow:0 2px 6px #4a2e1414;
  --caution-bg:#fbe8c0; color-scheme:light;
}
:root[data-skin="country"] body {
  background:
    repeating-linear-gradient(0deg,#8e2f250b 0 14px,transparent 14px 28px),
    repeating-linear-gradient(90deg,#8e2f250b 0 14px,transparent 14px 28px),
    #f3ead8;
}
:root[data-skin="country"] .topbar {
  background: repeating-linear-gradient(180deg,transparent 0 22px,#6b4a2c1a 22px 23px), linear-gradient(90deg,#f1dfc0,#ead3ad 40%,#f0dcb9 70%,#e8cfa6);
  border-top-color:#8e2f25;
}
:root[data-skin="country"] .rail { background: repeating-linear-gradient(90deg,transparent 0 30px,#6b4a2c1a 30px 31px), linear-gradient(180deg,#f1dfc0,#e8cfa6); }

:root[data-skin="beach"] {
  --bg:#f4ecdc; --surface:#fffdf8; --surface-2:#eef6f5; --ink:#12343b; --ink-2:#3c5c63; --ink-3:#4b6a70;
  --line:#c0d5d5; --line-2:#dbe8e7; --brand:#0f6e7e; --brand-ink:#ffffff; --accent:#2a7f86;
  --today:#dcf0ee; --off:#ece6d8; --chip:#dfeeec; --ok:#2f7a5e; --shadow:0 2px 6px #0f3a4214; color-scheme:light;
}
:root[data-skin="beach"] body {
  background:
    radial-gradient(#c9b48a33 1px,transparent 1.5px) 0 0/9px 11px,
    linear-gradient(180deg,#cfeceb 0,#eef1e4 280px,#f1e6cf 600px) fixed,
    #f1e6cf;
}
:root[data-skin="beach"] .topbar {
  background: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 120 12%27%3E%3Cpath d=%27M0 8 Q15 2 30 8 T60 8 T90 8 T120 8 V12 H0z%27 fill=%27%237cc6c6%27 opacity=%27.35%27/%3E%3Cpath d=%27M0 10 Q15 5 30 10 T60 10 T90 10 T120 10 V12 H0z%27 fill=%27%23e9d3a6%27 opacity=%27.6%27/%3E%3C/svg%3E") bottom left/120px 12px repeat-x, linear-gradient(180deg,#d9f0ef,#f7faf4);
  border-top-color:#0f6e7e;
}
:root[data-skin="beach"] .rail { background: linear-gradient(180deg,#d4eeee,#f4ecdc); }
:root[data-skin="beach"] .fab, :root[data-skin="beach"] .rail-btn.rail-add { background: linear-gradient(160deg,#1a8b9b,#0f6e7e 60%,#0b5a68); }

/* Bright welcome screen (2026-11-22): always light, soft color blobs, our green + calendar mark */
.overlay.welcome { background: linear-gradient(160deg, #ffffff 0%, #f1faf4 45%, #eaf3ff 100%); color: #1d3128; color-scheme: light; position: fixed; overflow: auto; isolation: isolate; }
.wc-blob { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: -1; pointer-events: none; }
.wc-blob.b1 { width: 420px; height: 420px; background: #bfe9cf; top: -120px; left: -100px; }
.wc-blob.b2 { width: 360px; height: 360px; background: #cfe0ff; bottom: -120px; right: -80px; }
.wc-blob.b3 { width: 260px; height: 260px; background: #ffe2c7; top: 40%; right: 12%; opacity: .45; }
.welcome .welcome-card { background: rgba(255,255,255,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(33,87,67,.10); border-top: 0; border-radius: 28px; padding: 40px 36px 30px; max-width: 600px; width: 100%; box-shadow: 0 24px 60px -20px rgba(31,58,95,.25), 0 2px 8px rgba(31,58,95,.06); }
.wc-mark { width: 84px; height: 84px; margin: 0 auto; display: grid; place-items: center; border-radius: 26px 26px 26px 8px; background: linear-gradient(145deg, #34a06e, #215743); color: #fff; box-shadow: 0 12px 28px -8px rgba(33,87,67,.55); }
.wc-mark .glyph { width: 46px; height: 46px; }
.wc-dots { display: flex; justify-content: center; gap: 7px; margin: 16px 0 4px; }
.wc-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.welcome .welcome-card h1 { font-size: clamp(30px, 6vw, 40px); margin: 8px 0 10px; color: #16342a; }
.wc-lead { color: #4b5d55 !important; font-size: 18px !important; line-height: 1.45; max-width: 460px; margin: 0 auto; }
.wc-feats { list-style: none; padding: 0; margin: 22px 0 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wc-feats li { display: flex; align-items: center; gap: 7px; padding: 7px 14px 7px 9px; border-radius: 999px; font-size: 15px; font-weight: 600; color: #1d3128; background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); }
.wc-feats .glyph { width: 20px; height: 20px; color: var(--c); }
.wc-btns { display: flex; flex-direction: column; gap: 10px; margin: 24px auto 0; max-width: 340px; }
.welcome .wc-btns .btn { min-height: 52px; border-radius: 999px; font-size: 17px; font-weight: 700; background: #fff; color: #215743; border: 1.5px solid #cfe3d7; box-shadow: none; }
.welcome .wc-btns .btn:hover { background: #f1faf4; }
.welcome .wc-btns .btn.primary { background: linear-gradient(135deg, #34a06e, #215743); color: #fff; border: 0; box-shadow: 0 10px 22px -8px rgba(33,87,67,.6); }
.welcome .wc-btns .btn.primary:hover { filter: brightness(1.06); }
.wc-small { color: #6a7a72 !important; font-size: 14px !important; margin-top: 20px; }
@media (max-width: 520px) { .welcome .welcome-card { padding: 30px 20px 22px; border-radius: 24px; } .wc-lead { font-size: 16px !important; } }
.wc-mark .glyph, .welcome .wc-mark svg { color: #fff; stroke: #fff; }
.wc-blob { opacity: .8; } .wc-blob.b3 { opacity: .7; }
/* Welcome screen in sage green (Jim, 2026-11-22) */
.overlay.welcome { background: linear-gradient(160deg, #ffffff 0%, #f3f7ef 45%, #eef4f8 100%); }
.wc-blob.b1 { background: #d6e4cc; }
.wc-mark { background: linear-gradient(145deg, #93ad88, #5f8266); box-shadow: 0 12px 28px -8px rgba(95,130,102,.55); }
.welcome .welcome-card h1 { color: #34493b; }
.welcome .wc-btns .btn { color: #4d6b55; border-color: #d5e1cf; }
.welcome .wc-btns .btn:hover { background: #f3f7ef; }
.welcome .wc-btns .btn.primary { background: linear-gradient(135deg, #87a37c, #557a5f); color: #fff; box-shadow: 0 10px 22px -8px rgba(85,122,95,.6); }

/* Icon bar stays put and always fits: pinned to the left edge, buttons shrink on short screens so none get cut off */
@media (min-width: 761px) {
  #app .rail { position: fixed; top: 0; bottom: 0; left: env(safe-area-inset-left); width: 92px; height: auto; padding: calc(clamp(6px, 1.6dvh, 14px) + env(safe-area-inset-top)) 8px calc(clamp(6px, 1.6dvh, 14px) + env(safe-area-inset-bottom)); gap: clamp(2px, .7dvh, 6px); }
  .rail-btn { min-height: clamp(40px, 7.4dvh, 64px); padding: clamp(3px, .9dvh, 8px) 4px; gap: clamp(1px, .35dvh, 3px); }
  .rail-btn .glyph { width: clamp(20px, 3.2dvh, 26px); height: clamp(20px, 3.2dvh, 26px); }
  .rail-btn.rail-add { width: clamp(42px, 7dvh, 60px); height: clamp(42px, 7dvh, 60px); min-height: 0; margin: clamp(1px, .4dvh, 4px) 0; }
  .rail-btn.rail-add .glyph { width: clamp(24px, 3.6dvh, 30px); height: clamp(24px, 3.6dvh, 30px); }
}
@media (min-width: 761px) and (max-height: 620px) { .rail-btn { font-size: 11px; } }
@media (min-width: 761px) and (max-height: 520px) { .rail-btn > span:not(.badge-dot) { display: none; } .rail-btn { justify-content: center; } }

/* ===== Six rustic themes (2026-11-22): Medieval Hall, Log Cabin, Lake House, Stone Hearth, Wine Cellar, Snowy Pines =====
   CSS-only textures (no image files). Cards stay light so event titles stay easy to read. */
.sw-medieval { background:radial-gradient(circle,#55504c 0 1.6px,#1b1918 2px 2.6px,transparent 3px) 4px 9px/14px 22px,linear-gradient(180deg,transparent 0 7px,#2a2725 7px 11px,transparent 11px 29px,#2a2725 29px 33px,transparent 33px),repeating-linear-gradient(90deg,transparent 0 13px,#00000033 13px 14px),linear-gradient(90deg,#8a5a34,#a8774a 50%,#7e5230) }
.sw-cabin { background:linear-gradient(90deg,#a8322a 0 30%,transparent 30%),repeating-linear-gradient(180deg,#e0a75a 0,#c98a3f 6px,#9c6428 10px,#7a4a1c 11px) }
.sw-lake { background:linear-gradient(90deg,#3e5f73 0 30%,transparent 30%),repeating-linear-gradient(90deg,#c9d3d6 0 15px,#a9b6bb 15px 16px) }
.sw-hearth { background:linear-gradient(90deg,#a14a1f 0 30%,transparent 30%),radial-gradient(ellipse 9px 6px at 30% 40%,#b8ab98 90%,transparent) 0 0/22px 16px,radial-gradient(ellipse 8px 6px at 70% 80%,#cfc3b0 90%,transparent) 0 0/20px 14px,#e4dccf }
.sw-cellar { background:linear-gradient(90deg,#6e2236 0 30%,transparent 30%),linear-gradient(180deg,transparent 0 16px,#3a3433 16px 20px,transparent 20px),repeating-linear-gradient(90deg,#c9a074 0 12px,#8e623d 12px 14px) }
.sw-pines { background:linear-gradient(90deg,#b32b3a 0 30%,transparent 30%),conic-gradient(from 150deg at 50% 30%,#23503d 0 60deg,transparent 60deg) 0 8px/18px 40px,linear-gradient(180deg,#f7fafc,#e4edf2) }

/* 1. Medieval Hall: dark-oak planks held by black wrought-iron straps and rivets; ember accent */
:root[data-skin="medieval"] {
  --bg:#c9ae86; --surface:#fbf5e8; --surface-2:#f2e7d1; --ink:#2a1f17; --ink-2:#4f3d2f; --ink-3:#5e4a39;
  --line:#b49a76; --line-2:#e0cfb2; --brand:#2b2826; --brand-ink:#f6ecd8; --accent:#8a2b1c;
  --today:#f0dcb6; --off:#e8dcc4; --chip:#eadcc2; --ok:#4c6b2f; --shadow:0 3px 8px #2a1a0e2e; --caution-bg:#f6e2b8; color-scheme:light;
}
:root[data-skin="medieval"] body {
  background:
    repeating-linear-gradient(90deg,transparent 0 158px,#3a24123d 158px 160px,#ffffff1a 160px 161px,transparent 161px 320px),
    repeating-linear-gradient(91deg,transparent 0 7px,#6b44221a 7px 8px,transparent 8px 19px,#5a38190f 19px 21px),
    repeating-linear-gradient(89deg,transparent 0 31px,#7d522b14 31px 33px),
    linear-gradient(90deg,#c19f72,#cdb289 18%,#bf9d70 36%,#cfb48c 55%,#c3a275 74%,#cdb088),
    #c9ae86;
}
:root[data-skin="medieval"] .topbar {
  background:
    radial-gradient(circle,#55504c 0 2.2px,#1b1918 2.6px 3.4px,transparent 3.8px) 22px 0/120px 10px repeat-x,
    radial-gradient(circle,#55504c 0 2.2px,#1b1918 2.6px 3.4px,transparent 3.8px) 22px 100%/120px 10px repeat-x,
    linear-gradient(180deg,#2b2826 0 4px,transparent 4px calc(100% - 4px),#2b2826 calc(100% - 4px)),
    repeating-linear-gradient(90deg,transparent 0 9px,#6b44221c 9px 10px,transparent 10px 23px),
    linear-gradient(180deg,#e9d7b4,#dcc49b 60%,#e4cfa8);
  border-top:4px solid #1b1918; border-bottom:2px solid #1b1918;
}
:root[data-skin="medieval"] .rail {
  background:
    radial-gradient(circle,#55504c 0 2.2px,#1b1918 2.6px 3.4px,transparent 3.8px) 0 30px/10px 140px repeat-y,
    radial-gradient(circle,#55504c 0 2.2px,#1b1918 2.6px 3.4px,transparent 3.8px) 100% 30px/10px 140px repeat-y,
    linear-gradient(90deg,#2b2826 0 4px,transparent 4px calc(100% - 4px),#2b2826 calc(100% - 4px)),
    repeating-linear-gradient(180deg,transparent 0 11px,#6b44221c 11px 12px),
    linear-gradient(90deg,#e4cfa8,#dcc49b 55%,#e9d7b4);
}
:root[data-skin="medieval"] .fab, :root[data-skin="medieval"] .rail-btn.rail-add, :root[data-skin="medieval"] .btn.primary {
  background: radial-gradient(circle at 30% 25%,#ffffff22,transparent 45%), linear-gradient(180deg,#4a4542,#2b2826 55%,#191716); border-color:#0f0e0d; color:#f6ecd8;
}
:root[data-skin="medieval"] .fab { box-shadow: 0 0 0 3px #8a6a3e, 0 6px 14px #1b120a66; }

/* 2. Log Cabin: round honey logs, red-and-black buffalo plaid, firelight glow */
:root[data-skin="cabin"] {
  --bg:#efdcbc; --surface:#fffaf1; --surface-2:#f8ecd6; --ink:#33210f; --ink-2:#5e4128; --ink-3:#6c4d33;
  --line:#d4b68c; --line-2:#ecd9b9; --brand:#7a3d16; --brand-ink:#ffffff; --accent:#a8322a;
  --today:#fbe2b5; --off:#f0e2c8; --chip:#f1e0c2; --ok:#466b34; --shadow:0 3px 8px #4a2a0e24; --caution-bg:#fbe5b8; color-scheme:light;
}
:root[data-skin="cabin"] body {
  background:
    radial-gradient(ellipse 70% 45% at 50% 105%,#ffb45a33,transparent 70%) fixed,
    repeating-linear-gradient(180deg,#f3e2c4 0,#ecd5ae 30px,#dfc192 40px,#c9a26c 43px,#f0dcb8 44px,#f3e2c4 46px),
    #efdcbc;
}
:root[data-skin="cabin"] .topbar {
  background:
    linear-gradient(90deg,#a8322a 0 50%,#1f1a17 50%) 0 0/16px 4px repeat-x,
    repeating-linear-gradient(180deg,#f9e7c2 0,#efcd92 12px,#d9a560 17px,#a8743a 19px,#f9e7c2 20px);
  border-top:0; padding-top:16px;
}
:root[data-skin="cabin"] .rail {
  background:
    linear-gradient(90deg,#a8322a1f 0 50%,transparent 50%) 0 0/18px 18px,
    linear-gradient(180deg,#1f1a171a 0 50%,transparent 50%) 0 0/18px 18px,
    linear-gradient(180deg,#f6e4cc,#eed6b6);
}
:root[data-skin="cabin"] .fab, :root[data-skin="cabin"] .rail-btn.rail-add, :root[data-skin="cabin"] .btn.primary {
  background: linear-gradient(180deg,#a5602c,#7a3d16 55%,#5e2d0f); border-color:#4a230b;
}
:root[data-skin="cabin"] .fab { box-shadow: 0 0 0 3px #f6dfb0, 0 6px 16px #a8322a55; }

/* 3. Lake House: weathered grey-blue dock boards, misty water, pine green, canoe red */
:root[data-skin="lake"] {
  --bg:#dfe6e8; --surface:#fbfcfc; --surface-2:#eef3f4; --ink:#1b2a33; --ink-2:#425561; --ink-3:#51636e;
  --line:#b5c3c9; --line-2:#d8e1e4; --brand:#3e5f73; --brand-ink:#ffffff; --accent:#b4432f;
  --today:#dcebf0; --off:#e6ebec; --chip:#e1e9ec; --ok:#2f6a4c; --shadow:0 2px 7px #1b2a331c; color-scheme:light;
}
:root[data-skin="lake"] body {
  background:
    repeating-linear-gradient(90deg,transparent 0 118px,#6f80883a 118px 120px,transparent 120px 240px),
    repeating-linear-gradient(90deg,transparent 0 13px,#8a9aa10f 13px 14px,transparent 14px 37px,#ffffff2a 37px 38px),
    linear-gradient(180deg,#e9eff1 0,#dfe6e8 300px,#d9e1e3),
    #dfe6e8;
}
:root[data-skin="lake"] .topbar {
  background:
    conic-gradient(from 155deg at 50% 0,#2f5a4b4d 0 50deg,transparent 50deg) 0 100%/26px 18px repeat-x,
    conic-gradient(from 155deg at 50% 0,#2f5a4b2a 0 50deg,transparent 50deg) 13px 100%/34px 24px repeat-x,
    linear-gradient(180deg,#f1f5f6,#dbe6ea 60%,#cddbe1);
  border-top-color:#3e5f73;
}
:root[data-skin="lake"] .rail { background: repeating-linear-gradient(180deg,transparent 0 46px,#6f808833 46px 48px), linear-gradient(90deg,#e4ebed,#d4dfe3); }
:root[data-skin="lake"] .fab, :root[data-skin="lake"] .rail-btn.rail-add { background: linear-gradient(160deg,#c9573f,#b4432f 55%,#8f3222); border-color:#7a2a1c; }
:root[data-skin="lake"] .btn.primary { background: linear-gradient(180deg,#527589,#3e5f73 55%,#324f61); border-color:#2b4555; }

/* 4. Stone Hearth: river-rock fieldstone, oatmeal mortar, ember-orange fire */
:root[data-skin="hearth"] {
  --bg:#e4dccf; --surface:#fdfbf7; --surface-2:#f3eee5; --ink:#2b241e; --ink-2:#564b41; --ink-3:#655a4f;
  --line:#c7bba8; --line-2:#e2d9cb; --brand:#a14a1f; --brand-ink:#ffffff; --accent:#5d6b4a;
  --today:#f6e1cf; --off:#ebe4d8; --chip:#ece4d6; --ok:#4f6a3a; --shadow:0 2px 7px #2b241e1f; --caution-bg:#f8e3c4; color-scheme:light;
}
:root[data-skin="hearth"] body {
  background:
    radial-gradient(ellipse 26px 17px at 30% 35%,#cfc3b0 92%,transparent 100%) 0 0/68px 46px,
    radial-gradient(ellipse 22px 15px at 70% 75%,#d9cebd 92%,transparent 100%) 0 0/62px 42px,
    radial-gradient(ellipse 18px 12px at 15% 85%,#c7baa5 92%,transparent 100%) 11px 7px/54px 50px,
    #e4dccf;
}
:root[data-skin="hearth"] .topbar {
  background: radial-gradient(ellipse 60% 120% at 50% 130%,#e8873a33,transparent 70%), linear-gradient(180deg,#f3ede3,#e3d9c9);
  border-top-color:#a14a1f;
}
:root[data-skin="hearth"] .rail { background: radial-gradient(ellipse 120% 40% at 50% 100%,#e8873a2a,transparent 70%), linear-gradient(90deg,#eee7dc,#e1d7c7); }
:root[data-skin="hearth"] .fab, :root[data-skin="hearth"] .rail-btn.rail-add, :root[data-skin="hearth"] .btn.primary {
  background: linear-gradient(180deg,#c4632c,#a14a1f 55%,#843a16); border-color:#6f3011;
}
:root[data-skin="hearth"] .fab { box-shadow: 0 6px 18px #e8873a66; }

/* 5. Wine Cellar: oak barrel staves with dark iron hoops, cork, deep burgundy */
:root[data-skin="cellar"] {
  --bg:#e6d6c2; --surface:#fdf9f4; --surface-2:#f4ebe0; --ink:#2c1a1c; --ink-2:#583c3e; --ink-3:#664a4b;
  --line:#ccb39a; --line-2:#e6d7c6; --brand:#6e2236; --brand-ink:#ffffff; --accent:#8a6a2c;
  --today:#f3dfd6; --off:#ece1d3; --chip:#eee0d0; --ok:#4f6a34; --shadow:0 2px 7px #2c1a1c22; color-scheme:light;
}
:root[data-skin="cellar"] body {
  background:
    radial-gradient(#a0805a26 1px,transparent 1.6px) 0 0/6px 7px,
    radial-gradient(#7a5a3a1f 1.2px,transparent 1.8px) 3px 4px/9px 8px,
    linear-gradient(180deg,#eadcc9,#e2d0b9),
    #e6d6c2;
}
:root[data-skin="cellar"] .topbar {
  background:
    linear-gradient(180deg,transparent 0 5px,#3a3433 5px 9px,transparent 9px calc(100% - 9px),#3a3433 calc(100% - 9px) calc(100% - 5px),transparent calc(100% - 5px)),
    repeating-linear-gradient(90deg,#efdcc0 0,#e6cca8 34px,#c9a378 38px,#efdcc0 40px);
  border-top-color:#6e2236;
}
:root[data-skin="cellar"] .rail { background: linear-gradient(90deg,transparent 0 5px,#3a3433 5px 8px,transparent 8px calc(100% - 8px),#3a3433 calc(100% - 8px) calc(100% - 5px),transparent calc(100% - 5px)), repeating-linear-gradient(180deg,#f0dfc6 0,#e6cfad 36px,#c9a378 40px,#f0dfc6 42px); }
:root[data-skin="cellar"] .fab, :root[data-skin="cellar"] .rail-btn.rail-add, :root[data-skin="cellar"] .btn.primary {
  background: linear-gradient(180deg,#8e3149,#6e2236 55%,#561a2a); border-color:#45131f;
}

/* 6. Snowy Pines: winter cabin morning, fresh snow, evergreen, cranberry */
:root[data-skin="pines"] {
  --bg:#eef3f6; --surface:#ffffff; --surface-2:#f2f6f8; --ink:#1a2a24; --ink-2:#3f534b; --ink-3:#4e6159;
  --line:#c3d0d6; --line-2:#dfe7eb; --brand:#23503d; --brand-ink:#ffffff; --accent:#b32b3a;
  --today:#e3f0ea; --off:#e9eef1; --chip:#e4ecef; --ok:#2f6a48; --shadow:0 2px 7px #1a2a2418; color-scheme:light;
}
:root[data-skin="pines"] body {
  background:
    radial-gradient(circle,#ffffff 0 1.6px,transparent 2.2px) 0 0/31px 37px,
    radial-gradient(circle,#ffffffdd 0 1.1px,transparent 1.6px) 13px 19px/23px 29px,
    radial-gradient(circle,#c9d9e2 0 1px,transparent 1.5px) 7px 4px/41px 43px,
    linear-gradient(180deg,#e2ecf2 0,#eef3f6 320px),
    #eef3f6;
}
:root[data-skin="pines"] .topbar {
  background:
    conic-gradient(from 155deg at 50% 0,#23503d55 0 50deg,transparent 50deg) 0 100%/22px 20px repeat-x,
    conic-gradient(from 155deg at 50% 0,#2f6a4833 0 50deg,transparent 50deg) 11px 100%/30px 26px repeat-x,
    linear-gradient(180deg,#ffffff,#e9f1f5);
  border-top-color:#23503d;
}
:root[data-skin="pines"] .rail { background: radial-gradient(circle,#ffffff 0 1.4px,transparent 2px) 0 0/19px 23px, linear-gradient(90deg,#e6eef2,#d9e5eb); }
:root[data-skin="pines"] .fab, :root[data-skin="pines"] .rail-btn.rail-add { background: linear-gradient(160deg,#c93a4a,#b32b3a 55%,#8f1f2c); border-color:#7a1a25; }
:root[data-skin="pines"] .btn.primary { background: linear-gradient(180deg,#2f6a51,#23503d 55%,#1a3f30); border-color:#163528; }

/* "✓ Saved" flash after pressing Save (savedFlash() in views.js) */
.saved-flash { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(0,0,0,.12); animation: sfIn .18s ease-out; transition: opacity .3s; }
.saved-flash.out { opacity: 0; }
.saved-flash .sf-card { display: grid; justify-items: center; gap: 6px; min-width: 200px; max-width: min(320px, calc(100vw - 32px)); padding: 22px 28px; border-radius: 22px; background: #fff; color: #1d2a24; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.28); animation: sfPop .28s cubic-bezier(.2,1.4,.4,1); }
.saved-flash .sf-check { width: 56px; height: 56px; padding: 10px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); stroke: currentColor; stroke-width: 3; fill: none; }
.saved-flash b { font-size: 20px; }
.saved-flash small { font-size: 14px; opacity: .75; }
@keyframes sfIn { from { opacity: 0; } }
@keyframes sfPop { from { transform: scale(.7); opacity: 0; } }

/* Phone icon bar (2026-11-22): the tablet icon bar becomes a row along the bottom on phones.
   Add stays the round + button; Sitter and Privacy stay in the Home sheet (More). */
@media (max-width: 760px) {
  #app .rail { display: flex; flex-direction: row; align-items: stretch; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; z-index: 7;
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0, 0, 0, .08); }
  .rail-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 6px 2px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
  .rail-btn .glyph { width: 24px; height: 24px; }
  .rail-btn:active { background: var(--surface-2); color: var(--ink); }
  .rail-btn > span:not(.badge-dot) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .rail-btn .badge-dot { top: 2px; right: calc(50% - 22px); }
  .rail-btn[hidden], .rail-btn.rail-add, .rail [data-action="sitter"], .rail [data-action="privacy"], .rail-gap { display: none; }
  /* the bar has Settings and More, so the top row drops its ☰ and ⚙ */
  .calendar-bar .phone-home, .calendar-bar [data-action="settings"] { display: none; }
  /* keep the + button, messages and page bottom clear of the bar */
  .fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
}
@media print { #app .rail { display: none !important; } }

/* Big emoji picker (emojiPicker() at end of views.js) */
.emoji-pick.ep { display: block; border: 1px solid var(--line, #ddd); border-radius: 12px; background: var(--surface, #fff); overflow: hidden; }
.ep-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 4px; border-bottom: 1px solid var(--line, #ddd); background: var(--surface-2); scrollbar-width: none; }
.ep-tabs::-webkit-scrollbar { display: none; }
.emoji-pick.ep .ep-tab { flex: 0 0 auto; width: 40px; height: 38px; font-size: 20px; border-radius: 8px; background: transparent; border: 2px solid transparent; }
.emoji-pick.ep .ep-tab.cur { background: var(--surface, #fff); border-color: var(--brand); }
.ep-grid { position: relative; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.ep-h { flex: 0 0 100%; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 6px 2px 0; }
.emoji-pick.ep .ep-grid button[hidden] { display: none; }
.ep-own { padding: 6px; border-top: 1px solid var(--line, #ddd); }
.ep-own input { width: 100%; }

/* ---------- Custom repeat (every N days/weeks/months/years, pick weekdays) ---------- */
.rep-box { margin: 4px 0 12px; display: grid; gap: 8px; }
.rep-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.rep-row input[type=number] { width: 4.5em; text-align: center; }
.rep-row select { width: auto; min-width: 7em; }
.rep-lbl { font-size: .85rem; opacity: .8; margin-top: 2px; }
.rep-days { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-day { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.rep-day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rep-box .opt-row { margin: 0; }
.rep-sum { font-weight: 600; }

/* Person photo editor: take a photo, choose one, use the Google photo, or remove it (Family setup > person). */
.ph-edit { align-items:flex-start }
.ph-prev { width:72px; height:72px; border-radius:50%; flex:none; overflow:hidden; display:grid; place-items:center;
  background:color-mix(in srgb, var(--c, #888) 18%, #fff); border:3px solid var(--c, var(--line)) }
.ph-prev .avatar-photo { border-radius:50% }
.ph-prev .ph-em { font-size:38px; line-height:1 }
.ph-btns { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px }
.btn.ph-btn { min-height:40px; padding:8px 12px; font-size:14px; cursor:pointer; border:1px solid var(--line); border-radius:999px; background:var(--card, #fff) }
.btn.ph-btn[hidden], .ph-edit .check[hidden] { display:none }
.ph-edit .check { margin-top:6px }

/* Welcome matches the chosen theme (2026-11-22): colors come from the theme's own tokens; "Pick a look" swatches preview live */
.overlay.welcome { background: radial-gradient(ellipse 90% 70% at 15% 0%, var(--surface), transparent 70%), linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%); color: var(--ink); }
.wc-blob.b1 { background: color-mix(in srgb, var(--brand) 30%, #fff); }
.wc-blob.b2 { background: color-mix(in srgb, var(--accent) 24%, #fff); }
.wc-blob.b3 { background: color-mix(in srgb, var(--brand) 14%, var(--bg)); }
.welcome .welcome-card { background: color-mix(in srgb, var(--surface) 88%, transparent); border-color: var(--line-2); }
.wc-mark { background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 72%, #fff), var(--brand)); box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--brand) 60%, transparent); }
.wc-mark .glyph, .welcome .wc-mark svg { color: var(--brand-ink); stroke: var(--brand-ink); }
.welcome .welcome-card h1 { color: var(--ink); }
.wc-lead { color: var(--ink-2) !important; }
.wc-small { color: var(--ink-3) !important; }
.wc-feats li { color: var(--ink); }
.welcome .wc-btns .btn { background: var(--surface); color: var(--brand); border-color: var(--line); }
.welcome .wc-btns .btn:hover { background: var(--surface-2); }
.welcome .wc-btns .btn.primary { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 78%, #fff), var(--brand)); color: var(--brand-ink); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--brand) 65%, transparent); }
.wc-look { margin: 20px auto 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wc-look > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.wc-look small { font-size: 13px; color: var(--ink-3); min-height: 1em; }
.wc-skins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wc-skin { width: 38px; height: 38px; padding: 3px; border-radius: 50%; border: 2px solid transparent; background: none; cursor: pointer; }
.wc-skin i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px #0000001f; }
.wc-skin[aria-checked="true"] { border-color: var(--brand); }
.wc-skin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
