/* Family Yard web app: the Sleek Design brand (docs/DESIGN.md). Self-hosted DM Sans / DM Mono,
   white cards with hairline borders on a soft slate background, light and dark. */
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans-Bold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("fonts/DMMono-Medium.ttf") format("truetype"); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --bg: #F5F7F6;
  --surface: #FFFFFF;
  --ink: #1B3A35;
  --ink-2: #5F716C;
  --hairline: #DCE4E1;
  --teal: #247A6F;
  --teal-hover: #1D665D;
  --ice: #E5F1EF;
  --ice-hover: #D6E9E5;
  --on-teal: #FFFFFF;
  --amber: #F2A638;
  --amber-tint: #FDF1DC;
  --amber-ink: #7A4E00;
  --red: #C95656;
  --red-tint: #F9E8E8;
  --track: #E9EEEC;
  --focus: #247A6F;
  --shadow: 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-pop: 0 12px 40px rgba(18, 40, 36, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 248px;
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1614;
    --surface: #17211F;
    --ink: #E6F0EE;
    --ink-2: #9AAEA9;
    --hairline: #2A3834;
    --teal: #5DBFB0;
    --teal-hover: #79CDBF;
    --ice: #1D3430;
    --ice-hover: #244039;
    --on-teal: #08201C;
    --amber-tint: #3A2C12;
    --amber-ink: #F5C27A;
    --red: #E07A7A;
    --red-tint: #3A1D1D;
    --track: #1F2B28;
    --focus: #5DBFB0;
    --shadow: 0 2px 6px rgba(0, 0, 0, .25);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; color: var(--ink); }
