/* Warm, rounded, colour carried by the family members themselves. */
:root {
  --bg: #FBF7F2; --surface: #FFFFFF; --surface2: #F3EDE5; --surface3: #EAE2D7;
  --ink: #26222E; --ink2: #6F6878; --ink3: #A39BA9; --line: #E9E1D6;
  --accent: #FF6B3D; --accent-soft: #FFE6DC; --accent-ink: #FFFFFF;
  --good: #1FA971; --warn: #E8A317; --bad: #E5484D;
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, .06), 0 1px 6px rgba(60, 40, 20, .05);
  --shadow: 0 12px 36px rgba(60, 40, 20, .16);
  --r: 16px; --r-sm: 11px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17151C; --surface: #221F29; --surface2: #2B2734; --surface3: #36313F;
    --ink: #F3F0F7; --ink2: #A9A2B6; --ink3: #7A7386; --line: #34303D;
    --accent: #FF7E54; --accent-soft: #3D2A26;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3); --shadow: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17151C; --surface: #221F29; --surface2: #2B2734; --surface3: #36313F;
  --ink: #F3F0F7; --ink2: #A9A2B6; --ink3: #7A7386; --line: #34303D;
  --accent: #FF7E54; --accent-soft: #3D2A26;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3); --shadow: 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface2); border: 1.5px solid transparent;
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; min-height: 70px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink2); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svg { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* ── Shell ── */
.shell { display: flex; height: 100vh; height: 100dvh; }
.side { width: 236px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 19px; letter-spacing: -1px; }
.brand-name { font-size: 20px; font-weight: 850; letter-spacing: -.5px; }
.brand-fam { font-size: 11.5px; color: var(--ink2); margin-top: -2px; }
.nav-sec { padding: 14px 10px 4px; }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; font-weight: 650;
  font-size: 14.5px; color: var(--ink2); width: 100%; text-align: left; position: relative; }
.nav-btn:hover { background: var(--surface2); color: var(--ink); }
.nav-btn.on { background: var(--accent-soft); color: var(--accent); }
.nav-btn .badge { margin-left: auto; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.side-foot { margin-top: auto; padding-top: 12px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; width: 100%; text-align: left; }
.me-chip:hover { background: var(--surface2); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.sync-dot.off { background: var(--warn); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; min-height: 66px; border-bottom: 1px solid var(--line);
  background: var(--surface); flex-wrap: wrap; }
.top h1 { font-size: 23px; font-weight: 850; letter-spacing: -.6px; text-wrap: balance; }
.top h1 .lite { font-weight: 500; color: var(--ink2); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.page { flex: 1; overflow-y: auto; position: relative; }
.pad { padding: 22px 24px 110px; }
.narrow { max-width: 760px; margin: 0 auto; }
.bottom { display: none; }

/* ── Buttons ── */
a.btn { text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 12px;
  font-weight: 700; font-size: 14.5px; background: var(--surface2); white-space: nowrap; transition: filter .12s, transform .12s; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--surface2); flex-shrink: 0; }
.icon-btn:hover { background: var(--surface3); }
.icon-btn.plain { background: transparent; }
.icon-btn.plain:hover { background: var(--surface2); }
.seg { display: inline-flex; background: var(--surface2); border-radius: 12px; padding: 3px; }
.seg button { padding: 7px 15px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.fab { position: fixed; right: 26px; bottom: 26px; width: 60px; height: 60px; border-radius: 20px; background: var(--accent);
  color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(255, 107, 61, .45); z-index: 30; transition: transform .15s; }
.fab .svg { width: 28px; height: 28px; }
.fab:hover { transform: scale(1.06); }

/* ── Avatars & member chips ── */
.av { --c: #999; width: var(--s, 30px); height: var(--s, 30px); border-radius: 50%; background: var(--c); color: #fff;
  display: inline-grid; place-items: center; font-size: calc(var(--s, 30px) * .5); line-height: 1; flex-shrink: 0;
  font-weight: 800; box-shadow: 0 0 0 2px var(--surface); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: calc(var(--s, 24px) * -.3); }
.who-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: transparent; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); color: color-mix(in srgb, var(--c) 70%, var(--ink)); font-weight: 700; font-size: 13px; }
.family-strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; max-width: 100%; }
.family-strip::-webkit-scrollbar { display: none; }
.family-strip .fm { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; min-width: 54px; }
.fm.off { opacity: .35; }

/* ── Cards ── */
.cards.main-aside { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.cards > *, .split > *, .stack > * { min-width: 0; }
.card { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; }
.card-h .more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--accent); }
.empty { text-align: center; padding: 26px 12px; color: var(--ink2); font-size: 14px; }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* Event rows: a colour block keyed to the person, plus their icon */
.ev-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 13px; cursor: pointer;
  background: var(--surface); background: color-mix(in srgb, var(--c) 10%, var(--surface)); width: 100%; text-align: left; }
.ev-row:hover { background: var(--surface); background: color-mix(in srgb, var(--c) 17%, var(--surface)); }
.ev-time { width: 58px; flex-shrink: 0; font-size: 12.5px; font-weight: 800; color: var(--c); color: color-mix(in srgb, var(--c) 75%, var(--ink)); line-height: 1.2; }
.ev-time small { display: block; font-weight: 600; color: var(--ink2); }
.ev-title { font-weight: 700; font-size: 14.5px; }
.ev-sub { font-size: 12.5px; color: var(--ink2); }
.lock { color: var(--ink3); }

.hello-wrap { flex: 1 1 320px; min-width: 0; }
.today-wx { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 15px; color: var(--ink2); }
.today-wx b { color: var(--ink); font-size: 16px; }
.today-wx-ic { font-size: 22px; line-height: 1; }
.today-wx .btn { padding: 2px 8px; font-size: 13px; color: var(--accent); }
.hello { font-size: 30px; font-weight: 850; letter-spacing: -1px; line-height: 1.1; text-wrap: balance; }
.hello-sub { color: var(--ink2); font-size: 15px; margin-top: 4px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; }
.quick .btn { background: var(--surface); border: 1px solid var(--line); }

