/* Hearth — family hub styles */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --ink-base: #172033;
  --text: #172033;
  --muted: #5B667A;
  --faint: #8A94A6;
  --line: #E3E7EE;
  --line-strong: #D3D9E3;
  --primary: #172033;
  --on-primary: #FFFFFF;
  --mari: #F0A92A;
  --mari-ink: #6B4500;
  --mari-soft: #FDF1D8;
  --danger: #C53B3B;
  --ok: #2F8A4F;
  --shadow-lg: 0 24px 60px -18px rgba(23, 32, 51, .28), 0 2px 6px rgba(23, 32, 51, .06);
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, .06);
  --r-sheet: 22px;
  --r-card: 16px;
  --r-ctl: 12px;
  --r-pill: 8px;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --hour: 56px;
  --rail: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0E1320;
  --surface: #161C2B;
  --surface-2: #1B2233;
  --ink-base: #E8ECF4;
  --text: #E8ECF4;
  --muted: #A3ADC0;
  --faint: #737E93;
  --line: #262F42;
  --line-strong: #323C52;
  --primary: #E8ECF4;
  --on-primary: #0E1320;
  --mari-ink: #FFD48A;
  --mari-soft: #3A2E14;
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
:focus-visible { outline: 2px solid var(--mari); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* member tone: set --c on element */
.tone {
  --soft: color-mix(in srgb, var(--c) 14%, var(--surface));
  --mid: color-mix(in srgb, var(--c) 30%, var(--surface));
  --ink: color-mix(in srgb, var(--c) 62%, #0B1020);
}
[data-theme="dark"] .tone {
  --soft: color-mix(in srgb, var(--c) 22%, var(--surface));
  --mid: color-mix(in srgb, var(--c) 38%, var(--surface));
  --ink: color-mix(in srgb, var(--c) 40%, #FFFFFF);
}

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: calc(100vh - var(--bar, 0px)); height: calc(100dvh - var(--bar, 0px));
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: 12.5px; color: var(--muted); }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-family { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 6px 10px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.sync[data-s="syncing"] .sync-dot { background: var(--mari); animation: pulse 1s infinite; }
.sync[data-s="offline"] .sync-dot, .sync[data-s="error"] .sync-dot { background: var(--danger); }
.sync[data-s="local"] .sync-dot { background: var(--faint); }
@keyframes pulse { 50% { opacity: .35; } }

.main { min-width: 0; padding: 26px 32px 48px; }
.tabbar { display: none; }
.fab { display: none; }
.preview-bar {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--mari-soft); color: var(--mari-ink); font-size: 13px; font-weight: 600; padding: 7px 16px; text-align: center;
}

/* ---------- page header ---------- */
.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.ph h1 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.ph .sub { color: var(--muted); font-size: 14px; }
.ph-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  font-weight: 650; font-size: 14.5px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 13px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .lbl { font-size: 13px; font-weight: 650; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-ctl);
  background: var(--surface); border: 1px solid var(--line-strong); outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 15.5px;
}
textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.input.title { font-family: var(--display); font-size: 21px; font-weight: 650; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 0 10px; background: transparent; }
.input.title:focus { box-shadow: none; border-color: var(--primary); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
[data-theme="dark"] .switch input:checked::after { background: var(--on-primary); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 4px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--muted);
  transition: background .15s, border-color .15s, color .15s;
}
.mchip[aria-pressed="true"] { background: var(--soft); border-color: var(--c); color: var(--ink); }
.mchip.plain { padding: 0 14px; }
.mchip .av { width: 28px; height: 28px; font-size: 13px; }
.mchip[aria-pressed="false"] .av { filter: grayscale(1); opacity: .55; }
.daychip { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); font-weight: 650; font-size: 13.5px; color: var(--muted); background: var(--surface); }
.daychip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c); }