h1 { font-size: 32px; letter-spacing: -.5px; }
h2 { font-size: 22px; letter-spacing: -.2px; }
h3 { font-size: 17px; }
p { margin: 0 0 .75em; }
a { color: var(--teal); }
a:hover { color: var(--teal-hover); }
img { max-width: 100%; }
small { font-size: 13px; }
code { font: 500 .85em var(--mono); background: var(--ice); color: var(--ink); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
kbd { font: 500 12px var(--mono); border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--ink); }
.kbd-group { display: inline-flex; gap: 4px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .01em; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.icon { flex: none; }
.flip .icon { transform: rotate(180deg); }
[hidden] { display: none !important; }
.text-red { color: var(--red); font-weight: 500; }
.text-amber { color: var(--amber-ink); font-weight: 500; }
.text-teal { color: var(--teal); font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }

/* ---------------------------------------------------------------- type helpers */
.overline {
  font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 0 0 6px;
}
.overline.with-icon { display: flex; align-items: center; gap: 10px; }
.overline-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.overline-row .overline { margin: 0; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; }
.section-label h2 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 0; flex: 1; min-width: 0; }
.section-label > span, .section-label .group-count { font-size: 13px; color: var(--ink-2); }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 2px 12px; }
.section-head h2 { margin: 0; flex: 1; min-width: 0; }
.section-head h2 .count { color: var(--ink-2); font-weight: 500; }
.list-head { align-items: center; flex-wrap: wrap; }
.list-head h2 { flex: none; }
.text-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 2px; color: var(--teal); font: 500 15px var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.text-link:hover { color: var(--teal-hover); text-decoration: underline; text-underline-offset: 3px; }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; margin: 4px 0 18px; }
.page-title > .grow { flex: 1 1 240px; }
.page-title h1 { margin: 0; overflow-wrap: anywhere; }
.page-sub { color: var(--ink-2); margin: 6px 0 0; font-size: 16px; max-width: 62ch; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; margin: 4px 0 18px; }
.page-head > div:first-child { min-width: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 500; margin-bottom: 8px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  font: 500 15px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.active, .btn[aria-pressed="true"] { background: var(--ice); border-color: var(--teal); color: var(--teal); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 700; }
.btn-primary:hover { background: var(--teal-hover); border-color: var(--teal-hover); color: var(--on-teal); }
.btn-soft { background: var(--ice); border-color: transparent; color: var(--teal); }
.btn-soft:hover { background: var(--ice-hover); color: var(--teal); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: var(--ice); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #3B2500; border-radius: 999px; font-weight: 700; }
.btn-amber:hover { background: #E4972A; color: #3B2500; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger, .btn-danger:hover { color: #2A0C0C; } }
.btn-danger-text { color: var(--red); }
.btn-danger-text:hover { color: var(--red); background: var(--red-tint); }
.btn-small { min-height: 36px; padding: 5px 12px; font-size: 14px; border-radius: 12px; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-pill { border-radius: 999px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--ice); color: var(--teal); }
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; position: relative;
  border-radius: 50%; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0;
  box-shadow: var(--shadow);
}
.round-btn:hover { background: var(--ice); color: var(--teal); }
.round-btn.soft { background: var(--ice); border-color: transparent; color: var(--teal); box-shadow: none; }
.round-btn.soft:hover { background: var(--ice-hover); }
.round-btn.soft.is-on { background: var(--amber-tint); color: var(--amber-ink); }
.round-btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); box-shadow: none; }
.round-btn.primary:hover { background: var(--teal-hover); color: var(--on-teal); }
.round-btn.plain { background: transparent; border-color: transparent; box-shadow: none; }
.linklike { border: 0; background: none; padding: 0; color: var(--teal); font: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- inputs */
input, select, textarea {
  font: 400 15px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 9px 12px; min-height: 44px; max-width: 100%; min-width: 0;
}
select { padding-right: 30px; }
textarea { resize: vertical; width: 100%; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-2) 80%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid color-mix(in srgb, var(--teal) 22%, transparent); outline-offset: 0; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--teal); margin: 0; flex: none; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
input.narrow { width: 90px; }
.mono-input { font-family: var(--mono); font-weight: 500; text-transform: uppercase; }
.mono-input::placeholder { text-transform: none; font-family: var(--sans); }
/* Round "tick off" checkboxes for shopping and to-dos. */
input.round-check {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink-2) 55%, transparent);
  background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; transition: background .12s, border-color .12s;
}
input.round-check:hover { border-color: var(--teal); }
input.round-check:checked { background: var(--teal); border-color: var(--teal); }
input.round-check:checked::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--on-teal); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 500; font-size: 14px; color: var(--ink); }
.field input:not([type=checkbox]), .field select { width: 100%; }
.hint { color: var(--ink-2); font-size: 13px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-weight: 500; font-size: 14px; margin-bottom: 8px; padding: 0; }
.chip { border: 1px solid var(--hairline); border-radius: 999px; padding: 6px 12px; background: var(--surface); font-size: 14px; }
.chip:has(input:checked) { background: var(--ice); border-color: var(--teal); color: var(--teal); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.form-status { color: var(--red); min-height: 1.2em; margin: 4px 0 0; font-size: 14px; }
.notice { background: var(--ice); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; }
.notice-error { background: var(--red-tint); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- chips, pills, avatars, tints */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap;
}
.chip-toggle:hover { border-color: var(--teal); }
.chip-toggle.on, .chip-toggle[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.chip-toggle.small { min-height: 30px; padding: 3px 10px 3px 12px; font-size: 13px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 500;
  white-space: nowrap; line-height: 1.35; flex: none;
}
.pill-overdue { background: var(--red-tint); color: var(--red); }
.pill-dueSoon, .pill-amber { background: var(--amber-tint); color: var(--amber-ink); }
.pill-upToDate, .pill-ice, .pill-info { background: var(--ice); color: var(--teal); }
.pill-plain { background: var(--track); color: var(--ink-2); }
.tint {
  --tint: var(--teal);
  display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint);
}
@media (prefers-color-scheme: dark) {
  .tint { background: color-mix(in srgb, var(--tint) 24%, transparent); color: color-mix(in srgb, var(--tint) 60%, #fff); }
}
.avatar {
  --av: #247A6F;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; flex: none;
  background: color-mix(in srgb, var(--av) 18%, var(--surface)); color: color-mix(in srgb, var(--av) 85%, var(--ink));
  box-shadow: 0 0 0 2px var(--surface); letter-spacing: .02em; line-height: 1;
}
@media (prefers-color-scheme: dark) { .avatar { background: color-mix(in srgb, var(--av) 30%, var(--surface)); color: color-mix(in srgb, var(--av) 55%, #fff); } }
.avatar-plain { background: var(--track); color: var(--ink-2); }
.avatars { display: inline-flex; align-items: center; flex: none; }
.avatars .avatar + .avatar { margin-left: -8px; }
.avatars-more { font-size: 12px; color: var(--ink-2); margin-left: 4px; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 0 0 16px; min-width: 0; }
.card-pad { padding: 16px 18px; }
p.card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: 17px; }
.card > h2 { font-size: 17px; }
.card-alert { border-color: var(--amber); background: var(--amber-tint); }
.danger-card h2 { color: var(--red); }
details.card summary { cursor: pointer; font-weight: 500; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty h3 { color: var(--ink); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.drop-hint { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.dropping { outline: 3px dashed var(--teal); outline-offset: -6px; border-radius: var(--radius); background: color-mix(in srgb, var(--ice) 60%, transparent); }
.small-h { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.card.list-card, .card.rows-card { list-style: none; padding: 0; overflow: hidden; margin-bottom: 0; }
.list-card > li { border-top: 1px solid var(--hairline); }
.list-card > li:first-child { border-top: 0; }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.row-btn:hover { background: var(--bg); }
.row-btn .icon { color: var(--ink-2); }
.row-title { display: block; font-weight: 500; overflow-wrap: anywhere; }
.row-btn small { display: block; color: var(--ink-2); }
.circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink-2) 55%, transparent); flex: none; display: inline-grid; place-content: center; }
.circle.done { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }

/* ---------------------------------------------------------------- sign in */
.signin { max-width: 440px; margin: 0 auto; padding: 9vh 16px 40px; }
.signin-brand { justify-content: center; margin-bottom: 26px; }
.signin-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.signin-card h1 { font-size: 26px; margin-bottom: 4px; }
.code-input { font: 500 26px var(--mono); letter-spacing: .4em; text-align: center; }

/* ---------------------------------------------------------------- shell */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.3px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark:hover { color: var(--ink); }
.wordmark img { border-radius: 9px; flex: none; }
.wm-accent { color: var(--teal); }
.wordmark.big { display: flex; font-size: 30px; gap: 14px; letter-spacing: -.6px; }
.wordmark.big img { border-radius: 14px; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidenav { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 18px 14px; border-right: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column; }
.side-brand { padding: 4px 8px 22px; }
.sidenav-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side-link .icon { color: var(--ink-2); }
.side-link:hover { background: var(--bg); color: var(--ink); }
.side-link.active { background: var(--ice); color: var(--teal); font-weight: 700; }
.side-link.active .icon { color: var(--teal); }
.side-link.active .icon path { fill: color-mix(in srgb, currentColor 18%, transparent); }
.side-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 22px 12px 6px; }
.nav-note { margin: 18px 12px 0; font-size: 12px; color: var(--ink-2); }
.content { min-width: 0; padding: 0 0 60px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.topbar-brand { display: none; }
.hh-select { min-height: 38px; padding: 5px 30px 5px 12px; max-width: 220px; border-radius: 999px; font-weight: 500; }
.hh-name { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; max-width: 260px; }
.hh-name span { overflow: hidden; text-overflow: ellipsis; }
.shared-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--amber-tint); color: var(--amber-ink); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 500; }
.bell .badge { position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; box-shadow: 0 0 0 2px var(--bg); }
@media (prefers-color-scheme: dark) { .bell .badge { color: #2A0C0C; } }
.profile-btn { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; display: inline-flex; }
.profile-btn .avatar { box-shadow: 0 0 0 1px var(--hairline); }
.profile-btn:hover .avatar { box-shadow: 0 0 0 2px var(--teal); }
.main { outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 8px 28px 28px; min-width: 0; }
.narrow-page { max-width: 820px; }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; color: var(--ink-2); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--hairline); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { scroll-behavior: auto !important; transition: none !important; } }
.tabbar { display: none; }
.fab { display: none; }

/* popup menu */
.menu-pop {
  position: absolute; z-index: 60; min-width: 240px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px;
}
.menu-pop button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 15px var(--sans); text-align: left; cursor: pointer; }
.menu-pop button .icon { color: var(--ink-2); }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--ice); color: var(--teal); outline: none; }
.menu-pop button:hover .icon { color: var(--teal); }
.menu-pop button.danger, .menu-pop button.danger .icon { color: var(--red); }
.menu-pop button.danger:hover { background: var(--red-tint); }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- banners */
.banner-slot { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.banner, .amber-banner, .trip-banner {
  display: flex; gap: 12px; align-items: flex-start; background: var(--amber-tint); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: var(--radius); padding: 14px; color: var(--ink); margin: 0 0 16px;
}
.banner ul { margin: 4px 0; padding-left: 18px; }
.banner a { color: var(--amber-ink); font-weight: 500; }
.banner-icon, .trip-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--amber); color: #3B2500; flex: none; }
.amber-banner p { margin: 0; color: var(--ink); }
.amber-banner strong { color: var(--amber-ink); }
.trip-banner { align-items: center; }
.trip-banner strong { display: block; font-size: 16px; }
.trip-banner small { color: var(--ink-2); }
.trip-banner > .icon { color: var(--amber-ink); }

/* ---------------------------------------------------------------- search */
.search-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 4px 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.search-card:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.search-card > .icon { color: var(--ink-2); }
.search-card input { border: 0; background: transparent; min-height: 46px; padding: 6px 0; flex: 1; outline: none !important; box-shadow: none; font-size: 16px; }
.big-search { font-size: 16px; }
.result-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.result-list li + li { border-top: 1px solid var(--hairline); }
.result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.result:hover, .result:focus-visible { background: var(--bg); }
.result strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.result small { color: var(--ink-2); }
.result .icon { color: var(--ink-2); }
.result-kind { font-size: 12px; font-weight: 500; color: var(--teal); background: var(--ice); border-radius: 999px; padding: 2px 9px; flex: none; min-width: 78px; text-align: center; }

/* ---------------------------------------------------------------- home */
.home-title { margin-bottom: 20px; }
.home-title h1 { font-size: 34px; }
.status-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--ink-2); font-weight: 500; }
.status-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); flex: none; }
.status-line .icon { color: var(--teal); }
.status-line.is-amber .dot { background: var(--amber); }
.status-line.is-amber { color: var(--amber-ink); }
.status-line.is-red .dot { background: var(--red); }
.status-line.is-red { color: var(--red); }
.quick-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 8px; }
.quick-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-width: 0; }
.quick-tile:hover { border-color: var(--teal); color: var(--ink); }
.quick-tile .tint { margin-bottom: 10px; }
.quick-tile strong { font-size: 17px; }
.quick-tile small { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.home-section .section-head { margin-top: 28px; }
/* Home: "This week" and "Shopping list" cards, side by side when there's room. */
.family-cards { container-type: inline-size; margin-top: 28px; }
.family-cards-grid > * { margin: 0 0 16px; }
@container (min-width: 620px) {
  .family-cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .family-cards-grid > * { margin: 0; }
}
.family-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.family-card > * { margin: 0; }
.family-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.family-card-head h2 { margin: 0; font-size: 20px; }
.family-card-head small { display: block; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-card-head .grow { min-width: 0; }
.family-card-cta { align-self: flex-start; text-decoration: none; }
.plain-rows { list-style: none; margin: 0; padding: 0; }
.week-day { display: flex; flex-direction: column; gap: 6px; }
.week-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.week-label.is-today { color: var(--teal); }
.week-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; margin: 0 -6px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; box-sizing: content-box; }
.week-row:hover { background: var(--bg); }
.week-row .grow { min-width: 0; }
.week-bar { width: 4px; height: 30px; border-radius: 2px; flex: none; }
.week-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row small { display: block; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-shop-item { display: flex; align-items: center; gap: 12px; padding: 5px 0; min-width: 0; }
.home-shop-item .item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-shop-item .tick { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink-2) 55%, transparent); background: var(--surface); color: transparent; display: inline-grid; place-content: center; padding: 0; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.home-shop-item .tick:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.home-shop-item .tick.done { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.home-shop-item .tick:disabled:not(.done) { opacity: .5; cursor: default; }
.staple-star { color: var(--amber); display: inline-flex; flex: none; }
.staple-star .icon path { fill: currentColor; }
.more-link { display: inline-block; padding: 6px 0 0; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.more-link:hover { color: var(--teal); }
.home-quick-add { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid transparent; border-radius: 12px; padding: 4px 4px 4px 12px; min-width: 0; }
.home-quick-add:focus-within { border-color: var(--teal); }
.home-quick-add input { border: 0; background: transparent; outline: none !important; box-shadow: none; padding: 6px 0; min-width: 0; font-size: 16px; }
.home-quick-add .round-btn { width: 34px; height: 34px; }

/* ---------------------------------------------------------------- document cards */
.doc-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-card { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.doc-card.is-overdue { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.doc-card:hover { border-color: color-mix(in srgb, var(--teal) 60%, transparent); }
.doc-card.is-overdue:hover { border-color: var(--red); }
.doc-link { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-width: 0; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.doc-link:hover { color: var(--ink); }
.doc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.doc-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.doc-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.doc-meta { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta .mono { font-size: 13px; }
.doc-side { display: flex; align-items: center; gap: 10px; flex: none; }
.doc-side .icon { color: var(--ink-2); }
.doc-actions { padding-right: 14px; flex: none; }
.fav { color: var(--amber); display: inline-flex; }
.fav .icon path { fill: currentColor; }

/* ---------------------------------------------------------------- vault */
.tile-grid3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: 100%; padding: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; min-width: 0;
}
.cat-tile:hover { border-color: var(--teal); color: var(--ink); }
.cat-tile.on { border-color: var(--teal); background: var(--ice); box-shadow: 0 0 0 1px var(--teal) inset; }
.cat-tile.dashed { border-style: dashed; box-shadow: none; background: transparent; }
.cat-tile .tint, .cat-tile > .avatar { margin-bottom: 10px; }
.cat-tile strong { font-size: 16px; overflow-wrap: anywhere; }
.cat-tile small { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.vault .hint { margin: 10px 2px 0; }
.timeline-section { margin-bottom: 22px; }
details.timeline-section summary { cursor: pointer; list-style: none; }
details.timeline-section summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- document page */
.doc-page { max-width: 1120px; padding-bottom: 110px; }
.detail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-head { margin-bottom: 20px; }
.detail-head .pills { gap: 8px; margin-bottom: 14px; }
.title-row { display: flex; align-items: center; gap: 16px; }
.title-row h1 { margin: 0; font-size: 32px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.doc-grid .card { margin: 0; }
.share-card { display: flex; align-items: center; gap: 14px; }
.share-card strong { display: block; font-size: 16px; }
.share-card small { color: var(--ink-2); display: block; overflow-wrap: anywhere; }
.detail-block { min-width: 0; }
.card.rows-card { margin: 0; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-top: 1px solid var(--hairline); }
.kv:first-child { border-top: 0; }
.kv dt { color: var(--ink-2); flex: none; }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; font-weight: 500; }
.kv dd small { display: block; font-weight: 500; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.rem-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--hairline); }
.rem-row:first-child { border-top: 0; }
.rem-row a { font-weight: 500; overflow-wrap: anywhere; }
.file-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 10px 10px 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.history .file-card { box-shadow: none; }
.file-open { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; padding: 2px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.file-name { display: block; max-width: 100%; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-open small { color: var(--ink-2); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history > li { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sticky-actions {
  position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 15; display: flex; gap: 12px; align-items: center;
  padding: 14px max(28px, calc((100vw - var(--side-w) - 1120px) / 2 + 28px)); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--hairline);
}
.sticky-actions .btn-primary { max-width: 520px; }

/* ---------------------------------------------------------------- dialogs */
.dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.dialog-wide { width: min(860px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 22, 20, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 8px 22px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog-head h2 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.dialog-body { padding: 8px 22px 22px; }
.dialog-body h3 { margin-top: 18px; }
.dialog-viewer { width: min(1100px, calc(100vw - 24px)); }
.viewer-frame { width: 100%; height: min(78vh, 900px); border: 1px solid var(--hairline); border-radius: 12px; background: #fff; }
.viewer-image { display: flex; justify-content: center; background: var(--bg); border-radius: 12px; padding: 8px; }
.viewer-image img { max-height: 75vh; object-fit: contain; }
.radio-group { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.radio-card .icon { color: var(--ink-2); }
.radio-card:has(input:checked) { border-color: var(--teal); background: var(--ice); }
.radio-card:has(input:checked) .icon { color: var(--teal); }
.radio-card small { display: block; color: var(--ink-2); }
.people-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.people-list li:first-child { border-top: 0; }
.people-list li > .grow > span, .people-list li > .grow > small { display: block; overflow-wrap: anywhere; }
.people-list li > .grow > span { font-weight: 500; }
.people-list small { color: var(--ink-2); }
.people-list > li > .icon { color: var(--ink-2); }
.people-list.compact li { padding: 5px 0; border: 0; }
.who-list h3 { font-size: 15px; }
.link-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.link-list small { color: var(--ink-2); }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity-list li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.activity-list small { color: var(--ink-2); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li + li { border-top: 1px solid var(--hairline); }
.notif-list .linklike { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 4px; color: var(--ink); text-decoration: none; }
.notif-list .unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 6px; }
.notif-list small { color: var(--ink-2); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.shortcuts dd { margin: 0; }
.scroll-box { max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.link-editor .row { margin-bottom: 8px; }
.link-editor input:first-child { width: 34%; }
/* family documents */
.family-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.family-row { padding: 12px 14px; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.family-row:first-child { border-top: 0; }
.family-person { display: flex; align-items: center; gap: 10px; }
.family-person > .icon { color: var(--ink-2); }
.name-input { flex: 1 1 0; width: 0; min-width: 0; font-weight: 500; border-color: transparent; background: var(--bg); }
.name-input:hover { border-color: var(--hairline); }
.family-details { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; padding-left: 70px; }
.family-details label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.share-own { background: var(--ice); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 1000; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 12px 8px 12px 16px; box-shadow: var(--shadow-pop); }
.toast-body { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.toast .icon-btn { color: inherit; width: 32px; height: 32px; }
.toast .icon-btn:hover { background: rgba(127, 127, 127, .25); color: inherit; }
.toast .btn { background: transparent; color: inherit; border-color: currentColor; }
.toast-error { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .toast-error { color: #2A0C0C; } }

/* ---------------------------------------------------------------- launchpad */
.page-title .head-actions { flex: none; }
.launchpad { display: flex; flex-direction: column; gap: 24px; }
.link-group.drop-target .tile-grid { background: var(--ice); }
.group-head { flex-wrap: wrap; }
.group-head h2 { display: flex; align-items: center; gap: 8px; flex: none; }
.group-head.draggable { cursor: grab; }
.group-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; min-height: 40px; border-radius: var(--radius); }
.tile-grid.drop-target { background: var(--ice); outline: 2px dashed var(--teal); outline-offset: 4px; }
.tile-wrap, .tile-add-wrap { position: relative; min-width: 0; }
.tile-wrap.dragging { opacity: .4; }
.tile {
  display: flex; align-items: center; gap: 12px; padding: 14px; height: 100%; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-width: 0;
}
.tile:hover, .tile:focus-visible { border-color: var(--teal); color: var(--ink); }
.tile-letter, .tile-icon, .tile-badge { width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tile-letter { font-weight: 700; font-size: 17px; }
.tile-img { width: 22px; height: 22px; object-fit: contain; }
.tile-badge { background: #1B3A35; color: #fff; font: 700 11px var(--sans); letter-spacing: .5px; }
.tile-badge.nhs { background: #005EB8; }
@media (prefers-color-scheme: dark) { .tile-badge { background: #E6F0EE; color: #0E1614; } .tile-badge.nhs { background: #3D8FE0; color: #fff; } }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-tools { position: absolute; top: -8px; right: -6px; display: flex; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; box-shadow: var(--shadow); }
.tile-tools .icon-btn { width: 30px; height: 30px; }
.tile-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; min-height: 72px; padding: 14px; border: 1.5px dashed var(--hairline); border-radius: var(--radius); background: transparent; color: var(--teal); font: 500 15px var(--sans); cursor: pointer; }
.tile-add:hover { border-color: var(--teal); background: var(--ice); }
.homepage-hint { margin-top: 28px; }

/* ---------------------------------------------------------------- family hub */
.family-head { margin-bottom: 16px; }
.family-head .page-title { margin-bottom: 14px; }
.segmented { display: flex; background: var(--track); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented .seg {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: 500 15px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.segmented .seg:hover { color: var(--ink); }
.segmented .seg.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented.small { display: inline-flex; }
.segmented.small .seg { flex: none; min-height: 32px; font-size: 14px; }
.list-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.list-title h2 { margin: 0; font-size: 22px; }
.add-card { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 6px 6px 6px 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.add-card:focus-within { border-color: var(--teal); }
.add-card input { border: 0; background: transparent; outline: none !important; padding-left: 0; font-size: 16px; }
.add-card .round-btn { width: 40px; height: 40px; }
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.split-main { min-width: 0; }
.sublist ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sublist button:not(.btn):not(.text-link) { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 12px; color: var(--ink); font: 500 15px var(--sans); text-align: left; cursor: pointer; }
.sublist button:not(.btn):not(.text-link):hover { background: var(--surface); }
.sublist button.active { background: var(--ice) !important; color: var(--teal) !important; font-weight: 700 !important; }
.count { font-size: 13px; color: var(--ink-2); }
.task, .shop-item { display: flex; align-items: center; gap: 14px; padding: 6px 16px; }
.task-main, .item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.task-main { flex-direction: column; align-items: flex-start; gap: 2px; }
.task-title, .item-name { font-weight: 500; overflow-wrap: anywhere; }
.item-main .grow > * { display: block; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); align-items: center; }
.item-main small, .shop-item small { color: var(--ink-2); font-size: 13px; }
.added-by { flex: none; white-space: nowrap; }
.is-done .task-title { text-decoration: line-through; color: var(--ink-2); }
.done-toggle { margin: 14px 2px; }
.task-list.done { opacity: .85; }
.aisle { margin-bottom: 22px; }
.shop-item.bought { padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.shop-item.bought .item-name { color: var(--ink-2); text-decoration: line-through; }
.shop-item.bought .circle { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- calendar */
.cal-toolbar { margin-bottom: 12px; }
.cal-toolbar .head-actions { gap: 8px; }
.month-nav { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.month-name { min-width: 140px; text-align: center; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.legend-item { border-left: 4px solid var(--person); padding-left: 8px; }
.legend-item input { accent-color: var(--person); }
.cal-grid { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head > div { padding: 10px 8px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); text-align: center; border-bottom: 1px solid var(--hairline); }
.cal-cell { min-height: 110px; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-row .cal-cell:nth-child(7n) { border-right: 0; }
.cal-row:last-child .cal-cell { border-bottom: 0; }
.cal-cell.other-month { background: var(--bg); }
.cal-cell.other-month .cal-day { color: var(--ink-2); }
.cal-day { align-self: flex-start; border: 0; background: none; color: var(--ink); font: 500 13px var(--sans); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.cal-day:hover { background: var(--ice); }
.cal-cell.today .cal-day { background: var(--teal); color: var(--on-teal); font-weight: 700; }
.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 7px; padding: 2px 6px; font: 400 12px var(--sans); text-align: left; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--person) 16%, var(--surface)); }
.cal-chip:hover { background: color-mix(in srgb, var(--person) 28%, var(--surface)); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--person); flex: none; }
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.kind-task { background: transparent; border-color: color-mix(in srgb, var(--person) 60%, transparent); }
.cal-chip.kind-renewal { background: var(--amber-tint); border-color: color-mix(in srgb, var(--amber) 70%, transparent); }
.cal-chip.kind-shared { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--person) 16%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.more { font-size: 12px; }
.agenda-day { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.agenda-day h2.overline { font-size: 13px; }
.agenda-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agenda-day li { display: flex; align-items: center; gap: 10px; }
.agenda-day .cal-chip { font-size: 15px; padding: 7px 10px; }

/* ---------------------------------------------------------------- legacy */
.legacy-title { margin: 4px 0 20px; }
.legacy-title h1 { margin: 4px 0 0; }
.progress-card { display: flex; align-items: center; gap: 18px; }
.progress-card strong { display: block; font-size: 17px; }
.progress-card small { color: var(--ink-2); display: block; margin-top: 2px; }
.ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.ring { width: 72px; height: 72px; }
.ring-track { fill: none; stroke: var(--ice); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--teal); stroke-width: 7; stroke-linecap: round; }
.ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.area-grid { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.area-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: 100%; text-align: left; padding: 16px;
  border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; box-shadow: var(--shadow);
}
.area-card:hover { border-color: var(--teal); }
.area-card.needs { border-color: color-mix(in srgb, var(--amber) 70%, transparent); }
.area-top { display: flex; align-items: flex-start; justify-content: space-between; width: 100%; margin-bottom: 10px; }
.area-card strong { font-size: 16px; }
.area-card small { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.check-badge { width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: var(--on-teal); display: inline-flex; align-items: center; justify-content: center; }
.amber-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); margin: 6px; }
.entries { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.entry { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px; margin: 0; }
.entry legend { font-weight: 700; padding: 0 6px; }
.entry .form-grid { margin-bottom: 8px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.entry-read { padding: 10px 0; border-top: 1px solid var(--hairline); }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.print-sheet { display: none; }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 1080px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  :root { --side-w: 212px; }
  .page { padding: 8px 20px 24px; }
  .topbar { padding: 10px 20px; }
  .banner-slot { padding: 0 20px; }
}

/* ---------------------------------------------------------------- phones: bottom tab bar */
@media (max-width: 760px) {
  :root { --side-w: 0px; }
  h1, .title-row h1 { font-size: 28px; }
  .home-title h1 { font-size: 30px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .content { padding-bottom: calc(var(--tab-h) + 90px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 16px; min-height: 60px; gap: 8px; }
  .topbar-brand { display: block; }
  .topbar .wordmark { font-size: 17px; gap: 8px; }
  .topbar .wordmark img { width: 30px; height: 30px; border-radius: 8px; }
  .hh-slot { display: none; }
  .page { padding: 4px 16px 20px; }
  .banner-slot { padding: 0 16px; }
  .hide-sm { display: none !important; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--hairline);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 12px; min-width: 0; }
  .tab:hover { color: var(--ink); }
  .tab.active { color: var(--teal); font-weight: 700; }
  .tab.active .icon path { fill: color-mix(in srgb, currentColor 22%, transparent); }
  .fab {
    display: inline-flex; align-items: center; justify-content: center; position: fixed; right: 18px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 41;
    width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--teal); color: var(--on-teal); cursor: pointer;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--teal) 45%, transparent);
  }
  .fab[hidden] { display: none !important; }
  .fab:hover { background: var(--teal-hover); }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); max-width: none; }
  .quick-tiles { gap: 10px; }
  .quick-tile { padding: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-link { padding: 12px 14px; gap: 12px; }
  .doc-link > .tint { width: 38px !important; height: 38px !important; }
  .doc-title { font-size: 15px; }
  .doc-card { flex-wrap: wrap; }
  .doc-actions { padding: 0 14px 12px 64px; }
  .tile-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile-grid3.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-tile { padding: 12px 10px; }
  .cat-tile strong { font-size: 14px; }
  .cat-tile small { font-size: 12px; }
  .cat-tile .tint { width: 36px !important; height: 36px !important; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .tile-text { max-width: 100%; }
  .tile-add { min-height: 110px; flex-direction: column; font-size: 14px; }
  .area-grid { gap: 10px; }
  .area-card { padding: 14px; }
  .card { padding: 16px; }
  .dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .dialog-body { padding: 6px 16px 18px; }
  .dialog-head { padding: 14px 10px 6px 16px; }
  .dialog-head h2 { font-size: 20px; }
  .family-details { padding-left: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .family-person > .icon { display: none; }
  .family-row { padding: 12px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sublist .overline { display: none; }
  .sublist ul { flex-direction: row; overflow-x: auto; gap: 8px; scrollbar-width: none; margin-bottom: 6px; }
  .sublist li { flex: none; }
  .sublist button:not(.btn):not(.text-link) { border: 1px solid var(--hairline); background: var(--surface); border-radius: 999px; padding: 6px 14px; width: auto; white-space: nowrap; }
  .sublist button.active { background: var(--teal) !important; color: var(--on-teal) !important; border-color: var(--teal) !important; }
  .sublist button.active .count { color: var(--on-teal); }
  .sticky-actions { left: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 12px 16px; }
  .doc-page { padding-bottom: 150px; }
  .kv { padding: 12px 16px; }
  .title-row { gap: 12px; }
  .title-row > .tint { display: none; }
  .share-card { gap: 12px; padding: 14px; }
  .share-card > .tint { width: 40px !important; height: 40px !important; }
  .banner { padding: 12px; font-size: 14px; }
  .banner .banner-icon { width: 34px; height: 34px; }
  .segmented .seg { font-size: 14px; padding: 6px 6px; }
  .added-by { display: none; }
  .cal-cell { min-height: 64px; padding: 2px; }
  .cal-chip.compact .chip-text { display: none; }
  .cal-chip.compact { width: auto; padding: 3px; border-radius: 50%; }
  .cal-head > div { padding: 6px 0; font-size: 10px; letter-spacing: .3px; }
  .month-name { min-width: 0; }
  .result-kind { min-width: 0; }
  .link-editor .row { flex-wrap: wrap; }
  .link-editor input:first-child { width: 100%; }
  .people-list select { max-width: 100%; }
  .page-title { gap: 10px; }
  .page-head h1 { font-size: 28px; }
  .menu-pop { min-width: 220px; }
}
@media (max-width: 480px) {
  .share-card .avatars { display: none; }
}
@media (max-width: 340px) {
  .tile-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-tile strong { font-size: 16px; }
}

/* ---------------------------------------------------------------- print (the Legacy plan export) */
@media print {
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing .print-sheet { display: block; color: #000; font: 11pt/1.45 var(--sans); }
  .print-sheet h1 { font-size: 22pt; color: #000; }
  .print-sheet h2 { font-size: 14pt; color: #000; margin-top: 18pt; border-bottom: 1px solid #ccc; padding-bottom: 4pt; }
  .print-sheet section { break-inside: avoid-page; }
  .print-sheet dl { display: grid; grid-template-columns: 38% 62%; gap: 2pt 8pt; margin: 6pt 0 10pt; }
  .print-sheet dt { color: #555; }
  .print-sheet dd { margin: 0; }
}
.section-label h2.text-red { color: var(--red); }
.btn.text-red { color: var(--red); }

/* ---------------------------------------------------------------- start page (#/launchpad, #/start) */
/* Wallpapers: soft gradients in the brand palette. Cards stay white (or dark surface) on top. */
[data-wall="slate"], [data-swatch="slate"] { --wall-top: #E6EDEA; --wall: radial-gradient(120% 70% at 0% 0%, #DDE7E3 0%, transparent 60%), radial-gradient(90% 60% at 100% 0%, #E9EFF2 0%, transparent 55%), linear-gradient(180deg, #EDF2F0 0%, #F5F7F6 70%); }
[data-wall="teal"], [data-swatch="teal"] { --wall-top: #D3EAE5; --wall: radial-gradient(120% 70% at 0% 0%, #BFE1DA 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #D6ECF2 0%, transparent 55%), linear-gradient(180deg, #E0F0EC 0%, #F2F8F6 75%); }
[data-wall="dawn"], [data-swatch="dawn"] { --wall-top: #FBE6D2; --wall: radial-gradient(120% 70% at 0% 0%, #FBDDBF 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #F6D6E1 0%, transparent 55%), linear-gradient(180deg, #FCEFE3 0%, #FAF5F2 75%); }
[data-wall="forest"], [data-swatch="forest"] { --wall-top: #D9E9DD; --wall: radial-gradient(120% 70% at 0% 0%, #C8E0CE 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #DCEBD8 0%, transparent 55%), linear-gradient(180deg, #E4EFE6 0%, #F3F7F3 75%); }
[data-wall="dusk"], [data-swatch="dusk"] { --wall-top: #E1DDF0; --wall: radial-gradient(120% 70% at 0% 0%, #D6CFEE 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #F0D7E4 0%, transparent 55%), linear-gradient(180deg, #E9E6F4 0%, #F5F3F9 75%); }
[data-wall="sand"], [data-swatch="sand"] { --wall-top: #F3EADA; --wall: radial-gradient(120% 70% at 0% 0%, #F1E2C6 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #F3E9DC 0%, transparent 55%), linear-gradient(180deg, #F6EFE3 0%, #FAF7F1 75%); }
[data-wall="plain"], [data-swatch="plain"] { --wall-top: var(--bg); --wall: var(--bg); }
@media (prefers-color-scheme: dark) {
  [data-wall="slate"], [data-swatch="slate"] { --wall-top: #111C19; --wall: radial-gradient(120% 70% at 0% 0%, #17302B 0%, transparent 60%), radial-gradient(90% 60% at 100% 0%, #16232A 0%, transparent 55%), linear-gradient(180deg, #111C19 0%, #0E1614 70%); }
  [data-wall="teal"], [data-swatch="teal"] { --wall-top: #0F2522; --wall: radial-gradient(120% 70% at 0% 0%, #0F3A34 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #10303A 0%, transparent 55%), linear-gradient(180deg, #0F2522 0%, #0C1513 75%); }
  [data-wall="dawn"], [data-swatch="dawn"] { --wall-top: #261A15; --wall: radial-gradient(120% 70% at 0% 0%, #3A2518 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #35202A 0%, transparent 55%), linear-gradient(180deg, #221815 0%, #141012 75%); }
  [data-wall="forest"], [data-swatch="forest"] { --wall-top: #122019; --wall: radial-gradient(120% 70% at 0% 0%, #173524 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #1D2F1C 0%, transparent 55%), linear-gradient(180deg, #122019 0%, #0D1411 75%); }
  [data-wall="dusk"], [data-swatch="dusk"] { --wall-top: #191729; --wall: radial-gradient(120% 70% at 0% 0%, #28234A 0%, transparent 60%), radial-gradient(90% 70% at 100% 0%, #35203A 0%, transparent 55%), linear-gradient(180deg, #181628 0%, #0F0F17 75%); }
  [data-wall="sand"], [data-swatch="sand"] { --wall-top: #211C14; --wall: radial-gradient(120% 70% at 0% 0%, #352A18 0%, transparent 60%), radial-gradient(90% 70% at 100% 10%, #2C2419 0%, transparent 55%), linear-gradient(180deg, #211C14 0%, #13110D 75%); }
}
body[data-wall]::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--wall); pointer-events: none; }
body[data-wall] .topbar { background: color-mix(in srgb, var(--wall-top) 82%, transparent); }

.start-page { max-width: 1180px; }
.sp-head { display: flex; align-items: flex-start; gap: 16px; margin: 6px 0 22px; min-height: 76px; }
.sp-hello { min-width: 0; }
.sp-greet { font-size: 34px; margin: 0 0 4px; overflow-wrap: anywhere; }
.sp-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; color: var(--ink-2); font-size: 17px; font-weight: 500; }
.sp-greet[hidden] + .sp-meta { font-size: 20px; }
.sp-clock { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; }
.sp-customise { flex: none; background: color-mix(in srgb, var(--surface) 70%, var(--ice)); }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }

.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.start-grid > * { min-width: 0; margin: 0; }
.start-grid > .span-all { grid-column: 1 / -1; }
.start-sec-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; flex-wrap: wrap; }
.start-sec-head h2 { font-size: 20px; margin: 0; flex: 1; min-width: 0; }
.start-groups { margin-top: 10px; }
.start-groups .link-group .group-head h3 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 0; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.tile-star { display: inline-flex; color: var(--amber); margin-left: 5px; vertical-align: -1px; }
.tile-star .icon path { fill: currentColor; }
.tile-title { display: flex; align-items: center; min-width: 0; }
.tile-more { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; opacity: 0; color: var(--ink-2); }
.tile-wrap:hover .tile-more, .tile-more:focus-visible, .tile-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .tile-more { opacity: .75; } }

/* search */
.sp-search-wrap { position: relative; z-index: 5; }
.sp-search-form { position: relative; }
.sp-search { margin: 0; padding: 6px 18px; border-radius: 18px; box-shadow: 0 2px 10px rgba(18, 40, 36, .06); }
.sp-search input { min-height: 50px; font-size: 18px; }
.sp-search input::-webkit-search-cancel-button { cursor: pointer; }
.sp-engine { flex: none; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--track); border-radius: 999px; padding: 3px 10px; }
.sp-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: var(--shadow-pop); max-height: min(60vh, 460px); overflow-y: auto; }
.sp-option { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; cursor: pointer; }
.sp-option:hover { background: var(--bg); }
.sp-option[aria-selected="true"] { background: var(--ice); }
.sp-opt-icon { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ice); color: var(--teal); flex: none; }
.sp-opt-text strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-opt-text small { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-option.is-web .sp-opt-icon { background: var(--track); color: var(--ink-2); }
.sp-option .result-kind { min-width: 0; }

/* favourites: Safari-style big rounded icons with the name underneath */
.fav-grid { --fav: 76px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--fav) + 22px), 1fr)); gap: 16px 6px; }
.fav-grid.size-small { --fav: 56px; }
.fav-grid.size-large { --fav: 100px; }
.fav-wrap { position: relative; display: flex; justify-content: center; min-width: 0; }
.fav-wrap.dragging { opacity: .35; }
.fav-wrap.drop-before::before { content: ""; position: absolute; left: -4px; top: 6px; width: 3px; height: var(--fav); border-radius: 2px; background: var(--teal); }
.fav-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; width: calc(var(--fav) + 22px); padding: 6px 0 4px; border: 0; background: none; border-radius: 16px; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.fav-tile:hover { color: var(--ink); }
.fav-tile:hover .fav-icon { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 10px 22px rgba(18, 40, 36, .16); }
.fav-icon { width: var(--fav); height: var(--fav); border-radius: calc(var(--fav) * .235); flex: none; display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid rgba(27, 58, 53, .08); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(18, 40, 36, .10); transition: transform .15s, box-shadow .15s; }
.fav-img img { width: 68%; height: 68%; object-fit: contain; border-radius: 18%; }
.fav-img.small-src img { width: 46%; height: 46%; border-radius: 0; }
.fav-letter { background: var(--c); border-color: transparent; color: #fff; font-weight: 700; font-size: calc(var(--fav) * .44); letter-spacing: -.5px; }
.fav-badge { color: #fff; font-weight: 700; font-size: calc(var(--fav) * .2); letter-spacing: .3px; border-color: transparent; }
.fav-badge.gov { background: #1B3A35; }
.fav-badge.nhs { background: #005EB8; font-size: calc(var(--fav) * .27); }
.fav-plus { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1.5px dashed color-mix(in srgb, var(--ink-2) 45%, transparent); box-shadow: none; color: var(--teal); }
.fav-add:hover .fav-plus { background: var(--ice); border-color: var(--teal); }
.fav-name { font-size: 13px; font-weight: 500; line-height: 1.25; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; min-height: 2.5em; }
.fav-grid.size-small .fav-name { font-size: 12px; }
.fav-remove { position: absolute; top: 0; left: calc(50% - var(--fav) / 2 - 8px); width: 24px; height: 24px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-2); color: var(--surface); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.fav-remove:hover { background: var(--red); color: #fff; }
.fav-move { position: absolute; top: calc(var(--fav) - 20px); display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; box-shadow: var(--shadow); }
.fav-move .icon-btn { width: 28px; height: 28px; }
.fav-grid.editing .fav-icon { animation: fav-jiggle .3s ease-in-out infinite alternate; }
@keyframes fav-jiggle { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .fav-grid.editing .fav-icon { animation: none; } }
.fav-empty { grid-column: 1 / -1; align-self: center; padding: 4px 2px; }
@media (prefers-color-scheme: dark) {
  .fav-icon { border-color: rgba(255, 255, 255, .06); box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35); }
  .fav-badge.gov { background: #E6F0EE; color: #0E1614; }
  .fav-badge.nhs { background: #3D8FE0; }
}

/* widget cards */
.sp-card { padding: 16px 16px 14px; }
.sp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 34px; }
.sp-card-head h2 { font-size: 17px; margin: 0; flex: 1; min-width: 0; }
.sp-card-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-card-right .text-link { font-size: 14px; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sp-mini-select { min-height: 34px; padding: 4px 28px 4px 10px; font-size: 14px; max-width: 150px; border-radius: 10px; }
.sp-empty { color: var(--ink-2); margin: 6px 2px 10px; }
.sp-rows { list-style: none; margin: 0 0 8px; padding: 0; }
.sp-rows > li + li { border-top: 1px solid var(--hairline); }
.sp-row { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.sp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 7px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sp-row-main.static { cursor: default; }
.sp-row-title { font-weight: 500; overflow-wrap: anywhere; }
.sp-row-main small { color: var(--ink-2); font-size: 13px; }
.sp-row-main small.text-red { color: var(--red); }
.sp-more { padding: 8px 0 2px; font-size: 14px; }
.sp-add { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 12px; padding: 4px 4px 4px 12px; margin-top: 4px; }
.sp-add:focus-within { border-color: var(--teal); }
.sp-add input { border: 0; background: transparent; min-height: 36px; padding: 4px 0; outline: none !important; font-size: 15px; }
.sp-add .sp-mini-select { background-color: var(--surface); max-width: 120px; }
.sp-add .round-btn { width: 36px; height: 36px; }
.sp-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-day-name { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 0 0 4px; }
.sp-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-event { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--person) 12%, var(--surface)); }
.sp-event:hover { background: color-mix(in srgb, var(--person) 22%, var(--surface)); }
.sp-event.kind-task { background: transparent; border-color: color-mix(in srgb, var(--person) 50%, transparent); }
.sp-event.kind-renewal { background: var(--amber-tint); }
.sp-event-time { flex: none; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; min-width: 46px; }
.sp-event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-doc { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--ink); text-decoration: none; min-width: 0; }
.sp-doc:hover { color: var(--ink); }
.sp-doc:hover strong { color: var(--teal); }
.sp-doc-text { display: flex; flex-direction: column; min-width: 0; }
.sp-doc-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-doc-text small { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-doc .pill { flex: none; }
.sp-trip-btn { margin-top: 10px; }
.sp-trip { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--amber-tint); color: var(--amber-ink); font-size: 14px; font-weight: 500; }
.sp-weather { min-height: 132px; }
.sp-weather.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--track) 0%, var(--bg) 50%, var(--track) 100%); background-size: 200% 100%; animation: sp-shimmer 1.4s linear infinite; }
@keyframes sp-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sp-weather.skeleton { animation: none; } }
.sp-weather-now { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sp-weather-icon { color: var(--amber); display: inline-flex; }
.sp-temp { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.sp-weather-text { display: flex; flex-direction: column; min-width: 0; }
.sp-weather-text small { color: var(--ink-2); }
.sp-weather-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sp-weather-days li { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 12px; background: var(--bg); text-align: center; }
.sp-weather-days .icon { color: var(--teal); }
.sp-wd-name { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.sp-wd-temp { font-size: 14px; font-variant-numeric: tabular-nums; }
.sp-wd-rain { font-size: 11px; color: var(--ink-2); }
.sp-weather-empty .place-picker { margin-top: 4px; }
.place-picker .row { gap: 8px; }
.place-picker input { min-width: 0; }
.place-results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.place-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.place-option:hover { border-color: var(--teal); background: var(--ice); }
.place-option .icon { color: var(--teal); }
.place-option strong { display: block; font-weight: 500; }
.place-option small { color: var(--ink-2); }
.sp-notes { width: 100%; min-height: 150px; resize: vertical; background: color-mix(in srgb, var(--amber-tint) 45%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 25%, var(--hairline)); line-height: 1.5; }
.sp-notes-status { font-size: 12px; }

/* customise dialog */
.dialog-customise { width: min(640px, calc(100vw - 24px)); }
.cust-block { margin-bottom: 20px; }
.cust-block h3 { font-size: 15px; margin: 0 0 8px; }
.cust-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cust-sections { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.cust-section { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; background: var(--surface); position: relative; }
.cust-section + .cust-section { border-top: 1px solid var(--hairline); }
.cust-section.dragging { opacity: .4; }
.cust-section.drop-before { box-shadow: inset 0 3px 0 var(--teal); }
.cust-grip { color: var(--ink-2); cursor: grab; display: inline-flex; padding: 4px; }
.cust-section .check { font-weight: 500; }
.wall-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.wall-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.wall-swatch { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; background: var(--wall); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.wall-choice:has(input:checked) .wall-swatch { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.wall-choice:has(input:checked) { color: var(--teal); font-weight: 700; }
.wall-choice:has(input:focus-visible) .wall-swatch { outline: 2.5px solid var(--focus); outline-offset: 4px; }
.segmented label.seg { cursor: pointer; }
.segmented label.seg:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 1px; }
.cust-place .row { margin: 0 0 8px; }

@media (max-width: 760px) {
  .sp-head { margin: 2px 0 16px; min-height: 64px; gap: 10px; }
  .sp-greet { font-size: 27px; }
  .sp-meta { font-size: 15px; }
  .start-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sp-search input { font-size: 16px; min-height: 46px; }
  .sp-engine { display: none; }
  .cust-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 480px) {
  .hide-xs { display: none !important; }
  .fav-grid { --fav: 62px; gap: 14px 2px; }
  .fav-grid.size-small { --fav: 50px; }
  .fav-grid.size-large { --fav: 84px; }
  .fav-grid { grid-template-columns: repeat(auto-fill, minmax(calc(var(--fav) + 16px), 1fr)); }
  .fav-tile { width: calc(var(--fav) + 16px); }
  .fav-name { font-size: 12px; }
  .sp-customise { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
  .sp-meta { font-size: 15px; }
}

/* ---------------------------------------------------------------- photos on documents */
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.photo-buttons.compact { margin: 0; gap: 6px; }
.photo-block { border: 1.5px dashed var(--hairline); border-radius: var(--radius); padding: 14px; background: color-mix(in srgb, var(--ice) 35%, transparent); }
.photo-block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.photo-block-head strong { display: block; }
.photo-block-head small { display: block; }
.photo-block .photo-buttons { margin: 0; }
.staged-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.staged { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; min-width: 0; }
.staged-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; background: var(--track); }
.staged-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.thumb-grid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.thumb { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.thumb-open { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--track); cursor: zoom-in; box-shadow: var(--shadow); color: var(--ink-2); }
.thumb-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-open > .icon { margin: auto; }
.thumb-open:hover { border-color: var(--teal); }
.thumb-name { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.thumb-remove { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 50%; box-shadow: var(--shadow); }
.family-photo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.family-photo-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-right: 4px; }
.family-photo .staged-files { flex-basis: 100%; margin: 2px 0 0; }
@media (max-width: 760px) {
  .thumb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }

/* ---------------------------------------------------------------- several people per item, account website (document editor + detail) */
.who-picker .chip-everyone { font-weight: 600; }
.chip-button { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; color: var(--teal); font: 500 14px var(--sans); cursor: pointer; border-style: dashed; }
.chip-button:hover { border-color: var(--teal); background: var(--ice); }
.who-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.who-new input { flex: 1 1 180px; min-width: 0; }
.who-new .hint { flex-basis: 100%; margin: 0; }
.who-hint { margin: 8px 0 0; }
.who-people { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }
.account-suggest:not(:empty) { margin-top: 8px; }
.doc-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.doc-quick-actions .btn { min-height: 44px; }
.doc-open-account { max-width: 100%; }
.doc-open-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 480px) {
  .doc-quick-actions .btn { flex: 1 1 100%; justify-content: center; }
}