/* ── Calendar ── */
.cal-bar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.cal-filter { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.cal-filter button { opacity: 1; transition: opacity .15s; }
.cal-filter button.off { opacity: .28; }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.dow div { padding: 8px; text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink2); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(108px, 1fr); min-height: calc(100% - 34px); }
.mcell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.mcell:nth-child(7n) { border-right: none; }
.mcell:hover { background: var(--surface2); background: color-mix(in srgb, var(--surface2) 60%, transparent); }
.mcell.other { background: transparent; background: color-mix(in srgb, var(--surface2) 35%, transparent); }
.mcell.other .dnum { opacity: .4; }
.dnum { font-size: 12.5px; font-weight: 800; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--ink2); }
.mcell.today .dnum { background: var(--accent); color: #fff; }
.chip { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--c);
  border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip.soft { background: transparent; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.chip .i { font-size: 10.5px; }
.more-ev { font-size: 11px; font-weight: 700; color: var(--ink2); padding-left: 4px; }

.tgrid-head { display: grid; position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.tgrid-head .col { padding: 8px 4px 6px; text-align: center; border-left: 1px solid var(--line); cursor: pointer; }
.tgrid-head .d1 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--ink2); }
.tgrid-head .d2 { font-size: 21px; font-weight: 850; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; }
.tgrid-head .today .d2 { background: var(--accent); color: #fff; }
.allday-row { display: grid; border-bottom: 1px solid var(--line); background: var(--surface); }
.allday-row > div { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.allday-row > div:first-child { border: none; font-size: 10px; color: var(--ink2); text-align: right; padding: 6px 8px 0 0; }
.tgrid { display: grid; position: relative; }
.hours .h { height: 56px; font-size: 10.5px; color: var(--ink2); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.tcol { border-left: 1px solid var(--line); position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 55px, var(--line) 55px 56px); }
.tev { position: absolute; border-radius: 9px; padding: 4px 7px; font-size: 12px; font-weight: 700; color: #fff; overflow: hidden;
  cursor: pointer; background: var(--c); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); border: 1.5px solid var(--surface); line-height: 1.25; }
.tev small { display: block; font-weight: 600; opacity: .88; font-size: 11px; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* ── Planner (week board) ── */
.board { display: grid; grid-template-columns: repeat(7, minmax(170px, 1fr)); gap: 12px; padding: 20px 24px 110px; overflow-x: auto; }
.bday { background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 380px; }
.bday.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bday-h { padding: 12px 14px 8px; display: flex; align-items: baseline; gap: 8px; }
.bday-h b { font-size: 26px; font-weight: 850; letter-spacing: -1px; }
.bday-sec { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.bday-sec + .bday-sec { border-top: 1px dashed var(--line); padding-top: 9px; }
.pl-item { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; font-weight: 650; padding: 5px 7px; border-radius: 8px;
  background: transparent; background: color-mix(in srgb, var(--c, var(--ink3)) 12%, transparent); cursor: pointer; text-align: left; width: 100%; }
.pl-item .t { font-size: 11px; font-weight: 800; color: var(--c, var(--ink2)); color: color-mix(in srgb, var(--c, var(--ink2)) 75%, var(--ink)); }
.weeknote { margin: 20px 24px 0; }
.weeknote textarea { background: #FFF6C9; color: #4A3F12; border-radius: 14px; font-weight: 600; min-height: 64px; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .weeknote textarea { background: #3A3520; color: #F4E9B8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .weeknote textarea { background: #3A3520; color: #F4E9B8; } }

/* ── Lists ── */
.split { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.list-nav { display: flex; flex-direction: column; gap: 4px; }
.list-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 700; text-align: left; }
.list-nav button:hover { background: var(--surface2); }
.list-nav button.on { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.list-nav .cnt { margin-left: auto; font-size: 12.5px; color: var(--ink2); }
.add-line { display: flex; gap: 8px; margin-bottom: 12px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task.done .task-text { text-decoration: line-through; color: var(--ink3); }
.check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--ink3); display: grid; place-items: center; flex-shrink: 0; color: transparent; transition: all .12s; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check.round { border-radius: 50%; }
.task-text { font-weight: 600; }

/* ── Meals ── */
.meal-grid { display: grid; grid-template-columns: 110px repeat(3, 1fr); gap: 8px; }
.meal-grid .mh { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink2); padding: 4px 6px; }
.meal-day { padding: 10px 6px; font-weight: 800; }
.meal-day small { display: block; font-weight: 600; color: var(--ink2); font-size: 12px; }
.meal-day.today { color: var(--accent); }
.meal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; min-height: 62px; text-align: left;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.meal-cell:hover { border-color: var(--accent); }
.meal-cell.empty-cell { border-style: dashed; color: var(--ink3); background: transparent; align-items: center; font-size: 20px; }
.meal-cell .mt { font-weight: 700; font-size: 14px; }
/* ── Feedback tab: on the edge of every screen ── */
.fb-tab { position: fixed; right: 0; top: 50%; z-index: 70; transform: translateY(-50%); writing-mode: vertical-rl; display: flex; align-items: center; gap: 8px;
  padding: 14px 7px; border-radius: 12px 0 0 12px; background: var(--ink); color: var(--bg); font-weight: 750; font-size: 13px; letter-spacing: .04em;
  box-shadow: var(--shadow); opacity: .82; transition: opacity .15s, padding .15s; }
.fb-tab .svg { transform: rotate(90deg); width: 16px; height: 16px; }
.fb-tab:hover { opacity: 1; padding-right: 10px; }
body.hub-mode .fb-tab { opacity: .45; padding: 10px 5px; font-size: 11px; }
@media (max-width: 860px) { .fb-tab { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); transform: none; padding: 10px 5px; font-size: 11px; } }
.fb-item.done { opacity: .7; }
.fb-kind { font-size: 26px; }
.fb-msg { white-space: pre-wrap; margin: 12px 0 8px; font-size: 15.5px; line-height: 1.5; }

/* ── Cooking timers ── */
.timer-dock { position: fixed; left: 16px; bottom: 20px; z-index: 160; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.timer { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.timer.soon { background: var(--accent); color: #fff; animation: pulse 1s ease-in-out infinite; }
.timer-t { font-size: 18px; font-weight: 800; }
.timer-l { flex: 1; font-size: 13px; opacity: .85; min-width: 0; }
.timer button { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .16); color: inherit; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.rc-timers { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rc-timer { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; background: var(--surface2); border: 1px solid var(--line); }
.rc-timer:hover { border-color: var(--accent); color: var(--accent); }
.cook-timers { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.cook-timer { padding: 14px 22px; font-size: 18px; border-radius: 16px; background: var(--ink); color: var(--bg); }
.cook-timer:disabled { opacity: .6; }
@media (max-width: 860px) { .timer-dock { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.meal-ideas { margin-bottom: 16px; }
.meal-ideas-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.meal-idea { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-align: left; flex: 0 0 auto; max-width: 220px; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.meal-idea:hover { border-color: var(--accent); }
.meal-idea.on { border-color: var(--accent); background: var(--accent-soft); }
.meal-idea b { font-size: 13.5px; display: block; }
.meal-idea .grow { min-width: 0; display: flex; flex-direction: column; }
.rc-thumb { border-radius: 10px; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; background: linear-gradient(145deg, #FFE6DC, #FFF3C9); font-size: 20px; }
.meal-form-ideas { display: flex; gap: 8px; flex-wrap: wrap; }
.meal-form-ideas .meal-idea { cursor: pointer; }
.meal-cell[data-id] { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.meal-cell.dragging { opacity: .3; }
.meal-cell.drop-target { border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent); }
.meal-ghost { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; box-shadow: var(--shadow); opacity: .96; cursor: grabbing; }
body.meal-dragging, body.meal-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }

/* ── Chores ── */
.chore { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.chore-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.chore-who { display: flex; gap: 6px; flex-wrap: wrap; }
.tick { position: relative; border-radius: 50%; transition: transform .15s; }
.tick:hover { transform: scale(1.08); }
.tick .av { opacity: .35; filter: grayscale(.5); }
.tick.done .av { opacity: 1; filter: none; }
.tick.done::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--good); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.pts { font-size: 12px; font-weight: 800; color: var(--warn); white-space: nowrap; }
.leader { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.bar { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c); }

/* ── Birthdays / reminders / alarms / contacts ── */
.bd { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.bd-date { width: 52px; text-align: center; flex-shrink: 0; }
.bd-date b { display: block; font-size: 22px; font-weight: 850; line-height: 1; }
.bd-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--accent); letter-spacing: .08em; }
.countdown { margin-left: auto; text-align: right; font-weight: 800; font-size: 14px; }
.countdown small { display: block; font-weight: 600; color: var(--ink2); font-size: 12px; }
.alarm { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.alarm-time { font-size: 38px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; }
.alarm.off .alarm-time, .alarm.off .alarm-meta { opacity: .4; }
.days-row { display: flex; gap: 3px; margin-top: 5px; }
.days-row i { font-style: normal; font-size: 11px; font-weight: 800; width: 19px; text-align: center; color: var(--ink3); }
.days-row i.on { color: var(--accent); }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--surface3); position: relative; flex-shrink: 0; transition: background .18s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(20px); }
.contact { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; }
.contact:hover { background: var(--surface2); }
.contact-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 800; color: var(--ink2); flex-shrink: 0; }
.group-h { margin: 18px 4px 6px; }
.search { position: relative; margin-bottom: 14px; }
.search input { padding-left: 38px; }
.search .svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink3); }

/* ── Map ── */
.map-wrap { display: grid; grid-template-columns: 1fr 320px; height: 100%; }
#map { height: 100%; min-height: 380px; background: var(--surface2); }
.map-side { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pin { width: 40px; height: 40px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.3); border: 3px solid #fff; }
.pin span { transform: rotate(45deg); font-size: 19px; }
.leaflet-div-icon { background: none !important; border: none !important; }

/* ── Inbox / import ── */
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); }
.draft { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.draft-src { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.kind { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--surface2); color: var(--ink2); }
.inbox-addr { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; background: var(--surface2); padding: 8px 10px; border-radius: 9px; word-break: break-all; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Family / settings ── */
.member-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; }
.member-row:hover { background: var(--surface2); }
.pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.good { background: transparent; background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.setting { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: none; }
.setting .grow b { display: block; font-size: 15px; }
.setting .grow span { font-size: 13px; color: var(--ink2); }

/* ── Modal sheet ── */
.overlay { position: fixed; inset: 0; background: rgba(23, 18, 30, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fade .15s ease-out; }
.sheet { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); width: 100%; max-width: 500px; max-height: calc(100dvh - 40px);
  overflow-y: auto; animation: rise .2s cubic-bezier(.2, .9, .3, 1.2); }
.sheet.wide { max-width: 680px; }
.sheet-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.sheet-h h3 { font-size: 20px; font-weight: 850; letter-spacing: -.4px; }
.sheet-h .sub { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.sheet-b { padding: 12px 22px 8px; }
.sheet-f { display: flex; gap: 10px; padding: 12px 22px 22px; position: sticky; bottom: 0; background: var(--surface); }
.sheet-f .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px) scale(.98); opacity: 0; } }

.field { margin-bottom: 15px; }
.field > label, .field > .label { display: block; margin-bottom: 7px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.picks { display: flex; flex-wrap: wrap; gap: 7px; }
.pick { cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pick > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface2);
  border: 2px solid transparent; font-weight: 700; font-size: 13.5px; transition: all .12s; }
.pick.plain > span { padding: 7px 13px; }
.pick > input:checked + span { border-color: var(--c, var(--accent)); background: var(--surface); background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--surface)); }
.pick input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.pick .av { --s: 24px; box-shadow: none; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatches .pick > span { width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatches .pick input:checked + span { box-shadow: 0 0 0 3px var(--ink); background: var(--c); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emojis .pick > span { width: 100%; aspect-ratio: 1; padding: 0; justify-content: center; font-size: 21px; border-radius: 12px; }
.daypicks .pick > span { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.reveal { display: none; margin-top: 10px; }
.field:has(input[value="some"]:checked) .reveal { display: flex; }
.detail-hero { display: flex; gap: 14px; align-items: center; }
.detail-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--c); display: grid; place-items: center; font-size: 25px; flex-shrink: 0; }
.facts { background: var(--surface2); border-radius: 14px; padding: 6px 14px; margin-top: 16px; }
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; font-size: 14.5px; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact .svg { color: var(--ink2); margin-top: 1px; }

/* ── Toast & ringing alarm ── */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 120px); background: var(--ink); color: var(--bg); padding: 12px 18px;
  border-radius: 14px; font-weight: 700; font-size: 14.5px; z-index: 200; box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2);
  display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast button { color: var(--accent); font-weight: 800; }
.ring { position: fixed; inset: 0; z-index: 300; background: linear-gradient(160deg, var(--accent), #FF3D6E); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.ring .bell { font-size: 72px; animation: shake .5s ease-in-out infinite; }
.ring h2 { font-size: 34px; font-weight: 850; letter-spacing: -1px; text-wrap: balance; }
.ring .btn { background: rgba(255, 255, 255, .95); color: #D6451B; min-width: 200px; padding: 16px; font-size: 17px; border-radius: 18px; }
.ring .btn.ghost { background: rgba(255, 255, 255, .2); color: #fff; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* ── Auth ── */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--accent); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { font-size: 54px; font-weight: 900; letter-spacing: -2.5px; line-height: .95; max-width: 460px; text-wrap: balance; }
.auth-art p { font-size: 18px; max-width: 420px; opacity: .92; margin-top: 16px; }
.auth-art .dots { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-art .dots .av { --s: 54px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .35); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 28px; font-weight: 850; letter-spacing: -.8px; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--bad); font-size: 13.5px; font-weight: 700; min-height: 20px; margin: 4px 0 8px; }

/* ── Phone layout ── */
@media (max-width: 860px) {
  .side { display: none; }
  .top { padding: 12px 16px; min-height: 58px; position: sticky; top: 0; z-index: 20; }
  .top h1 { font-size: 20px; }
  .pad { padding: 16px 16px 120px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--ink3); padding: 4px 0; }
  .bottom button .svg { width: 25px; height: 25px; }
  .bottom button.on { color: var(--accent); }
  .fab { bottom: calc(80px + env(safe-area-inset-bottom)); right: 18px; width: 56px; height: 56px; }
  .cal-bar { padding: 8px 12px; }
  .cal-filter { width: 100%; margin-left: 0; order: 3; overflow-x: auto; flex-wrap: nowrap; }
  .month { grid-auto-rows: minmax(76px, 1fr); }
  .mcell { padding: 3px; }
  .chip { font-size: 10px; padding: 1px 4px; border-radius: 4px; }
  .chip .i, .chip .tm { display: none; }
  .split, .map-wrap { grid-template-columns: 1fr; }
  .map-wrap { height: auto; }
  #map { height: 52vh; }
  .map-side { border-left: none; }
  .meal-grid { grid-template-columns: 74px repeat(3, minmax(0, 1fr)); gap: 5px; }
  .meal-cell { padding: 7px 8px; min-height: 54px; }
  .meal-cell .mt { font-size: 12.5px; }
  .board { grid-template-columns: 1fr; padding: 16px 16px 120px; }
  .bday { min-height: 0; }
  .weeknote { margin: 16px 16px 0; }
  .cards, .cards.main-aside { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: 0; gap: 20px; }
  .auth-art h1 { font-size: 36px; letter-spacing: -1.5px; }
  .auth-art .dots .av { --s: 38px; }
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .hello { font-size: 25px; }
  .three { grid-template-columns: 1fr 1fr; }
  .three > :first-child { grid-column: 1 / -1; }
}


/* ── "Nights out" view: slim markers instead of full event details ── */
.chip.away { background: transparent; color: var(--c); color: color-mix(in srgb, var(--c) 75%, var(--ink)); border: 1.5px dashed var(--c); font-weight: 650; }
.tev.away { background: var(--surface); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); color: color-mix(in srgb, var(--c) 75%, var(--ink)); border: 1.5px dashed var(--c);
  box-shadow: none; font-weight: 650; font-size: 11.5px; }
.ev-row.away { padding: 6px 10px; background: transparent; border: 1.5px dashed var(--c); border: 1.5px dashed color-mix(in srgb, var(--c) 60%, transparent); }
.pl-item.away { background: transparent; border: 1.5px dashed var(--c); border: 1.5px dashed color-mix(in srgb, var(--c) 55%, transparent); font-weight: 600; color: var(--ink2); }
.cal-filter button { position: relative; border-radius: 50%; }
.cal-filter button.vis-hidden { opacity: .28; }
.cal-filter button.vis-away .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); opacity: .75; }
.vis-badge { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 11px; background: var(--surface); border-radius: 50%; width: 17px; height: 17px;
  display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.fm.half { opacity: .6; }
.vis-btn.vis-away { background: var(--surface); background: color-mix(in srgb, #8B5CF6 14%, var(--surface)); }
.vis-btn.vis-hidden { color: var(--ink3); }


/* ── Birthday mode ── */
body.bday-mode .shell { height: calc(100dvh - 48px); margin-top: 48px; }
.bday-banner { position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 56; display: flex; align-items: center; justify-content: center; text-decoration: none;
  background: linear-gradient(90deg, #FF6B3D, #EC4899, #8B5CF6, #3B82F6, #22C55E, #F59E0B, #FF6B3D); background-size: 300% 100%;
  animation: bday-slide 14s linear infinite; color: #fff; }
.bday-banner-in { background: rgba(255, 255, 255, .95); color: var(--ink); padding: 6px 18px; border-radius: 999px; font-size: 16px; font-weight: 800;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .15); display: flex; align-items: baseline; gap: 10px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
.bday-banner-in b { text-shadow: 0 0 1px rgba(0, 0, 0, .15); }
.bday-age { font-size: 12.5px; font-weight: 650; color: var(--ink2); }
.bday-bunting { position: fixed; top: 48px; left: 0; right: 0; height: 26px; z-index: 55; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='26'%3E%3Cpath d='M0 1 Q66 7 132 1' stroke='%23a39ba9' fill='none' stroke-width='1.2'/%3E%3Cpath d='M4 2 L26 3 L15 24Z' fill='%23FF6B3D'/%3E%3Cpath d='M48 4 L70 4.5 L59 25Z' fill='%23F59E0B'/%3E%3Cpath d='M92 3.5 L114 2.5 L103 24Z' fill='%233B82F6'/%3E%3C/svg%3E") repeat-x;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .12)); }
.bday-frame { position: fixed; inset: 48px 0 0 0; z-index: 54; pointer-events: none; border: 7px solid transparent;
  border-image: repeating-linear-gradient(45deg, #FF6B3D 0 14px, #F59E0B 14px 28px, #22C55E 28px 42px, #3B82F6 42px 56px, #8B5CF6 56px 70px, #EC4899 70px 84px) 7; }
.bday-balloons { position: fixed; bottom: 6px; z-index: 55; pointer-events: none; width: 120px; height: 170px; }
.bday-balloons.left { left: 10px; }
.bday-balloons.right { right: 104px; } /* clear of the + button */
.balloon { position: absolute; bottom: 0; width: calc(48px * var(--s)); height: calc(120px * var(--s)); animation: bob 5s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15)); transform-origin: bottom center; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
@keyframes bday-slide { to { background-position: 300% 0; } }
body.bday-mode.hub-mode .hb-week { margin: 0 120px; } /* leave the corners to the balloons */
.confetti { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .9; } }
/* Keep balloons clear of the phone tab bar and the add button */
@media (max-width: 860px) {
  .bday-balloons { bottom: calc(76px + env(safe-area-inset-bottom)); width: 90px; height: 130px; transform: scale(.75); transform-origin: bottom left; }
  .bday-balloons.right { transform-origin: bottom right; right: 70px; }
  .bday-banner-in { font-size: 14px; padding: 5px 12px; }
  .bday-age { display: none; }
}

.day-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-radius: 14px;
  background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.day-banner .svg { color: var(--accent); }


/* ── Goals, streaks and bonuses ── */
.goal { display: flex; flex-direction: column; gap: 8px; }
.goal-h { display: flex; align-items: center; gap: 10px; }
.goal-h b { display: block; font-size: 15px; }
.goal-sub { display: block; font-size: 12.5px; color: var(--ink2); }
.goal-num { font-size: 20px; font-weight: 850; letter-spacing: -.5px; white-space: nowrap; }
.goal-num small { font-size: 12px; font-weight: 700; color: var(--ink2); letter-spacing: 0; }
.goal-bar { position: relative; height: 12px; border-radius: 999px; background: var(--surface2); background: color-mix(in srgb, var(--c) 14%, var(--surface2)); margin-right: 14px; }
.goal-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c), var(--c)); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); transition: width .6s cubic-bezier(.2, .9, .3, 1.1); }
.goal-flag { position: absolute; right: -14px; top: 50%; transform: translateY(-50%); font-size: 22px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2)); }
.goal.won .goal-bar i { background: linear-gradient(90deg, #F59E0B, #FF6B3D, #EC4899); }
.goal.won .goal-flag { animation: bob 2.4s ease-in-out infinite; }
.goal .btn { align-self: flex-start; }
.streaks { display: flex; flex-wrap: wrap; gap: 8px; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; font-weight: 800; font-size: 13.5px;
  background: var(--surface); background: color-mix(in srgb, #F97316 13%, var(--surface)); }
.streak .av { box-shadow: none; }
.bonus-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #B45309;
  background: transparent; background: color-mix(in srgb, #F59E0B 18%, transparent); }
.tick-wrap { position: relative; display: inline-flex; }
.tick.early::after { content: "⚡"; background: #F59E0B; }
.habit { position: absolute; left: -6px; top: -6px; font-size: 14px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.asked { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; }
.asked.on { color: var(--ink3); text-decoration: line-through; }
.chore-who { row-gap: 18px; }
.ring.goal-win { background: radial-gradient(circle at 50% 35%, var(--c), var(--c) 70%); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 55%, #FFD166), var(--c) 70%); }
.ring.goal-win .btn { color: var(--c); color: color-mix(in srgb, var(--c) 70%, #000); }
.goal-prize { margin-top: 8px; padding: 10px 18px; border-radius: 16px; background: rgba(255, 255, 255, .22); font-size: 20px; }
.hb-chores .goal { margin: 4px 0 10px; }


/* ── Recipes ── */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.rc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; text-align: left; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.rc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rc-img { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(145deg, #FFE6DC, #FFF3C9); display: grid; place-items: center; overflow: hidden; }
.rc-img img, .rc-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.rc-plate { font-size: 64px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .12)); }
.rc-plate.big { font-size: 96px; }
.rc-kid { position: absolute; left: 10px; bottom: 10px; background: rgba(255, 255, 255, .92); color: #7C3AED; font-weight: 800; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; }
.rc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.rc-body b { font-size: 16px; line-height: 1.25; }
.rc-hero { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 7; max-height: 440px; width: 100%; background: linear-gradient(145deg, #FFE6DC, #FFF3C9); display: grid; place-items: center; }
.rc-title { font-size: 32px; font-weight: 850; letter-spacing: -1px; margin-top: 18px; text-wrap: balance; }
.rc-cols { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 16px; align-items: start; }
.rc-scale { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 10px; border-radius: 14px; background: var(--surface2); font-weight: 700; }
.rc-scale b { min-width: 40px; text-align: center; font-size: 20px; }
.rc-scale .icon-btn { width: 34px; height: 34px; font-size: 20px; font-weight: 800; background: var(--surface); }
.rc-qty { color: var(--accent); }
.rc-units { display: flex; margin-bottom: 10px; }
.rc-units button { flex: 1; }
.rc-types { margin-bottom: 16px; }
.rc-import-tabs { display: flex; flex-wrap: wrap; }
.rc-import-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rc-drop { padding: 22px; }
.rc-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rc-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.rc-st { width: 22px; text-align: center; flex-shrink: 0; }
.rc-check { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .94); color: #B45309; font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.rc-ahead { position: absolute; right: 10px; bottom: 10px; background: rgba(255, 255, 255, .94); font-size: 14px; padding: 2px 7px; border-radius: 999px; }
.rc-plan { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: transparent; background: color-mix(in srgb, #3B82F6 12%, transparent); font-size: 15px; }
.rc-prep { border-color: var(--line); border-color: color-mix(in srgb, #F97316 45%, var(--line)); background: var(--surface); background: color-mix(in srgb, #F97316 6%, var(--surface)); }
.rc-prep ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rc-prep li b { display: block; }
.cook-ahead { margin: 14px auto 0; padding: 12px 16px; border-radius: 14px; background: transparent; background: color-mix(in srgb, #3B82F6 14%, transparent); font-size: 18px; max-width: 640px; }
.cook-prep { list-style: none; margin: 22px auto 0; max-width: 640px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.cook-prep li { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: clamp(18px, 2.4vw, 26px); font-weight: 650; }
.cook-prep input { width: auto; transform: scale(1.5); margin-right: 12px; }
.cook-prep li:has(input:checked) span { text-decoration: line-through; color: var(--ink3); }
.cook-prep small { display: block; font-size: 14px; color: var(--ink2); font-weight: 600; margin: 4px 0 0 34px; }
.cook-due { margin-top: 12px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: transparent; background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); font-weight: 750; }

.rc-group { font-size: 18px; font-weight: 850; letter-spacing: -.3px; margin: 22px 2px 10px; }
.rc-group:first-of-type { margin-top: 4px; }
.rc-ing-btn { text-align: left; width: 100%; border-radius: 8px; padding: 0; }
.rc-ing-btn:hover { color: var(--accent); }
.rc-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; font-size: 13.5px;
  background: transparent; background: color-mix(in srgb, #F59E0B 14%, transparent); }
.cook-warn { margin-top: 14px; font-size: 15px; color: #B45309; }
.rc-ing { list-style: none; display: flex; flex-direction: column; }
.rc-ing li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rc-ing li:last-child { border-bottom: none; }
.rc-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rc-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 14px; font-size: 15.5px; line-height: 1.5; }
.rc-steps li.kid { background: transparent; background: color-mix(in srgb, #8B5CF6 9%, transparent); }
.rc-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; flex-shrink: 0; }
.rc-steps li.kid .rc-n { background: #8B5CF6; }
.rc-kidtoggle { font-size: 17px; opacity: .25; filter: grayscale(1); padding: 2px 6px; border-radius: 8px; flex-shrink: 0; }
.rc-kidtoggle.on { opacity: 1; filter: none; }
.rc-kidtoggle:hover { background: var(--surface2); opacity: .8; }
.rc-photo-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-photo-prev { width: 120px; height: 90px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; overflow: hidden; font-size: 30px; }
.rc-photo-prev img { width: 100%; height: 100%; object-fit: cover; }

/* ── Cook mode: big, calm, readable from across the kitchen ── */
.cook { position: fixed; inset: 0; z-index: 150; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s ease-out; }
.cook-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cook-top b { font-size: 17px; }
.cook-dots { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.cook-dots i { width: 22px; height: 6px; border-radius: 999px; background: var(--surface3); }
.cook-dots i.kid { background: var(--surface3); background: color-mix(in srgb, #8B5CF6 35%, var(--surface3)); }
.cook-dots i.done { background: var(--good); }
.cook-dots i.on { background: var(--accent); }
.cook-ing { background: var(--surface); border-bottom: 1px solid var(--line); max-height: 40vh; overflow-y: auto; padding: 12px 22px; }
.cook-ing ul { list-style: none; columns: 2 260px; }
.cook-ing li { padding: 6px 0; font-size: 17px; break-inside: avoid; }
.cook-ing input { width: auto; margin-right: 8px; transform: scale(1.3); }
.cook-ing li:has(input:checked) { color: var(--ink3); text-decoration: line-through; }
.cook-body { flex: 1; overflow-y: auto; display: grid; place-items: center; padding: 24px; }
.cook-step { max-width: 900px; width: 100%; text-align: center; }
.cook-n { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); }
.cook-kid { display: inline-block; margin-top: 12px; padding: 8px 18px; border-radius: 999px; background: #8B5CF6; color: #fff; font-weight: 800; font-size: 18px;
  animation: rise .3s cubic-bezier(.2, .9, .3, 1.2); }
.cook-text { font-size: clamp(24px, 3.6vw, 44px); font-weight: 650; line-height: 1.35; margin-top: 20px; text-wrap: balance; letter-spacing: -.5px; }
.cook-nav { display: flex; gap: 12px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cook-nav .btn { flex: 1; }
.cook-big { padding: 18px 24px; font-size: 19px; border-radius: 18px; }
.cook-done { text-align: center; max-width: 640px; }
.cook-done h2 { font-size: 34px; font-weight: 850; letter-spacing: -1px; }
.cook-done .cook-big { margin-top: 22px; }
@media (max-width: 860px) { .rc-cols { grid-template-columns: 1fr; } .rc-title { font-size: 26px; } .rc-hero { aspect-ratio: 4 / 3; } }

/* ── Setup flow ── */
.ob { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s ease-out; }
.ob-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ob-dots { display: flex; gap: 6px; flex: 1; justify-content: center; }
.ob-dot { display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 999px; font-size: 13px; font-weight: 750; color: var(--ink3); }
.ob-dot:not(.on):not(.done) { opacity: .75; }
.ob-dot.on { background: var(--accent-soft); color: var(--accent); }
.ob-dot.done { color: var(--good); }
.ob-body { flex: 1; overflow-y: auto; }
.ob-inner { max-width: 680px; margin: 0 auto; padding: 36px 22px 40px; }
.ob-h { font-size: 32px; font-weight: 850; letter-spacing: -1px; line-height: 1.1; text-wrap: balance; margin-bottom: 10px; }
.ob-p { color: var(--ink2); font-size: 16px; margin-bottom: 22px; max-width: 58ch; }
.ob-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.ob-foot .btn.primary { padding: 12px 22px; font-size: 15.5px; }
.ob .swatches { max-width: 440px; }
.ob .emojis { max-width: 560px; }
.ob-me { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.ob-person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }
.ob-bday { display: flex; flex-direction: column; gap: 2px; }
.ob-bday input { padding: 6px 9px; width: auto; }
.ob-group { margin: 22px 2px 8px; }
.ob-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 8px; align-items: start; }
.ob-tpl { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); transition: border-color .15s; }
.ob-tpl.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); grid-column: 1 / -1; }
.ob-tpl-h { display: flex; align-items: center; gap: 12px; padding: 11px 12px; width: 100%; text-align: left; }
.ob-tpl-h b { display: block; font-size: 14.5px; }
.ob-tpl-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface2); display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.ob-tick { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--ink2); flex-shrink: 0; }
.ob-tpl.on .ob-tick { background: var(--accent); color: #fff; }
.ob-cfg { padding: 4px 14px 6px; border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 14px; }
.ob-steps { padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; margin-bottom: 14px; }
.ob-steps .svg { vertical-align: -3px; color: var(--accent); }
.ob-done { display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 14px; font-weight: 750;
  background: transparent; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }

/* ── Setup checklist on Today ── */
.setup-card { margin-bottom: 16px; border-color: var(--accent); }
.setup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 6px; }
.setup-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; text-align: left; width: 100%; }
.setup-item:hover:not(:disabled) { background: var(--surface2); }
.setup-item.done { opacity: .55; cursor: default; }
.setup-item.done b { text-decoration: line-through; }
.setup-item .check { pointer-events: none; }

@media (max-width: 860px) {
  .ob-top { padding: 10px 14px; gap: 8px; }
  .ob-dot { padding: 0; width: 28px; height: 28px; justify-content: center; background: var(--surface2); }
  .ob-dot > span { display: none; }
  .ob-dot.on { background: var(--accent); color: #fff; }
  .ob-inner { padding: 24px 16px 30px; }
  .ob-h { font-size: 26px; }
  .ob-bday { width: 100%; flex-direction: row; align-items: center; gap: 8px; }
}

/* ── Family board (hub) ── */
body.hub-mode .side, body.hub-mode .top, body.hub-mode .bottom { display: none; }

.board-wrap { height: 100%; display: flex; flex-direction: column; gap: 18px; padding: 26px 30px; overflow-y: auto; }
.hb-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hb-clock { font-size: clamp(56px, 7vw, 108px); font-weight: 300; letter-spacing: -4px; line-height: .9; }
.hb-clock span { font-size: .32em; font-weight: 600; letter-spacing: 0; margin-left: 6px; color: var(--ink2); }
.hb-date { font-size: clamp(18px, 1.6vw, 26px); font-weight: 750; color: var(--accent); margin-top: 6px; }
.hb-fam { display: flex; gap: 16px; flex: 1; justify-content: center; flex-wrap: wrap; }
.hb-person { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 750; font-size: 15px; }
.hb-actions { display: flex; gap: 10px; }
.hb-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  font-weight: 750; font-size: 16px; }
.hb-btn:hover { background: var(--surface2); }
.hb-grid { display: grid; grid-template-columns: 1.35fr 1fr 1.1fr; gap: 18px; align-items: start; }
.hb-col { display: flex; flex-direction: column; gap: 18px; }
.hb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-sm); }
/* On a big wall/desk screen the board fits exactly one screen; each card scrolls inside itself if it has to. */
/* Widgets sit on a 12-column grid at preset sizes; dense packing fills gaps left by bigger cards. */
.hb-widgets { --row: 160px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(var(--row), auto); grid-auto-flow: row dense; gap: 18px; }
.hb-w { grid-column: span var(--w, 4); grid-row: span var(--h, 1); min-width: 0; position: relative; display: flex; flex-direction: column; }
.hb-w-body { min-height: 0; flex: 1; }
@media (max-width: 1100px) { .hb-w { grid-column: span max(6, var(--w, 4)); } }
@media (max-width: 860px) { .hb-w { grid-column: 1 / -1; } }
/* Edit mode */
.wg-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 18px; border-radius: 20px; background: var(--accent-soft); border: 2px dashed var(--accent); flex-shrink: 0; }
.wg-bar > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.wg-tray { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.wg-add, .wg-fixed { padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--line); font-weight: 750; font-size: 14px; }
.wg-add:hover, .wg-fixed:hover { border-color: var(--accent); color: var(--accent); }
.wg-fixed { align-self: flex-start; }
.wg-fixed.on { border-style: solid; }
.hb-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.wg-editing .hb-w { cursor: grab; touch-action: none; user-select: none; outline: 2px dashed transparent; outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; overflow: hidden; }
.wg-editing .hb-w-body { pointer-events: none; opacity: .75; overflow: hidden; }
.wg-tools { display: flex; align-items: center; gap: 8px; margin: -8px -8px 12px; padding: 6px 8px; border-radius: 14px; background: var(--surface2); }
.wg-grip { font-size: 20px; color: var(--ink2); padding: 0 4px; }
.wg-name { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-size { padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.wg-x { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-weight: 800; }
.wg-x:hover { background: var(--bad, #e5484d); color: #fff; }
.wg-resize { position: absolute; right: 4px; bottom: 4px; width: 30px; height: 30px; cursor: nwse-resize; touch-action: none; border-radius: 8px 0 18px 0;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%); opacity: .8; }
.wg-resizing { outline: 3px solid var(--accent) !important; transition: none; }
.wg-placeholder { opacity: .3; outline-style: dashed; }
.wg-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(1.5deg) scale(1.02); box-shadow: 0 24px 60px rgba(0,0,0,.25); opacity: .95; cursor: grabbing; }
.wg-ghost .hb-w-body { opacity: .75; overflow: hidden; }
.hb-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.hb-shop-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--surface2); font-weight: 650; font-size: 15.5px; text-align: left; }
.hb-shop-item .check { width: 20px; height: 20px; border-radius: 6px; }
.hb-shop-item:hover .check { border-color: var(--good); }
.hb-dinners { display: flex; flex-direction: column; gap: 4px; }
.hb-dinner-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; font-size: 16px; }
.hb-dinner-row b { width: 38px; color: var(--ink2); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hb-dinner-row.today { background: var(--accent-soft); }
.hb-dinner-row.today b { color: var(--accent); }
.hb-dinner-row.past { opacity: .5; }
.wg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
.wg-row.off { opacity: .55; }
.wg-ic { font-size: 22px; width: 30px; text-align: center; }
.wg-wide { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wg-row .icon-btn { width: 30px; height: 30px; font-weight: 800; }
.wg-row .icon-btn:disabled { opacity: .25; }
.hb-card h2 { font-size: 15px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); margin-bottom: 14px; }
.hb-list { display: flex; flex-direction: column; gap: 10px; }
.hb-ev { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 18px; text-align: left; width: 100%;
  background: var(--surface); background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-left: 7px solid var(--c); }
.hb-ev b { display: block; font-size: clamp(17px, 1.5vw, 22px); }
.hb-ev em { font-style: normal; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; background: var(--c); color: #fff;
  padding: 3px 9px; border-radius: 999px; margin-left: 2px; }
.hb-ev.next { box-shadow: 0 0 0 3px transparent; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent); }
.hb-ev.past { opacity: .45; }
.hb-time { width: 86px; flex-shrink: 0; font-size: clamp(16px, 1.3vw, 20px); font-weight: 850; color: var(--c); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.hb-sub { color: var(--ink2); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.hb-ev .hb-sub { display: block; margin-top: 2px; }
.hb-big { font-size: clamp(20px, 1.8vw, 28px); font-weight: 800; display: block; margin-bottom: 6px; }
.hb-out { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.hb-out-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: transparent; background: color-mix(in srgb, var(--c) 11%, transparent); }
.hb-out-row b { font-size: 17px; }
.hb-rem { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 17px; }
.hb-rem .hb-sub { margin-left: auto; }
.hb-kid { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.hb-kid:last-child { border-bottom: none; }
.hb-kid-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hb-kid-h b { font-size: 18px; flex: 1; }
.hb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-chore { padding: 11px 15px; border-radius: 14px; font-weight: 750; font-size: 15.5px; background: var(--surface2); border: 2px solid transparent; }
.hb-chore.done { background: var(--surface); background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); text-decoration: line-through; color: var(--ink2); }
.hb-empty { color: var(--ink2); font-size: 18px; padding: 20px 0; }
.hb-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hb-day { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.hb-day b { font-size: 16px; }
.hb-day .chip { font-size: 13px; padding: 4px 8px; }
.hb-tip { background: transparent; border-style: dashed; }


.hb-weather { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.hb-weather-add { font-weight: 750; font-size: 16px; color: var(--ink2); }
.hb-wx-ic { font-size: clamp(40px, 4vw, 60px); line-height: 1; }
.hb-wx-main { display: flex; flex-direction: column; gap: 2px; }
.hb-wx-temp { font-size: clamp(30px, 3vw, 44px); font-weight: 300; letter-spacing: -1.5px; line-height: 1; }
.hb-hours { display: flex; gap: 14px; margin-left: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.hb-hour { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 18px; }
.hb-hour b { font-size: 15px; }
.hb-day-wx { display: inline-flex; align-items: baseline; gap: 5px; font-size: 16px; }
.hb-day-wx .muted { font-size: 14px; }
@media (max-width: 1300px) { .hb-hours { display: none; } }


/* ── Board: family row ── */
.hb-family { display: flex; gap: 10px; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 10px 14px; box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; }
.hb-family::-webkit-scrollbar { display: none; }
.hb-member { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 999px; min-width: 0; flex: 1 1 0; text-align: left; transition: background .15s; }
.hb-member:hover { background: transparent; background: color-mix(in srgb, var(--c) 10%, transparent); }
.hb-ring { position: relative; width: 66px; height: 66px; display: grid; place-items: center; flex-shrink: 0; }
.hb-ring .av { box-shadow: none; }
.hb-ring-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hb-ring-track { fill: none; stroke: transparent; stroke: color-mix(in srgb, var(--c) 18%, transparent); stroke-width: 5; }
.hb-ring-fill { fill: none; stroke: var(--c); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.hb-member-t { display: flex; flex-direction: column; min-width: 0; }
.hb-member-t b { font-size: 17px; }
.hb-status { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-btn-soft { color: var(--accent); border-color: var(--line); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* ── Board: weather scenes. Each card's background is a little picture of the day. ── */
:root {
  --wx-sun: linear-gradient(160deg, #FFF6DA 0%, #FFE7B8 100%); --wx-sun-glow: rgba(255, 196, 61, .55);
  --wx-partly: linear-gradient(160deg, #FFF5E1 0%, #E6ECF4 100%);
  --wx-cloud: linear-gradient(160deg, #F1F3F7 0%, #DFE5ED 100%);
  --wx-rain: linear-gradient(160deg, #E6F0FB 0%, #CFE1F6 100%); --wx-streak: rgba(59, 130, 246, .13);
  --wx-storm: linear-gradient(160deg, #E9E4F6 0%, #D3CBEC 100%);
  --wx-snow: linear-gradient(160deg, #F6F9FC 0%, #E4EEF7 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wx-sun: linear-gradient(160deg, #3A3120 0%, #463720 100%); --wx-sun-glow: rgba(255, 196, 61, .28);
    --wx-partly: linear-gradient(160deg, #332D24 0%, #2A2E38 100%);
    --wx-cloud: linear-gradient(160deg, #2B2D35 0%, #252830 100%);
    --wx-rain: linear-gradient(160deg, #1F2B3C 0%, #1B2638 100%); --wx-streak: rgba(96, 165, 250, .16);
    --wx-storm: linear-gradient(160deg, #2A2440 0%, #221D36 100%);
    --wx-snow: linear-gradient(160deg, #2A3038 0%, #262C35 100%);
  }
}
:root[data-theme="dark"] {
  --wx-sun: linear-gradient(160deg, #3A3120 0%, #463720 100%); --wx-sun-glow: rgba(255, 196, 61, .28);
  --wx-partly: linear-gradient(160deg, #332D24 0%, #2A2E38 100%);
  --wx-cloud: linear-gradient(160deg, #2B2D35 0%, #252830 100%);
  --wx-rain: linear-gradient(160deg, #1F2B3C 0%, #1B2638 100%); --wx-streak: rgba(96, 165, 250, .16);
  --wx-storm: linear-gradient(160deg, #2A2440 0%, #221D36 100%);
  --wx-snow: linear-gradient(160deg, #2A3038 0%, #262C35 100%);
}
.wx-sun { background: radial-gradient(circle at 88% 12%, var(--wx-sun-glow) 0 38px, transparent 90px), var(--wx-sun); }
.wx-partly { background: radial-gradient(circle at 88% 12%, var(--wx-sun-glow) 0 22px, transparent 60px), var(--wx-partly); }
.wx-cloud { background: var(--wx-cloud); }
.wx-rain { background: repeating-linear-gradient(105deg, transparent 0 11px, var(--wx-streak) 11px 12.5px), var(--wx-rain); }
.wx-storm { background: repeating-linear-gradient(105deg, transparent 0 9px, var(--wx-streak) 9px 11px), var(--wx-storm); }
.wx-snow { background: radial-gradient(circle, rgba(148, 163, 184, .35) 1.5px, transparent 2px) 0 0 / 16px 16px, var(--wx-snow); }

/* ── Board: day cards ── */
.hb-week { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hb-day { gap: 8px; min-width: 0; }
.hb-day-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hb-day-top b { font-size: 17px; }
.hb-day-ic { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12)); }
.hb-range { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.hb-range b { font-size: 17px; }
.hb-bar { flex: 1; height: 8px; border-radius: 999px; background: transparent; background: color-mix(in srgb, var(--ink) 9%, transparent); position: relative; }
.hb-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.hb-rain { align-self: flex-start; font-size: 12.5px; font-weight: 750; padding: 3px 10px; border-radius: 999px; color: #1D4ED8;
  background: linear-gradient(90deg, rgba(59, 130, 246, .28) var(--p), rgba(59, 130, 246, .08) var(--p)); }
:root[data-theme="dark"] .hb-rain { color: #93C5FD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-rain { color: #93C5FD; } }
.hb-day-evs { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hb-weather[class*="wx-"] { border-color: transparent; }
/* Header, family row and days keep their size; only the middle grid flexes. */
.board-wrap > .hb-head, .board-wrap > .hb-family, .board-wrap > .hb-week { flex-shrink: 0; }
/* Narrower screens: name and status sit under each face so everyone fits in one row. */
@media (max-width: 1300px) {
  .hb-member { flex-direction: column; gap: 4px; padding: 6px 4px; border-radius: 18px; text-align: center; align-items: center; }
  .hb-member-t { align-items: center; max-width: 100%; }
  .hb-member-t b { font-size: 15px; }
  .hb-status { font-size: 12px; max-width: 100%; }
}
@media (max-width: 1100px) { .hb-week { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
@media (max-width: 860px) {
  .hb-family { justify-content: flex-start; }
  .hb-member { flex: 0 0 auto; }
  .hb-member-t { display: none; }
}

/* Soft alert for reminders and events (alarms use the full orange screen) */
.ring.soft { background: linear-gradient(160deg, #3B82F6, #8B5CF6); }
.ring.soft .btn { color: #3B5BDB; }
.hub-gate { position: fixed; inset: 0; z-index: 250; background: rgba(23, 18, 30, .82); color: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; font-size: 18px; text-align: center; padding: 24px; }
.hub-gate b { font-size: 34px; font-weight: 850; letter-spacing: -1px; }
.hub-gate-bell { font-size: 72px; }

@media (max-width: 1100px) {
  .hb-grid { grid-template-columns: 1fr 1fr; }
  .hb-chores { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .board-wrap { padding: 16px; }
  .hb-grid { grid-template-columns: 1fr; }
  .hb-fam { justify-content: flex-start; }
  .hb-person .av { --s: 44px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Phone pass (iPhone mini and up) ── */
@media (max-width: 860px) {
  .fb-tab { display: none; } /* Feedback lives in the More menu on phones */
  .rc-search { flex-basis: 100%; }
  .meal-intro { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .member-row { flex-wrap: wrap; row-gap: 8px; }
  .member-row > .grow { flex: 1 1 calc(100% - 70px); }
  .member-row > .btn, .member-row > .icon-btn { margin-left: 62px; }
  .member-row > .btn ~ .btn, .member-row > .btn ~ .icon-btn { margin-left: 0; }
  .chore-today { flex-wrap: wrap; }
  .chore-today > .grow { flex: 1 1 calc(100% - 70px); }
  .chore-today > .chore-who { margin-left: 60px; }
  .countdown small { font-size: 0; }
  .countdown small::after { content: 'days'; font-size: 11px; }
  .hb-head { gap: 12px; }
  .hb-head > div:first-child { flex: 1; }
  .hb-weather { flex: 1 1 100%; order: 3; }
  .hb-actions { flex: 1 1 100%; order: 4; overflow-x: auto; scrollbar-width: none; }
  .hb-actions::-webkit-scrollbar { display: none; }
  .hb-btn { white-space: nowrap; padding: 10px 14px; font-size: 14.5px; flex-shrink: 0; }
  .hb-family { overflow-x: auto; }
  .board-wrap { padding: 16px 16px 100px; }
}

/* Dark map tiles to match the dark theme */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); } }

/* Ringing takeover: above everything, big thumb-sized buttons */
.ring { z-index: 5000; overscroll-behavior: contain; touch-action: none; }
.ring .ring-cancel { min-width: min(320px, 100%); padding: 20px; font-size: 20px; font-weight: 850; margin-top: 22px; }
.ring-snooze { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.ring-snooze span { font-weight: 800; opacity: .9; width: 100%; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.ring .ring-snooze .btn { min-width: 0; flex: 1 1 0; max-width: 104px; padding: 16px 10px; }
.ring.quiet .bell { animation: none; opacity: .7; }
.ring-quiet { font-size: 15px; background: rgba(0, 0, 0, .18); padding: 6px 14px; border-radius: 999px; }

/* Chance of rain as water filling the day card, with a gentle wave at the exact level */
.hb-day { position: relative; overflow: hidden; isolation: isolate; }
.hb-day.has-tub.wx-rain { background: var(--surface); } /* the water replaces the rain streaks */
.hb-day.has-tub.wx-storm { background: var(--wx-storm); }
.hb-tub { position: absolute; inset: 0; z-index: -1; pointer-events: none; --water: rgba(59, 130, 246, .13); --water-top: rgba(59, 130, 246, .2); }
.hb-tub i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--p); background: linear-gradient(180deg, var(--water-top), var(--water)); transition: height 1.2s ease; }
.hb-tub i::before, .hb-tub i::after { content: ''; position: absolute; left: 0; bottom: 100%; width: 200%; height: 9px;
  background: var(--water-top); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6 C 20 0 40 0 60 6 S 100 12 120 6 V12 H0Z' fill='%23000'/%3E%3C/svg%3E") repeat-x 0 0 / 50% 100%; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M0 6 C 20 0 40 0 60 6 S 100 12 120 6 V12 H0Z' fill='%23000'/%3E%3C/svg%3E") repeat-x 0 0 / 50% 100%;
  animation: tub-wave 7s linear infinite; }
.hb-tub i::after { opacity: .55; height: 7px; animation-duration: 11s; animation-direction: reverse; }
@keyframes tub-wave { to { transform: translateX(-50%); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-tub { --water: rgba(96, 165, 250, .14); --water-top: rgba(96, 165, 250, .24); } }
:root[data-theme="dark"] .hb-tub { --water: rgba(96, 165, 250, .14); --water-top: rgba(96, 165, 250, .24); }
@media (prefers-reduced-motion: reduce) { .hb-tub i::before, .hb-tub i::after { animation: none; } }

/* Chance (pale) vs amount (deeper) of rain */
.hb-tub { --water: rgba(96, 165, 250, .08); --water-top: rgba(96, 165, 250, .13); --deep: rgba(37, 99, 235, .2); --deep-top: rgba(37, 99, 235, .3); }
.hb-tub i.amt { height: var(--a); background: linear-gradient(180deg, var(--deep-top), var(--deep)); }
.hb-tub i.amt::before, .hb-tub i.amt::after { background: var(--deep-top); animation-duration: 9s; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-tub { --water: rgba(96, 165, 250, .08); --water-top: rgba(96, 165, 250, .14); --deep: rgba(96, 165, 250, .22); --deep-top: rgba(96, 165, 250, .32); } }
:root[data-theme="dark"] .hb-tub { --water: rgba(96, 165, 250, .08); --water-top: rgba(96, 165, 250, .14); --deep: rgba(96, 165, 250, .22); --deep-top: rgba(96, 165, 250, .32); }
.hb-rain .hb-chance { opacity: .6; font-weight: 700; }
.hb-rain .hb-mm { margin-left: 6px; }