.av {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: 0;
}
.av.emoji { background: var(--soft); font-size: 17px; box-shadow: inset 0 0 0 2px var(--c); }
.av.xs { width: 20px; height: 20px; font-size: 10px; }
.av.xs.emoji { font-size: 11px; box-shadow: inset 0 0 0 1.5px var(--c); }
.av.lg { width: 52px; height: 52px; font-size: 21px; }
.av.lg.emoji { font-size: 26px; box-shadow: inset 0 0 0 3px var(--c); }
.avs { display: inline-flex; }
.avs .av { box-shadow: 0 0 0 2px var(--surface); }
.avs .av + .av { margin-left: -6px; }
.avs .av.emoji { box-shadow: inset 0 0 0 1.5px var(--c), 0 0 0 2px var(--surface); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.card-h h2, .card-h h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.005em; }
.card-h .more { margin-left: auto; }
.card-b { padding: 0 18px 16px; }
.empty { text-align: center; color: var(--muted); padding: 28px 18px; font-size: 14.5px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.link-btn { color: var(--muted); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--text); }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.home-main { display: grid; gap: 22px; min-width: 0; }
.home-side { display: grid; gap: 16px; align-items: start; align-content: start; }
.hero { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 4px 2px 0; }
.hero-date { display: flex; align-items: flex-end; gap: 16px; }
.hero-num {
  font-family: var(--display); font-weight: 800; font-size: 124px; line-height: .78; letter-spacing: -.055em;
  font-variation-settings: "opsz" 96; color: var(--text); position: relative; padding-bottom: 6px;
}
.hero-num::after { content: ""; position: absolute; left: 4px; right: 8px; bottom: -8px; height: 7px; border-radius: 4px; background: var(--mari); }
.hero-wd { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.hero-my { color: var(--muted); font-size: 16px; font-weight: 500; margin-top: 2px; }
.hero-right { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.clock { font-family: var(--display); font-weight: 600; font-size: 40px; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock small { font-size: 18px; font-weight: 600; margin-left: 3px; color: var(--muted); letter-spacing: 0; }
.wx { display: flex; align-items: center; gap: 10px; }
.wx-icon { width: 40px; height: 40px; }
.wx-t { font-family: var(--display); font-size: 30px; font-weight: 650; line-height: 1; letter-spacing: -.02em; }
.wx-l { font-size: 13px; color: var(--muted); line-height: 1.3; }

.today-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; }
.pcol { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.pcol-h { display: flex; align-items: center; gap: 10px; }
.pcol-h b { font-size: 15.5px; }
.pcol-h .meta { font-size: 12.5px; color: var(--muted); }
.ring { --p: 0; position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.ring > .av { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--surface); }
.ring.lg { width: 66px; height: 66px; }
.ring.lg > .av { width: 56px; height: 56px; font-size: 22px; }
.ring.lg > .av.emoji { font-size: 28px; }
.mini-ev { display: grid; grid-template-columns: 4px 1fr; gap: 10px; padding: 8px 10px 8px 0; border-radius: 10px; text-align: left; width: 100%; background: var(--soft); color: var(--ink); }
.mini-ev::before { content: ""; background: var(--c); border-radius: 0 3px 3px 0; }
.mini-ev .t { font-weight: 650; font-size: 14px; line-height: 1.25; }
.mini-ev .s { font-size: 12.5px; opacity: .85; margin-top: 1px; }
.mini-ev.past { opacity: .62; }
.pcol .nothing { color: var(--faint); font-size: 13.5px; padding: 6px 2px; }
.pcol-chores { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-top: 4px; border-top: 1px dashed var(--line); padding-top: 10px; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--c); border-radius: 99px; }

.agenda { display: grid; gap: 8px; }
.ag-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--soft); color: var(--ink); text-align: left; width: 100%; position: relative; }
.ag-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); }
.ag-time { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ag-title { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.ag-sub { font-size: 12.5px; opacity: .85; }
.ag-item.past { opacity: .62; }
.ag-day { font-weight: 700; font-size: 14px; margin: 14px 0 2px; display: flex; gap: 8px; align-items: baseline; }
.ag-day span { color: var(--muted); font-weight: 500; font-size: 13px; }
.ag-day.today { color: var(--mari-ink); }

.dinner { padding: 18px; display: grid; gap: 2px; align-content: start; cursor: pointer; }
.dinner .lbl { margin-bottom: 4px; }
.dinner-t { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.dinner-n { font-size: 13.5px; color: var(--muted); }
.cd-list { display: grid; gap: 2px; }
.cd { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.cd + .cd { border-top: 1px solid var(--line); }
.cd-e { font-size: 22px; width: 32px; text-align: center; }
.cd-t { font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.cd-d { font-size: 12.5px; color: var(--muted); }
.cd-n { margin-left: auto; text-align: right; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -.02em; }
.cd-n small { display: block; font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.snap { display: grid; gap: 4px; }
.snap-i { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 5px 0; }
.snap-i .box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); flex: none; }
.fc { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.fc-d { font-size: 12px; color: var(--muted); font-weight: 600; }
.fc .wx-icon { width: 26px; height: 26px; margin: 4px auto; display: block; }
.fc-h { font-weight: 700; font-size: 13.5px; }
.fc-l { color: var(--muted); font-size: 12.5px; }

/* ---------- calendar ---------- */
.cal-top .seg { margin-left: auto; }
.cal-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0 6px 0 4px; line-height: 1.1; }
.cal-title span { color: var(--muted); font-weight: 500; }
.cal-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-filter .mchip { height: 32px; font-size: 13.5px; }
.cal-filter .mchip .av { width: 24px; height: 24px; font-size: 11.5px; }

.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.mh { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.mh div { padding: 10px 12px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.mg { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(118px, 1fr); }
.mc { position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .12s; }
.mc:nth-child(7n) { border-right: 0; }
.mc:hover { background: var(--surface-2); }
.mc.out { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
.mc.out .mc-n { color: var(--faint); }
.mc-n { font-weight: 650; font-size: 13.5px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 1px; font-variant-numeric: tabular-nums; }
.mc.today .mc-n { background: var(--mari); color: #241600; font-weight: 800; }
.mc-add { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .12s; }
.mc:hover .mc-add { opacity: 1; }
.mc-add:hover { background: var(--line); color: var(--text); }
.pill { display: flex; align-items: center; gap: 6px; width: 100%; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; color: var(--ink); text-align: left; }
.pill.timed::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.pill.allday { background: var(--soft); }
.pill.timed:hover { background: var(--soft); }
.pill .pt { font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; }
.pill .pn { overflow: hidden; text-overflow: ellipsis; }
.pill-more { font-size: 12px; font-weight: 650; color: var(--muted); padding: 0 7px; text-align: left; }
.dots { display: flex; gap: 3px; justify-content: center; height: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* time grid */
.tg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 460px; }
.tg-head, .tg-allday { display: grid; grid-template-columns: 58px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tg-head > div { padding: 10px 10px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tg-head > div + div { border-left: 1px solid var(--line); }
.tg-dname { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.tg-dnum { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.02em; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; margin-left: -4px; }
.tg-head .today .tg-dnum { background: var(--mari); color: #241600; }
.tg-head .who { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-allday > div { padding: 5px 4px; display: grid; gap: 3px; align-content: start; min-height: 32px; min-width: 0; }
.tg-allday > div + div { border-left: 1px solid var(--line); }
.tg-allday .gl { font-size: 11.5px; color: var(--faint); font-weight: 600; text-align: right; padding: 8px 8px 0 0; }
.tg-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.tg-body { position: relative; display: grid; grid-template-columns: 58px repeat(var(--n), minmax(0, 1fr)); height: calc(var(--hour) * 24); }
.tg-gutter { position: relative; }
.tg-gutter span { position: absolute; right: 9px; transform: translateY(-50%); font-size: 11.5px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); cursor: cell; }
.tg-col.today { background-color: color-mix(in srgb, var(--mari) 5%, transparent); }
.ev {
  position: absolute; border-radius: 8px; padding: 4px 7px 4px 9px; overflow: hidden; text-align: left;
  background: var(--soft); color: var(--ink); font-size: 12.5px; line-height: 1.25; cursor: pointer;
  box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px var(--surface);
  transition: filter .12s;
}
.ev:hover { filter: brightness(.97); z-index: 2; }
.ev b { display: block; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.ev.short b { display: inline; }
.ev .et { opacity: .85; font-variant-numeric: tabular-nums; }
.ev.past { opacity: .72; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--mari); z-index: 3; pointer-events: none; }
.now.nodot::before { display: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--mari); }

.sched { max-width: 760px; }
.sched .ag-day:first-child { margin-top: 0; }

/* ---------- chores ---------- */
.ch-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; align-items: start; }
.ch-col { padding: 16px; display: grid; gap: 12px; }
.ch-head { display: flex; align-items: center; gap: 12px; }
.ch-name { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.015em; line-height: 1.1; }
.ch-meta { font-size: 13px; color: var(--muted); }
.stars { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--mari-soft); color: var(--mari-ink); font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.stars .i { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.chore {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: background .2s, border-color .2s;
}
.chore .ce { font-size: 22px; width: 30px; text-align: center; flex: none; }
.chore .ct { font-weight: 650; font-size: 15px; line-height: 1.25; }
.chore .cs { font-size: 12.5px; color: var(--muted); }
.chk { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; transition: all .2s; }
.chk .i { width: 18px; height: 18px; stroke-width: 2.6; }
.chore.done { background: var(--soft); border-color: transparent; }
.chore.done .ct { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--ink); }
.chore.done .chk { background: var(--c); border-color: var(--c); color: #fff; }
.chore .edit-tools { margin-left: auto; display: flex; gap: 4px; }
.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.reward { padding: 16px; display: grid; gap: 8px; align-content: start; }
.reward .re { font-size: 30px; line-height: 1; }
.reward .rt { font-weight: 700; font-size: 15px; line-height: 1.25; }
.reward .rc { display: inline-flex; align-items: center; gap: 4px; color: var(--mari-ink); font-weight: 750; font-size: 14px; }
.reward .rc .i { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.section-t { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.015em; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-t .btn { margin-left: auto; }

/* ---------- meals ---------- */
.mealgrid { display: grid; grid-template-columns: 104px repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.mealgrid > div { border-bottom: 1px solid var(--line); min-width: 0; }
.mealgrid > div:not(.ml) { border-left: 1px solid var(--line); }
.mg-h { padding: 12px 10px; }
.mg-h .d1 { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.mg-h .d2 { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.1; }
.mg-h.today .d2 { color: var(--mari-ink); }
.ml { padding: 14px 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.meal-cell { display: block; width: 100%; height: 100%; min-height: 86px; padding: 10px; text-align: left; transition: background .12s; }
.meal-cell:hover { background: var(--surface-2); }
.meal-cell .mt { font-weight: 650; font-size: 14px; line-height: 1.3; }
.meal-cell .mn { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.meal-cell .plus { color: var(--faint); opacity: 0; transition: opacity .12s; }
.meal-cell:hover .plus, .meal-cell:focus-visible .plus { opacity: 1; }
.today-col { background: color-mix(in srgb, var(--mari) 6%, var(--surface)); }
.mealdays { display: none; }

/* ---------- lists ---------- */
.lists { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.list-nav { padding: 8px; display: grid; gap: 2px; }
.ln { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; font-weight: 600; text-align: left; width: 100%; }
.ln:hover { background: var(--surface-2); }
.ln[aria-current="true"] { background: var(--primary); color: var(--on-primary); }
.ln .le { font-size: 18px; width: 24px; text-align: center; }
.ln .lc { margin-left: auto; font-size: 13px; opacity: .7; font-variant-numeric: tabular-nums; }
.list-pane { padding: 6px 0 10px; }
.list-pane .card-h h2 { font-family: var(--display); font-size: 22px; letter-spacing: -.015em; }
.add-row { display: flex; gap: 8px; padding: 0 18px 10px; }
.items { display: grid; }
.it { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.it .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; transition: all .15s; }
.it .box .i { width: 15px; height: 15px; stroke-width: 2.8; }
.it.done .box { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.it .tx { flex: 1; text-align: left; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.it.done .tx { color: var(--faint); text-decoration: line-through; }
.it .del { opacity: 0; color: var(--faint); }
.it:hover .del { opacity: 1; }
.done-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; font-size: 13px; font-weight: 700; color: var(--muted); border-top: 1px solid var(--line); }
.done-h .link-btn { margin-left: auto; }

/* ---------- settings ---------- */
.settings { display: grid; gap: 18px; max-width: 820px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); min-height: 58px; }
.set-row .grow b { display: block; font-weight: 650; font-size: 15px; }
.set-row .grow span { font-size: 13px; color: var(--muted); }
.set-row .input, .set-row select.input { width: auto; min-width: 150px; min-height: 38px; padding: 6px 10px; font-size: 14.5px; }
.card-h + .set-row { border-top: 0; }
.set-intro { padding: 0 18px 12px; }

/* ---------- modal / sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 24, .42); z-index: 50; display: grid; place-items: center; padding: 24px; animation: fade .18s ease-out; }
.sheet { width: min(560px, 100%); max-height: min(88vh, 860px); overflow: auto; background: var(--surface); border-radius: var(--r-sheet); box-shadow: var(--shadow-lg); animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
.sheet.wide { width: min(720px, 100%); }
.sheet.narrow { width: min(420px, 100%); }
.sheet-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 22px; background: var(--surface); }
.sheet-h h2 { margin: 0; font-size: 17px; font-weight: 750; }
.sheet-h .btn { margin-left: auto; }
.sheet-b { padding: 4px 22px 18px; }
.sheet-f { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px calc(16px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.sheet-f .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.detail-bar { height: 8px; background: var(--c); }
.detail-t { font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin: 6px 0 14px; }
.drow { display: flex; gap: 12px; padding: 7px 0; font-size: 15px; align-items: flex-start; }
.drow .i { color: var(--muted); margin-top: 1px; }
.drow .sub { color: var(--muted); font-size: 13.5px; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.opt-list { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: left; width: 100%; font-weight: 600; }
.opt:hover { background: var(--surface-2); }
.opt[disabled] { opacity: .45; }
.show-when { display: none; }
.show-when.on { display: block; }
.results { display: grid; gap: 8px; margin-top: 8px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: #172033; color: #fff; padding: 12px 14px 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 550; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; max-width: calc(100vw - 32px); }
[data-theme="dark"] .toast { background: #E8ECF4; color: #0E1320; }
.toast button { color: var(--mari); font-weight: 750; padding: 4px 6px; }
[data-theme="dark"] .toast button { color: #8A5A00; }

/* ---------- confetti ---------- */
.confetti { position: fixed; pointer-events: none; z-index: 90; width: 9px; height: 9px; border-radius: 2px; }

/* ---------- setup ---------- */
.setup { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.setup-card { width: min(480px, 100%); }
.setup-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.setup-brand .brand-mark { width: 52px; height: 52px; }
.setup h1 { font-family: var(--display); font-size: 40px; letter-spacing: -.03em; margin: 0; line-height: 1; }
.setup p.lead { font-size: 17px; color: var(--muted); margin: 0 0 26px; line-height: 1.5; }
.setup .card { padding: 22px; }
.setup .err { color: var(--danger); font-size: 14px; font-weight: 600; margin: -6px 0 14px; }
.mem-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }

/* ---------- display mode ---------- */
.display {
  position: fixed; inset: 0; z-index: 100; background: #0C1222; color: #EEF1F7;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 6vw; padding: 6vh 6vw; overflow: hidden;
  transition: opacity 1s;
}
.display.night > * { opacity: .5; }
.display .dx { position: absolute; top: 18px; right: 18px; color: rgba(255,255,255,.55); cursor: pointer; }
.display .dx:hover { color: #fff; }
.dl { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.d-clock { font-family: var(--display); font-weight: 600; font-size: clamp(90px, 15vw, 240px); line-height: .85; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.d-clock small { font-size: .26em; letter-spacing: 0; margin-left: .2em; color: rgba(255,255,255,.6); }
.d-date { font-family: var(--display); font-size: clamp(26px, 3.4vw, 50px); font-weight: 600; letter-spacing: -.02em; margin-top: 3vh; }
.d-date span { color: var(--mari); }
.d-wx { display: flex; align-items: center; gap: 18px; font-size: clamp(16px, 1.6vw, 22px); color: rgba(255,255,255,.75); }
.d-wx .wx-icon { width: clamp(44px, 5vw, 72px); height: clamp(44px, 5vw, 72px); }
.d-wx b { font-family: var(--display); font-size: clamp(36px, 4.4vw, 64px); color: #fff; font-weight: 600; letter-spacing: -.03em; }
.dr { display: flex; flex-direction: column; gap: 2.4vh; min-width: 0; overflow: hidden; }
.d-h { font-size: clamp(14px, 1.3vw, 18px); color: rgba(255,255,255,.55); font-weight: 650; margin-top: 1vh; }
.d-ev { display: grid; grid-template-columns: 6px 1fr; gap: 16px; align-items: stretch; }
.d-ev::before { content: ""; background: var(--c); border-radius: 4px; }
.d-ev .t { font-size: clamp(19px, 2vw, 30px); font-weight: 650; line-height: 1.2; }
.d-ev .s { font-size: clamp(14px, 1.3vw, 19px); color: rgba(255,255,255,.62); margin-top: 3px; }
.d-ev.past { opacity: .4; }
.d-empty { font-size: clamp(18px, 1.8vw, 26px); color: rgba(255,255,255,.6); }

/* weather icon colours */
.wx-icon .sun { stroke: #F0A92A; }
.wx-icon .cl { stroke: #8D9AB0; fill: var(--surface); }
.display .wx-icon .cl { fill: #0C1222; stroke: #C5CEDD; }
.wx-icon .rn { stroke: #2B8CD3; }
.wx-icon .mn { stroke: #8C93C9; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  :root { --rail: 84px; }
  .rail { padding: 18px 10px; align-items: center; }
  .brand { padding: 0 0 16px; }
  .brand-text, .nav-btn span, .rail-family, .sync span { display: none; }
  .nav-btn { justify-content: center; width: 56px; height: 52px; padding: 0; }
  .nav-btn .i { width: 23px; height: 23px; }
  .main { padding: 22px 24px 40px; }
  .home { grid-template-columns: 1fr; }
  .home-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  :root { --hour: 52px; }
  body { font-size: 15.5px; }
  .app { grid-template-columns: 1fr; padding-bottom: calc(68px + var(--safe-b)); }
  .rail { display: none; }
  .main { padding: calc(14px + var(--safe-t)) 16px 28px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b));
  }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0 4px; color: var(--faint); font-size: 11px; font-weight: 650; border-radius: 12px; }
  .tab .i { width: 23px; height: 23px; }
  .tab[aria-current="page"] { color: var(--text); }
  .tab[aria-current="page"] .i { stroke-width: 2.2; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(82px + var(--safe-b)); z-index: 41;
    width: 58px; height: 58px; border-radius: 19px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg);
  }
  .fab .i { width: 26px; height: 26px; stroke-width: 2.2; }
  .fab[hidden] { display: none; }
  .ph h1 { font-size: 27px; }
  .ph { margin-bottom: 14px; }

  .hero { gap: 12px; align-items: center; }
  .hero-num { font-size: 84px; }
  .hero-num::after { height: 5px; bottom: -6px; }
  .hero-wd { font-size: 23px; }
  .hero-my { font-size: 14.5px; }
  .hero-right { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 10px; gap: 12px; }
  .clock { font-size: 30px; }
  .wx-t { font-size: 24px; }
  .wx-icon { width: 32px; height: 32px; }
  .today-cols { display: none; }
  .home-side { grid-template-columns: 1fr; }
  .phone-only { display: block; }

  .cal-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 8px; }
  .cal-title { font-size: 22px; margin: 0 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-top .seg { margin: 0; display: flex; }
  .cal-top .seg button { flex: 1; padding: 0 4px; white-space: nowrap; }
  .cal-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .cal-filter::-webkit-scrollbar { display: none; }
  .cal-filter .mchip { flex: none; }
  .mg { grid-auto-rows: 54px; }
  .mh div { padding: 8px 0; text-align: center; font-size: 12px; }
  .mc { align-items: center; padding: 4px 2px; gap: 2px; border-right: 0; }
  .mc-n { font-size: 14.5px; width: 32px; height: 32px; }
  .mc.sel:not(.today) .mc-n { background: var(--primary); color: var(--on-primary); }
  .mc.sel.today .mc-n { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--mari); }
  .mc:hover { background: transparent; }
  .month-agenda { margin-top: 16px; }
  .tg { height: calc(100dvh - 250px); border-radius: 14px; }
  .tg-head, .tg-allday, .tg-body { grid-template-columns: 44px repeat(var(--n), minmax(0, 1fr)); }
  .tg-head > div { flex-direction: column; gap: 2px; padding: 8px 2px; }
  .tg-dnum { margin: 0; width: 32px; height: 32px; font-size: 19px; }
  .tg-gutter span { right: 5px; font-size: 10.5px; }
  .ev { padding: 3px 5px 3px 7px; font-size: 11.5px; }
  .ev b { font-size: 12px; }

  .ch-cols { grid-template-columns: 1fr; }
  .mealgrid { display: none; }
  .mealdays { display: grid; gap: 12px; }
  .mday { padding: 6px 0; }
  .mday-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px 6px; }
  .mday-h b { font-family: var(--display); font-size: 19px; }
  .mday-h span { color: var(--muted); font-size: 13.5px; }
  .mday.today .mday-h b { color: var(--mari-ink); }
  .mrow { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--line); text-align: left; width: 100%; }
  .mrow .ml2 { font-size: 13px; font-weight: 650; color: var(--muted); }
  .mrow .mt { font-weight: 600; }
  .mrow .mt.empty2 { color: var(--faint); font-weight: 500; }
  .lists { grid-template-columns: 1fr; gap: 12px; }
  .list-nav { display: flex; overflow-x: auto; padding: 0; background: none; border: 0; gap: 8px; scrollbar-width: none; }
  .list-nav::-webkit-scrollbar { display: none; }
  .ln { width: auto; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface); padding: 8px 14px; }
  .ln .lc { margin-left: 4px; }
  .it .del { opacity: 1; }
  .rewards { grid-template-columns: 1fr 1fr; }

  .scrim { place-items: end center; padding: 0; }
  .sheet, .sheet.wide, .sheet.narrow { width: 100%; max-height: 92dvh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; animation: slideup .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet-h { padding-top: 22px; }
  .sheet-h::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 9px; background: var(--line-strong); }
  .toasts { bottom: calc(150px + var(--safe-b)); }
  .display { grid-template-columns: 1fr; gap: 4vh; padding: 5vh 7vw; }
  .settings .set-row { flex-wrap: wrap; }
  .set-row .input, .set-row select.input { min-width: 0; width: 100%; }
  .set-row .grow { min-width: 60%; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 721px) { .phone-only { display: none !important; } }
@media (max-width: 720px) { .desk-only { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
