/* Family Hub. One idea carries the design: the kids' two homes, shown as color.
   Navy ink on cool paper stays quiet so the household colors can do the talking. */
@font-face { font-family: 'FH Text'; src: url('/fonts/text-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'FH Text'; src: url('/fonts/text-500.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'FH Text'; src: url('/fonts/text-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'FH Display'; src: url('/fonts/display-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'FH Kid'; src: url('/fonts/kid-700.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --paper: #eef2f8; --surface: #ffffff; --sunk: #e3e9f2; --ink: #14213d; --ink-2: #47556f; --ink-3: #566480; --line: #d6deea;
  --action: #14213d; --on-action: #ffffff; --ok: #15653a; --warn: #8a4b00; --bad: #b3261e; --focus: #1769c2;
  --shadow: 0 1px 2px rgba(20, 33, 61, .08); --lift: 0 12px 32px rgba(20, 33, 61, .22);
  --display: 'FH Display', Georgia, serif; --text: 'FH Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --h-weight: 600; --r-s: 8px; --r-m: 14px; --r-l: 22px;
  --tab-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme='dark'] {
  --paper: #0e1830; --surface: #17233f; --sunk: #0a1226; --ink: #eaf0fa; --ink-2: #b5c2d8; --ink-3: #98a7c0; --line: #2b3a5a;
  --action: #eaf0fa; --on-action: #14213d; --ok: #5fd08f; --warn: #f3b35c; --bad: #ff8a80; --focus: #7db8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --lift: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
body.kid { --display: 'FH Kid', var(--text); --h-weight: 700; --r-m: 18px; --r-l: 26px; }

/* Member colors. --c is the color, --on-c is text that sits on it. */
.c-lagoon { --c: #0b7a75; --on-c: #fff; } .c-marigold { --c: #f2b01e; --on-c: #14213d; } .c-berry { --c: #b81d5b; --on-c: #fff; }
.c-sky { --c: #1769c2; --on-c: #fff; } .c-clover { --c: #2b7a3d; --on-c: #fff; } .c-plum { --c: #6b3fa0; --on-c: #fff; }
.c-tangerine { --c: #f08a3c; --on-c: #14213d; } .c-slate { --c: #475a78; --on-c: #fff; } .c-none { --c: #475a78; --on-c: #fff; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--h-weight); line-height: 1.2; text-wrap: balance; word-spacing: -.08em; }
h2 { font-size: 1.25rem; }
h3 { font-family: var(--text); font-weight: 600; font-size: 1rem; word-spacing: normal; }
body.kid h1, body.kid h2 { word-spacing: normal; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1:focus, h1:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 10px 16px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-2); } .small { font-size: .875rem; } .tiny { font-size: .8125rem; } .strong { font-weight: 600; }
.bad-text { color: var(--bad); } .ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; } .wrap-any { overflow-wrap: anywhere; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } .stack-s { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; } .stack-l { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .between { justify-content: space-between; } .nogap { gap: 4px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Shell */
.shell { min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; }
main { min-width: 0; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
main:focus { outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.page.narrow { max-width: 720px; }
.topbar { display: flex; align-items: center; gap: 8px; padding-top: calc(10px + var(--safe-t)); padding-bottom: 2px; }
.topbar h1 { font-size: 1.625rem; flex: 1; min-width: 0; }
.tabs { position: fixed; inset: auto 0 0 0; z-index: 20; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--line); }
.tabs ul { list-style: none; margin: 0; padding: 0; height: var(--tab-h); display: grid; grid-template-columns: repeat(6, 1fr); }
.tabs a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; height: 100%; text-decoration: none; color: var(--ink-2); font-size: .6875rem; font-weight: 500; }
.tabs a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current='page']::before { content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
.tabs .brand { display: none; }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .6875rem; font-weight: 600; line-height: 18px; text-align: center; }
[data-theme='dark'] .badge { color: #3b0a07; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 216px 1fr; grid-template-rows: 1fr; }
  main { padding-bottom: 32px; }
  .tabs { position: sticky; top: 0; inset: auto; height: 100dvh; padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line); order: -1; }
  .tabs .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-family: var(--display); font-weight: var(--h-weight); font-size: 1.125rem; }
  .tabs .brand img { width: 30px; height: 30px; border-radius: 8px; }
  .tabs ul { height: auto; display: grid; grid-template-columns: 1fr; gap: 2px; }
  .tabs a { display: flex; align-items: center; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: 10px; font-size: .9375rem; }
  .tabs a:hover { background: var(--sunk); }
  .tabs a[aria-current='page'] { background: var(--sunk); }
  .tabs a[aria-current='page']::before { display: none; }
  .tabs .badge { position: static; margin-left: auto; }
  .page { padding: 24px 32px; }
  .topbar { padding-top: 12px; }
}

/* The flood: tonight's home fills the top of Home. */
.flood { background: var(--c); color: var(--on-c); padding: calc(14px + var(--safe-t)) 16px 0; }
.flood-in { max-width: 1120px; margin: 0 auto; display: grid; gap: 6px; }
.flood h1 { font-size: clamp(1.875rem, 7.4vw, 2.75rem); max-width: 18ch; }
body.kid .flood h1 { letter-spacing: -.01em; }
.flood .bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flood .sub { font-weight: 500; max-width: 46ch; }
.flood .iconbtn { color: inherit; }
.flood .iconbtn:hover { background: color-mix(in srgb, var(--on-c) 16%, transparent); }
.flood.neutral { --c: #14213d; --on-c: #fff; }
[data-theme='dark'] .flood.neutral { --c: #24355c; }
.flood-foot { padding-bottom: 0; margin-top: 14px; transform: translateY(26px); }
.after-flood { padding-top: 46px; }
@media (min-width: 900px) { .flood { padding: 28px 32px 0; } .flood-in { max-width: 1056px; } }

/* The ribbon: two weeks of nights. A handoff day is split corner to corner. */
.ribbon { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--lift); padding: 8px; color: var(--ink); }
.ribbon ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.rday { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.rday .dow { font-size: .6875rem; font-weight: 500; color: var(--ink-2); }
.rcell { width: 100%; aspect-ratio: 1 / 1.16; max-height: 54px; border-radius: 7px; display: grid; place-items: center; font-size: .8125rem; font-weight: 600; background: var(--sunk); color: var(--ink-2); }
.rcell.on { background: var(--a); color: var(--on-a); }
.rcell.swap { background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); color: transparent; position: relative; }
.rcell.swap::after { content: attr(data-d); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 1.45em; padding: 0 2px; border-radius: .8em; background: var(--surface); color: var(--ink); line-height: 1.45; text-align: center; }
.rcell.proposed { background: repeating-linear-gradient(135deg, var(--a) 0 4px, transparent 4px 8px); color: var(--ink); }
.rday.now .rcell { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: var(--ink-2); padding: 8px 2px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.legend i.split { background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); }

/* Lists: most of the app is honest rows, not cards. */
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-head .btn { flex: none; white-space: nowrap; }
.sec-head a, .link { color: var(--ink-2); font-size: .875rem; font-weight: 500; text-underline-offset: 3px; }
.rows { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; background: none; text-align: left; text-decoration: none; color: inherit; }
.row + .row { border-top: 1px solid var(--line); }
a.row:hover, button.row:hover { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.row .when { flex: none; width: 66px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); line-height: 1.2; }
.row .ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); }
.row .ico.tint { background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); }
.row .bar { flex: none; width: 4px; align-self: stretch; border-radius: 2px; background: var(--c); }
.row .t { font-weight: 500; overflow-wrap: anywhere; } .row .s { font-size: .875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.row .chev { color: var(--ink-3); flex: none; }
.empty { padding: 20px 16px; color: var(--ink-2); background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); }
.empty .btn { margin-top: 10px; }
.needs { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-radius: var(--r-m); box-shadow: inset 4px 0 0 var(--warn), var(--shadow); overflow: hidden; }
.needs .row + .row { border-top-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 760px) { .cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .cols.main-side { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--action); color: var(--on-action); font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.15); } [data-theme='dark'] .btn:hover { filter: brightness(.92); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.soft { background: var(--sunk); color: var(--ink); }
.btn.line-b { background: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; } [data-theme='dark'] .btn.danger { color: #3b0a07; }
.btn.ok { background: var(--ok); color: #fff; } [data-theme='dark'] .btn.ok { color: #06281a; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: .875rem; }
.btn.block { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; position: relative; width: 44px; height: 44px; flex: none; border: 0; background: none; color: var(--ink); border-radius: 12px; cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--sunk); }
.iconbtn .badge { top: 2px; left: auto; right: 0; margin: 0; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 15; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--action); color: var(--on-action); box-shadow: var(--lift); display: grid; place-items: center; cursor: pointer; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunk); border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg a { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font-weight: 500; font-size: .9375rem; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.seg [aria-pressed='true'], .seg [aria-selected='true'], .seg [aria-current='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.pick { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.pick button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.pick button[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.chip.solid { background: var(--c); color: var(--on-c); }
.av { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: var(--on-c); font-weight: 600; font-size: .9375rem; }
.av.s { width: 28px; height: 28px; font-size: .75rem; } .av.l { width: 56px; height: 56px; font-size: 1.5rem; }
.av.emoji { font-size: 1.15em; }

/* Forms */
.field { display: grid; gap: 4px; min-width: 0; }
.field > label, .field > .lbl { font-size: .875rem; font-weight: 500; color: var(--ink-2); }
.hint { font-size: .8125rem; color: var(--ink-2); }
input[type='text'], input[type='password'], input[type='email'], input[type='tel'], input[type='url'], input[type='number'], input[type='date'], input[type='time'], input[type='datetime-local'], input[type='search'], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; }
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline-offset: 0; outline-width: 2px; }
input[aria-invalid='true'] { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { display: inline-flex; align-items: center; min-height: 42px; min-width: 44px; justify-content: center; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; font-size: .9375rem; background: var(--surface); }
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices label:has(input:checked) { background: var(--action); color: var(--on-action); border-color: var(--action); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatches label { width: 44px; padding: 0; border: 0; background: var(--c); }
.swatches label:has(input:checked) { background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 10px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.form-row > *, .form-row input { min-width: 0; }
.error { color: var(--bad); font-size: .9375rem; font-weight: 500; }

/* Sheets: bottom sheet on phones, dialog on larger screens */
dialog.sheet { padding: 0; border: 0; color: var(--ink); background: var(--surface); width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--lift); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: rise .22s ease-out; }
dialog.sheet::backdrop { background: rgba(10, 18, 38, .55); }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 18px; }
.sheet-head h2 { flex: 1; min-width: 0; }
.sheet-body { padding: 4px 18px 16px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; }
.sheet-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; min-width: 120px; }
@media (min-width: 640px) { dialog.sheet { width: 560px; margin: auto; border-radius: var(--r-l); } }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--action); color: var(--on-action); box-shadow: var(--lift); font-weight: 500; }
.toast.err { background: var(--bad); color: #fff; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; font-weight: 500; font-size: .9375rem; background: var(--c); color: var(--on-c); }
.banner.top { padding-top: calc(10px + var(--safe-t)); }
.banner .btn { margin-left: auto; }
.offline { --c: #475a78; --on-c: #fff; }

/* Calendar */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.cal-nav h2 { min-width: min(9.5em, 40vw); text-align: center; font-size: 1.125rem; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow); }
.month .dh { background: var(--surface); text-align: center; font-size: .75rem; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.mcell { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 66px; padding: 4px 3px 12px; border: 0; background: var(--surface); text-align: left; cursor: pointer; min-width: 0; overflow: hidden; }
.mcell.out { background: color-mix(in srgb, var(--surface) 55%, var(--sunk)); color: var(--ink-3); }
.mcell[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--ink); }
.mcell .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .8125rem; font-weight: 600; }
.mcell.today .num { background: var(--ink); color: var(--paper); }
.mcell .band { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: var(--a, transparent); color: var(--on-a); font-size: 0; }
.mcell .band.swap { background: linear-gradient(115deg, var(--a) 0 50%, var(--b) 50% 100%); }
.mcell .band.proposed { background: repeating-linear-gradient(135deg, var(--a) 0 3px, transparent 3px 6px); }
.mcell .dots { display: flex; gap: 2px; flex-wrap: wrap; padding-left: 2px; }
.mcell .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--ink-3)); }
.mcell .ev { display: none; }
.k-sport { --k: #1769c2; } .k-school { --k: #6b3fa0; } .k-med { --k: #b3261e; } .k-fun { --k: #b81d5b; } .k-off { --k: #2b7a3d; } .k-other { --k: #475a78; } .k-handoff { --k: #a65b00; }
[data-theme='dark'] .k-sport { --k: #7db8ff; } [data-theme='dark'] .k-school { --k: #c7a6f5; } [data-theme='dark'] .k-med { --k: #ff8a80; } [data-theme='dark'] .k-fun { --k: #f58fb8; } [data-theme='dark'] .k-off { --k: #7fd691; } [data-theme='dark'] .k-other { --k: #a8b6cd; } [data-theme='dark'] .k-handoff { --k: #f3b35c; }
@media (min-width: 900px) {
  .mcell { min-height: 112px; padding: 6px 6px 14px; }
  .mcell .dots { display: none; }
  .mcell .ev { display: block; font-size: .75rem; font-weight: 500; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--k) 15%, var(--surface)); border-left: 3px solid var(--k); }
  .mcell .more { font-size: .6875rem; color: var(--ink-2); padding-left: 4px; }
}
.mcell .more { display: none; } @media (min-width: 900px) { .mcell .more { display: block; } }
.week { display: grid; gap: 10px; }
.wday { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.wday.today { box-shadow: inset 0 0 0 2px var(--ink); }
.wday-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--a, var(--sunk)); color: var(--on-a, var(--ink)); font-weight: 600; font-size: .9375rem; width: 100%; border: 0; cursor: pointer; text-align: left; }
.wday-head.swap { background: linear-gradient(115deg, var(--a) 0 58%, var(--b) 58% 100%); color: var(--on-a); }
.wday-head.swap > :last-child { color: var(--on-b); }
.wday .none { padding: 10px 12px; color: var(--ink-2); font-size: .875rem; }
@media (min-width: 1120px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; } .wday .row { padding: 8px; gap: 8px; } .wday .row .when { width: auto; } .wday .row { flex-wrap: wrap; } }
.cev { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; border-top: 1px solid var(--line); }
.cev:first-child { border-top: 0; }
.cev:hover { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.cev .pin { flex: none; width: 4px; align-self: stretch; min-height: 34px; border-radius: 2px; background: var(--k, var(--ink-3)); }
.cev .tm { flex: none; width: 66px; line-height: 1.25; font-size: .8125rem; font-weight: 600; color: var(--ink-2); padding-top: 1px; }
.cev.gone .t { text-decoration: line-through; color: var(--ink-3); }
@media (min-width: 900px) { .week .cev { flex-wrap: wrap; padding: 8px; gap: 2px 6px; } .week .cev .pin { display: none; } .week .cev .tm { width: 100%; } .week .cev { border-left: 3px solid var(--k); } }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.filters button { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.filters button[aria-pressed='true'] { background: var(--action); color: var(--on-action); border-color: var(--action); }

/* Messages */
.chat-wrap { display: grid; gap: 16px; }
.chat-pane { display: flex; flex-direction: column; height: calc(100dvh - var(--tab-h) - var(--safe-b)); background: var(--paper); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head .t { font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.msg { display: flex; gap: 8px; max-width: 86%; align-items: flex-end; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 8px 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.me .bubble { background: var(--action); color: var(--on-action); }
.msg.flash .bubble { box-shadow: 0 0 0 3px var(--focus); }
.msg .who { font-size: .75rem; font-weight: 600; color: var(--ink-2); margin: 6px 0 1px 2px; }
.msg img { border-radius: 10px; max-height: 280px; margin: 4px 0; cursor: zoom-in; }
.msg .fileln { display: flex; align-items: center; gap: 6px; text-decoration: underline; font-weight: 500; }
.stamp { align-self: center; font-size: .75rem; color: var(--ink-2); padding: 8px 0 4px; }
.receipt { align-self: flex-end; font-size: .75rem; color: var(--ink-2); padding: 0 4px 4px; }
.typing { font-size: .8125rem; color: var(--ink-2); padding: 0 14px 4px; min-height: 22px; }
.composer { display: flex; gap: 6px; align-items: flex-end; padding: 8px 10px; background: var(--surface); border-top: 1px solid var(--line); }
.composer textarea { min-height: 44px; max-height: 140px; padding: 10px 12px; border-radius: 22px; resize: none; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--action); color: var(--on-action); display: grid; place-items: center; flex: none; cursor: pointer; }
.pending-files { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 6px; background: var(--surface); }
@media (min-width: 900px) {
  .chat-layout { display: grid; grid-template-columns: 340px 1fr; height: 100dvh; }
  .chat-layout .chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
  .chat-pane { height: 100dvh; }
  .chat-head .back { display: none; }
}
@media (max-width: 899.98px) { .chat-layout.open .chat-list { display: none; } .chat-layout:not(.open) .chat-pane { display: none; } main.in-thread { padding-bottom: 0; } }

/* Kids */
.jar-card { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 14px 16px; }
.jar svg { display: block; width: 96px; height: 118px; }
.pts { font-family: var(--display); font-weight: var(--h-weight); font-size: 2.25rem; line-height: 1; }
.tick { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink-3); background: none; display: grid; place-items: center; cursor: pointer; color: transparent; }
.tick:hover { border-color: var(--ink); }
.tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
[data-theme='dark'] .tick.done { color: #06281a; }
.tick.wait { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ach { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; text-align: center; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); font-size: .8125rem; }
.ach .e { font-size: 1.75rem; line-height: 1; }
.ach.locked .e { filter: grayscale(1); opacity: .35; }
.ach.locked { color: var(--ink-2); }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 110px; padding-top: 16px; }
.barcol { display: grid; align-content: end; justify-items: center; height: 100%; gap: 4px; font-size: .6875rem; color: var(--ink-2); min-width: 0; }
.barcol i { display: block; width: 100%; max-width: 30px; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.barcol b { font-weight: 600; color: var(--ink); }

/* Family hub tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 8px; align-content: start; min-height: 112px; padding: 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.tile:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.tile .t { font-weight: 600; } .tile .s { font-size: .8125rem; color: var(--ink-2); }
.tile .badge { top: 10px; right: 10px; left: auto; position: absolute; margin: 0; }

/* Requests */
.status { font-weight: 600; font-size: .8125rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

/* Plan painter */
.painter { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.painter .dh { text-align: center; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.painter button { aspect-ratio: 1 / .9; min-height: 40px; border: 0; border-radius: 8px; background: var(--c); color: var(--on-c); font-weight: 600; cursor: pointer; }

/* Map */
.map { position: relative; height: 320px; border-radius: var(--r-m); overflow: hidden; background: var(--sunk); touch-action: none; user-select: none; cursor: grab; }
.map .tiles-layer { position: absolute; inset: 0; }
.map img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map .pin { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.map .halo { position: absolute; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, transparent); transform: translate(-50%, -50%); pointer-events: none; }
.map .zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; }
.map .zoom button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1.25rem; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.map .credit { position: absolute; right: 0; bottom: 0; background: rgba(255, 255, 255, .85); color: #14213d; font-size: .6875rem; padding: 1px 6px; }
.map .credit a { color: inherit; }

/* Sign in */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #0b7a75 0 50%, #f2b01e 50% 100%); }
.auth-card { width: min(100%, 460px); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--lift); padding: 24px 20px; display: grid; gap: 16px; }
.auth-card.wide { width: min(100%, 620px); }
.auth-card h1 { font-size: 1.75rem; }
.brandline { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: var(--h-weight); }
.brandline img { width: 36px; height: 36px; border-radius: 9px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.125rem; letter-spacing: .04em; padding: 10px 12px; background: var(--sunk); border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.skeleton { height: 120px; border-radius: var(--r-m); background: var(--sunk); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .tabs, .fab, .no-print, #banners, .toasts, #toasts { display: none !important; } body { background: #fff; color: #000; } .shell { display: block; } main { padding: 0; } .page { max-width: none; } .sec, .rows, .time-card { break-inside: avoid; } }

/* Added with the expansion */
main.enter > * { animation: settle .18s ease-out; }
@keyframes settle { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.btn, .iconbtn, .tick, .tile, .row { transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:active, .iconbtn:active, .tick:active { transform: scale(.96); }
.tick.done { animation: pop .22s ease-out; }
@keyframes pop { 50% { transform: scale(1.14); } }
.msgtime { display: block; font-size: .6875rem; color: var(--ink-2); padding: 2px 4px 0; }
.msg.me .msgtime { text-align: right; }
.meter { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .3s ease; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > .grow { flex: 1 1 55%; }
.row.wrap > .line { margin-left: auto; }
details.more-rows > summary { list-style: none; cursor: pointer; }
details.more-rows > summary::-webkit-details-marker { display: none; }
details.more-rows > summary .chev { transition: transform .15s ease; }
details.more-rows[open] > summary .chev { transform: rotate(90deg); }
details.more-rows .row { background: color-mix(in srgb, var(--sunk) 30%, transparent); }
.announce { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 4px 0 0 var(--focus), var(--shadow); text-decoration: none; color: inherit; }
.announce.urgent { box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.announce .t { font-weight: 600; } .announce .s { font-size: .875rem; color: var(--ink-2); }
.ach-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.checklist .ok-mark { color: var(--ok); } .checklist .no-mark { color: var(--warn); }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .8125rem; color: var(--ink-2); }
.pts-hist { font-weight: 600; } .pts-hist.up { color: var(--ok); } .pts-hist.down { color: var(--bad); }

.item-text { min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
@media (max-width: 380px) { .seg button, .seg a { padding: 0 9px; } }
.d-short { display: none; }
.wday-head .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wday-head > :first-child { flex: none; }
@media (min-width: 1120px) { .d-long { display: none; } .d-short { display: inline; } }

/* Parenting time */
.splitbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--sunk); gap: 2px; }
.splitbar span { background: var(--c); min-width: 4px; }
.splitbar .empty-bar { flex: 1; background: none; }
.time-card { display: grid; gap: 14px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 16px; }
.time-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.time-col { display: grid; gap: 2px; align-content: start; min-width: 0; }
.time-col .line { margin-bottom: 4px; }
.time-col .big { font-family: 'FH Display', Georgia, serif; font-size: 1.75rem; line-height: 1.15; }
.time-col .pct { font-weight: 600; font-size: 1.0625rem; }
.time-mini { display: grid; gap: 10px; padding: 14px; }
.time-mini .who { display: flex; justify-content: space-between; gap: 12px; font-size: .9375rem; }
@media print { .time-card { box-shadow: none; border: 1px solid #999; } .splitbar span { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
.seg.fill { display: flex; width: 100%; }
.seg.fill button { flex: 1 1 0; padding: 0 6px; }
.time-src { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; margin: 6px 0 0; font-size: .75rem; color: var(--ink-2); max-width: 220px; }
.time-src dt, .time-src dd { margin: 0; }
.time-src dd { font-weight: 600; color: var(--ink); }
.print-only { display: none; }
@media print { .print-only { display: block; } .topbar a.iconbtn, .topbar .btn { display: none !important; } }
/* Reward tiers and points */
.tiers { display: grid; gap: 10px; }
.tier { display: grid; gap: 8px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 14px 16px; }
.tier.ready { box-shadow: var(--shadow), inset 0 0 0 2px var(--ok); }
.tier .t { font-weight: 600; }
.tier .s { font-size: .8125rem; color: var(--ink-2); }
.tier-badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sunk); color: var(--ink); font-weight: 700; font-size: .875rem; margin-right: 10px; }
.tier.ready .tier-badge { background: var(--ok); color: #fff; }
.tier-meter { height: 10px; border-radius: 5px; margin-top: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.stat { background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 10px 12px; min-width: 0; }
.stat .n { font-family: var(--display); font-weight: var(--h-weight); font-size: 1.5rem; line-height: 1.1; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .875rem; cursor: pointer; min-height: 36px; }
.chip-btn:hover { background: var(--sunk); }
.manage-link { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); margin: 8px 0; text-decoration: none; color: inherit; }

/* The positive message on open. It floods in the person's own color. */
dialog.affirm { border: 0; padding: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: var(--c); color: var(--on-c); display: grid; place-items: center; }
dialog.affirm::backdrop { background: var(--c); }
.affirm-card { display: grid; gap: 20px; justify-items: start; width: min(560px, 100%); padding: 32px 24px calc(32px + env(safe-area-inset-bottom)); }
.affirm-hi { margin: 0; font-size: 1rem; font-weight: 600; opacity: .85; }
.affirm-text { margin: 0; font-family: var(--display); font-weight: var(--h-weight); font-size: clamp(1.75rem, 7vw, 2.75rem); line-height: 1.18; text-wrap: balance; word-spacing: -.14em; }
body.kid .affirm-text { word-spacing: normal; }
.affirm-go { background: var(--on-c); color: var(--c); min-width: 140px; }
.affirm-go:focus-visible { outline: 3px solid var(--on-c); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  dialog.affirm[open] .affirm-card > * { animation: affirm-in .5s ease-out both; }
  dialog.affirm[open] .affirm-text { animation-delay: .08s; }
  dialog.affirm[open] .affirm-go { animation-delay: .2s; }
}
@keyframes affirm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
