/* Server pages: same family as the planners (Plus Jakarta Sans + Inter, the planners' neutrals and accent). */
:root {
  --bg: #f4f5f4; --surface: #ffffff; --surface-2: #eef0ef; --line: #dcdfdd; --line-strong: #c6cac7;
  --fg: #14201a; --muted: #56665c; --faint: #7d8b82;
  --accent: #f4b122; --accent-ink: #291f15; --accent-text: #805400;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --good: #17803d; --good-soft: color-mix(in srgb, #17803d 12%, transparent);
  --warn: #a95a06; --warn-soft: color-mix(in srgb, #d97706 14%, transparent);
  --bad: #b42318; --bad-soft: color-mix(in srgb, #b42318 11%, transparent);
  --f-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px; --radius-sm: 9px;
  /* the planners' own colours for people / pets / homes, and the budget's Needs / Wants / Savings */
  --p1: #2a78d6; --p2: #eb6834; --p3: #1baf7a; --p4: #eda100; --p5: #e87ba4; --p6: #008300; --p7: #6250d6; --p8: #e34948;
  --b-needs: #3b6fb6; --b-wants: #e0892f; --b-savings: #2e9a6a;
  color-scheme: light;
}
/* Auto follows the device; a choice in Settings (data-theme on the page) wins over it */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151616; --surface: #1d1e1e; --surface-2: #262727; --line: #313333; --line-strong: #454747;
    --fg: #ebecec; --muted: #a6a9a8; --faint: #808382;
    --accent: #f4b122; --accent-text: #f4b122;
    --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
    --good: #4cc27a; --warn: #e6a23c; --bad: #f0796b;
    --p1: #3987e5; --p2: #d95926; --p3: #199e70; --p4: #c98500; --p5: #d55181; --p6: #008300; --p7: #9085e9; --p8: #e66767;
    --b-needs: #6f9de0; --b-wants: #f0a060; --b-savings: #5cc29d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151616; --surface: #1d1e1e; --surface-2: #262727; --line: #313333; --line-strong: #454747;
  --fg: #ebecec; --muted: #a6a9a8; --faint: #808382;
  --accent: #f4b122; --accent-text: #f4b122;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --good: #4cc27a; --warn: #e6a23c; --bad: #f0796b;
  --p1: #3987e5; --p2: #d95926; --p3: #199e70; --p4: #c98500; --p5: #d55181; --p6: #008300; --p7: #9085e9; --p8: #e66767;
  --b-needs: #6f9de0; --b-wants: #f0a060; --b-savings: #5cc29d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); min-height: 100vh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }
a { color: var(--accent-text); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
h3 { font-size: 15px; font-weight: 700; margin: 22px 0 8px; }
p { margin: 0 0 10px; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 16px; }

/* ---------- top bar ---------- */
/* the page's width lives in --page, so the top bar's contents line up with the page's on every page: the bar's own background stays full width */
body { --page: 980px; --gutter: clamp(16px, 4vw, 32px); }
body:has(.main.narrow) { --page: 460px; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter))); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); text-decoration: none; font: 800 17px/1 var(--f-display); }
.brand svg { width: 28px; height: 28px; flex: none; }
/* signed out (sign-in, first account, two-step): no menu, so the logo and name sit in the middle */
.top.solo { justify-content: center; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
/* it's Sign out's words that line up with the page; its hover background reaches past them */
@media (min-width: 561px) { .nav { margin-right: -11px; } }
.nav a, .nav .link { color: var(--muted); text-decoration: none; font: 600 14px/1 var(--f-body); padding: 9px 11px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.nav a:hover, .nav .link:hover { color: var(--fg); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.signout { margin: 0; }

/* ---------- layout ---------- */
.main { max-width: var(--page); margin: 0 auto; padding: clamp(20px, 4vw, 36px) var(--gutter) 64px; }
.head { margin-bottom: 22px; }
.head p { margin-top: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card > p { max-width: 68ch; }

/* ---------- forms ---------- */
label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select { font: 15px/1.3 var(--f-body); color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, .nav .link:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.stack { display: grid; gap: 14px; margin-top: 16px; }
.row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.row label { flex: 1 1 220px; }
/* two columns of fields. Each field takes three rows (its label, its box, its hint) shared with the one beside it, so labels, boxes and
   hints line up across a row whether or not either has a hint. A button in .act sits level with the box beside it */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 0; align-items: start; }
.grid2 > * { margin-bottom: 12px; }
.grid2 > div > .btn { justify-self: start; }
@supports (grid-template-rows: subgrid) {
  .grid2 > :is(label, div, span) { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .grid2 > label > :is(input, select, small) { margin-top: 5px; }
  .grid2 > .act > .btn { grid-row: 2; margin-top: 5px; }
}
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } .grid2 > span:empty { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: 600 14px/1 var(--f-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); vertical-align: 1px; }

.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; background: var(--good-soft); color: var(--fg); border-left: 4px solid var(--good); }
.flash.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.flash[hidden] { display: none; }

/* ---------- sign in ---------- */
.auth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 5vw, 32px); margin-top: clamp(0px, 4vh, 40px); }
.auth > p { color: var(--muted); margin-top: 8px; }

/* ---------- home: greeting, dashboard cards, planner list ---------- */
body.page-home { --page: 1240px; }
.hello { margin-bottom: 20px; }
.hello h1 { font-size: clamp(26px, 4.4vw, 34px); }
.hello p { margin: 4px 0 0; font-size: 15px; }

/* each card wears its planner's colour (--pa, from that planner's own accent setting) */
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 318px), 1fr)); gap: 14px; align-items: start; min-height: 120px; }
/* tiles (Settings): each card takes up as many 2px rows as its height needs (dash.js), so it sits right under the one above */
.dash.tiled { row-gap: 0; grid-auto-rows: 2px; grid-auto-flow: dense; }
.dash[aria-busy="true"]:empty::before { content: "Loading your dashboard…"; color: var(--muted); }
.dc { --pa: var(--accent); --pa-text: color-mix(in srgb, var(--pa) 80%, var(--fg)); --pa-soft: color-mix(in srgb, var(--pa) 12%, transparent);
  position: relative; display: grid; gap: 14px; align-content: start; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--pa); border-radius: 12px; padding: 14px 16px 16px; }
.dc.wide { grid-column: span 2; }
@media (max-width: 700px) { .dc.wide { grid-column: auto; } }
.dc:hover { border-color: var(--line-strong); border-top-color: var(--pa); }
.dc-head { display: grid; gap: 2px; }
.dc-link { color: inherit; text-decoration: none; display: grid; gap: 1px; }
.dc-link::after { content: ""; position: absolute; inset: -1px; border-radius: 12px; }   /* the whole card opens the planner */
.dc-link:focus-visible { outline: none; }
.dc-link:focus-visible::after { outline: 2px solid var(--pa); outline-offset: 2px; }
.dc-app { font: 600 12.5px/1.3 var(--f-body); color: var(--pa-text); }
.dc h3 { font: 700 17px/1.25 var(--f-display); margin: 0; }
.dc-sub { margin: 0; font-size: 13px; color: var(--muted); }

.dc-stat { display: flex; align-items: center; gap: 12px; }
.dc-stat .st { min-width: 0; }
.dc-stat p { margin: 0; }
.dc-stat .sv { font-family: var(--f-display); line-height: 1.05; }
.dc-stat .v { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dc-stat.is-text .v { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.dc-stat .of { font-size: 16px; font-weight: 600; color: var(--muted); }
.dc-stat .sl { font-size: 14px; font-weight: 600; margin-top: 3px; }
.dc-stat .sn { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dc-stat .sn.t-bad { color: var(--bad); font-weight: 600; } .dc-stat .sn.t-warn { color: var(--warn); font-weight: 600; }
.dc-stat.t-bad .v { color: var(--bad); } .dc-stat.t-warn .v { color: var(--warn); } .dc-stat.t-good .v { color: var(--good); }
.ring { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .rb { stroke: var(--surface-2); }
.ring .rf { stroke: var(--pa); stroke-linecap: round; }
.dc-stat.t-good .rf { stroke: var(--good); }

.dc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.dc-bars .bt { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.dc-bars .bl { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.dc-bars .br { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.meter i { display: block; height: 100%; width: var(--v, 0); background: var(--c, var(--pa)); border-radius: inherit; }
.dc-bars li.t-good .meter i { background: var(--c, var(--good)); }
.dc-bars li.t-warn .meter i { background: var(--warn); }
.dc-bars li.t-bad .meter i, .dc-bars li.over.t-bad .meter i { background: var(--bad); }
.dc-bars li.t-bad .br { color: var(--bad); font-weight: 600; }
.dc-bars .bn { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.dc-list { list-style: none; margin: 0; padding: 0; display: grid; }
.dc-list li { display: grid; grid-template-columns: 8px 1fr auto; align-items: baseline; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dc-list li:first-child { border-top: 0; padding-top: 0; }
.dc-list.has-w li { grid-template-columns: var(--ww, 4.5em) 8px 1fr auto; }
.dc-list li .w { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dc-list:not(.has-w) li .w { display: none; }
.dc-list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--pa)); align-self: center; }
.dc-list .dot.plain { background: var(--line-strong); }
.dc-list .b { display: grid; min-width: 0; }
.dc-list .lt { overflow-wrap: anywhere; }
.dc-list .ls { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.dc-list .r { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dc-list li.now .w { color: var(--pa-text); }
.dc-list li.done .lt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.dc-list li.faint .lt { color: var(--faint); }
.dc-list li.t-bad .w, .dc-list li.t-bad .lt { color: var(--bad); }
.dc-list li.t-bad .dot { background: var(--bad); }
.dc-list li.t-warn .w { color: var(--warn); }
.dc-list li.t-warn .dot.plain { background: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dc-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0; }
.dc-kv div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.dc-kv dt { font-size: 12px; color: var(--muted); }
.dc-kv dd { margin: 1px 0 0; font: 700 15px/1.3 var(--f-display); overflow-wrap: anywhere; }
.dc-kv .t-bad dd { color: var(--bad); } .dc-kv .t-warn dd { color: var(--warn); } .dc-kv .t-good dd { color: var(--good); }

.dc-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dc-chips li { font-size: 13px; padding: 3px 9px; border-radius: 99px; background: var(--pa-soft); }
.dc-empty { margin: 0; color: var(--good); font-size: 14px; font-weight: 600; }
.dc-foot { display: grid; gap: 3px; font-size: 13px; }
.dc-foot p { margin: 0; }
.dc-note { color: var(--muted); }
.dc-more { color: var(--pa-text); font-weight: 600; }
.dc-asof { color: var(--warn); font-size: 12.5px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dc { --pa-text: color-mix(in srgb, var(--pa) 55%, #ffffff); --pa-soft: color-mix(in srgb, var(--pa) 24%, transparent); }
}
:root[data-theme="dark"] .dc { --pa-text: color-mix(in srgb, var(--pa) 55%, #ffffff); --pa-soft: color-mix(in srgb, var(--pa) 24%, transparent); }
.dash-empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 22px; }
.dash-empty p { max-width: 64ch; margin: 8px 0 0; color: var(--muted); }
.dash-status { margin: 12px 0 0; font-size: 13.5px; }

.plist { margin-top: 40px; }
.plist > p { margin: 4px 0 14px; font-size: 14px; }
.planners { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.planners li { --pa: var(--accent); }
.pl { display: grid; gap: 4px; padding: 12px 14px; min-height: 68px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; border-left: 4px solid var(--pa); }
a.pl:hover { border-color: var(--line-strong); border-left-color: var(--pa); background: color-mix(in srgb, var(--surface) 92%, var(--pa)); }
.pl.off { border-left-color: var(--line-strong); opacity: .75; }
.pl-name { font: 700 15px/1.25 var(--f-display); }
.pl-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- the welcome list: a new account's first visit, and from Settings ---------- */
body.page-welcome { --page: 860px; }
.wl-first .nav { display: none; }
.wl h1.wl-hi { font: 800 clamp(30px, 5vw, 42px)/1.1 var(--f-display); margin: 12px 0 6px; }
.wl-ask { font: 700 clamp(19px, 3vw, 23px)/1.25 var(--f-display); margin: 0 0 2px; color: var(--fg); }
.wl-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.wl-row { --pa: var(--accent); }
.wl-row label { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--pa); border-radius: 10px; cursor: pointer; transition: opacity .18s ease, background .18s ease; }
.wl-row label:hover { background: var(--surface-2); }
.wl-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--pa); cursor: pointer; }
.wl-txt { display: grid; gap: 2px; min-width: 0; }
.wl-txt b { font: 700 15.5px/1.25 var(--f-display); }
.wl-txt span { font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--muted); }
/* once something is ticked, the rest dim; with nothing ticked yet (a new account) every row reads at full strength */
.wl-list:has(input:checked) .wl-row:has(input:not(:checked)) label { opacity: .55; }
.wl-starts { border: 0; margin: 28px 0 0; padding: 0; min-width: 0; }
.wl-starts legend { padding: 0; }
.wl-start-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; margin-top: 12px; }
.wl-start { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.wl-start:hover { background: var(--surface-2); }
.wl-start:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wl-start input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.wl-need { margin: 0 auto 0 0; font-size: 13.5px; }
.wl-need:empty { display: none; }
.wl-actions [aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.wl-tick input { animation: wl-pop .22s ease; }
.wl-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.wl-skip { background: none; border: 0; padding: 8px 4px; color: var(--muted); font: 600 14px/1 var(--f-body); cursor: pointer; }
.wl-skip:hover { color: var(--fg); text-decoration: underline; }
@keyframes wl-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wl-pop { 40% { transform: scale(1.22); } }
@keyframes wl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wl-leave { to { opacity: 0; transform: translateY(-6px); } }
/* each part waits its turn, then goes back to its own look (so an unticked row can still dim) */
.wl-anim .wl-hi { animation: wl-rise .5s .1s ease-out backwards; }
.wl-anim .wl-q { animation: wl-rise .5s .3s ease-out backwards; }
.wl-anim .wl-row { animation: wl-rise .4s .5s ease-out backwards; }
.wl-anim .wl-row:nth-child(2) { animation-delay: 535ms; }
.wl-anim .wl-row:nth-child(3) { animation-delay: 570ms; }
.wl-anim .wl-row:nth-child(4) { animation-delay: 605ms; }
.wl-anim .wl-row:nth-child(5) { animation-delay: 640ms; }
.wl-anim .wl-row:nth-child(6) { animation-delay: 675ms; }
.wl-anim .wl-row:nth-child(7) { animation-delay: 710ms; }
.wl-anim .wl-row:nth-child(8) { animation-delay: 745ms; }
.wl-anim .wl-row:nth-child(9) { animation-delay: 780ms; }
.wl-anim .wl-row:nth-child(10) { animation-delay: 815ms; }
.wl-anim .wl-row:nth-child(11) { animation-delay: 850ms; }
.wl-anim .wl-row:nth-child(12) { animation-delay: 885ms; }
.wl-anim .wl-row:nth-child(13) { animation-delay: 920ms; }
.wl-anim .wl-row:nth-child(14) { animation-delay: 955ms; }
.wl-anim .wl-row:nth-child(15) { animation-delay: 990ms; }
.wl-anim .wl-row:nth-child(16) { animation-delay: 1025ms; }
.wl-anim .wl-starts { animation: wl-rise .4s .95s ease-out backwards; }
.wl-anim .wl-actions { animation: wl-fade .4s 1.05s ease-out backwards; }
.wl-out { animation: wl-leave .22s ease-in forwards; }
.wl-arrive .main { animation: wl-fade .45s ease-out backwards; }

/* ---------- the tour ---------- */
.touring #customize[hidden] { display: inline-flex !important; }
.tour-block { position: fixed; inset: 0; z-index: 60; }
.tour-spot { position: fixed; z-index: 61; border-radius: 10px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62), 0 0 0 2px var(--accent-text); pointer-events: none; transition: left .32s ease, top .32s ease, width .32s ease, height .32s ease; animation: wl-fade .3s ease-out backwards; }
.tour-tip { position: fixed; z-index: 62; width: min(340px, calc(100vw - 20px)); box-sizing: border-box; padding: 16px; background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); transition: left .32s ease, top .32s ease; }
.tour-tip.in { animation: wl-rise .32s ease-out backwards; }
.tour-tip h2 { font: 800 18px/1.2 var(--f-display); margin: 0 0 6px; outline: 0; }
.tour-tip p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.tour-arrow { position: absolute; top: -8px; width: 14px; height: 14px; background: var(--surface); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg); }
.tour-tip.above .tour-arrow { top: auto; bottom: -8px; transform: rotate(225deg); }
.tour-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-sp { flex: 1; }
.tour-n { font-size: 12.5px; color: var(--muted); }
.tour-skip { background: none; border: 0; padding: 6px 4px; color: var(--muted); font: 600 13px/1 var(--f-body); cursor: pointer; }
.tour-skip:hover { color: var(--fg); text-decoration: underline; }
.tour-foot .btn[hidden] { display: none; }
.tour-block.out, .tour-spot.out, .tour-tip.out { opacity: 0; transition: opacity .22s ease; }
.tour-dot { display: inline-flex; align-items: center; padding: 8px; }
.tour-dot i { width: 10px; height: 10px; border-radius: 50%; background: #2e9a6a; }

/* ---------- hiding planners (Customize) ---------- */
.editing .planners > li:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.editing .planners > li > .pl { grid-area: 1 / 1; padding-right: 56px; cursor: default; }
.pl-hide { grid-area: 1 / 1; justify-self: end; align-self: center; margin-right: 8px; }

/* hidden cards under their planner, while customizing */
.pl-hc { grid-row: 2; list-style: none; margin: 6px 0 2px 14px; padding: 0; display: grid; gap: 4px; }
.hc-row { --pa: var(--accent); display: flex; align-items: center; gap: 6px; padding: 3px 5px 3px 4px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--pa); border-radius: 8px; cursor: grab; user-select: none; -webkit-user-select: none; }
.hc-grip { flex: none; display: inline-flex; padding: 6px 1px; color: var(--muted); touch-action: none; }
.hc-grip .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hc-t { flex: 1; min-width: 0; font: 600 13px/1.25 var(--f-body); }
.hc-row .btn { flex: none; min-height: 30px; padding: 0 9px; font-size: 13px; }
.dc.hc-ghost { width: 250px; padding: 10px 14px; }
.dc.hc-ghost h3 { font-size: 15px; margin: 2px 0 0; }
.dc.hc-ghost::after { display: none; }
#planners.drop-hide { background: var(--accent-soft); border-radius: 12px; }
#planners.drop-hide #planners-h::after { content: " \00b7  drop to hide"; font-weight: 600; font-size: 14px; color: var(--accent-text); }
.planners > li.pl-target > .pl { border-color: var(--accent); background: var(--accent-soft); }
fieldset.hc-choice { border: 0; padding: 0; margin: 0; }
fieldset.hc-choice[disabled] { opacity: .55; }
.hc-why { font-size: 14px; }
.ptray { margin-top: 14px; padding: 12px; }
.ptray h3 { font: 700 15px/1.25 var(--f-display); margin: 0; }
.ptray-done { margin: 10px 0 0; text-align: right; }
#planners { scroll-margin-top: 110px; }
.pl-manage { margin-top: 14px; font-size: 14px; }
.pl-none { margin-top: 6px; }

/* ---------- where the planner list goes ----------
   phone: behind the Planners button. Wide screen: in a column if the person chose that (Settings). In between: at the bottom. */
@media (max-width: 560px) {
  .page-home .plist { display: none; }
  .page-home.editing .plist { display: block; }
}
@media (max-width: 900px) {
  .home-grid.is-left { display: flex; flex-direction: column; }
  .home-grid.is-left > .plist { order: 1; }
}
@media (min-width: 901px) {
  body.pl-left { --page: 1280px; }
  .home-grid.is-left { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
  .is-left > .plist { margin-top: 0; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
  .is-left > .plist > p:not(.pl-none) { display: none; }
  .is-left .planners { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
  .is-left .pl { min-height: 0; }
}

/* ---------- data page ---------- */
.drop { display: grid; place-items: center; min-height: 96px; margin-top: 12px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-weight: 500; cursor: pointer; text-align: center; padding: 16px; }
.drop b { color: var(--accent-text); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.results { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.results li { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.results li.ok { background: var(--good-soft); }
.results li.bad { background: var(--bad-soft); }
.dlist { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.drow { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.drow:first-child { border-top: 0; }
.dmain { display: grid; gap: 3px; }
.dact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dact label.btn { display: inline-flex; }
.drow .say { grid-column: 1 / -1; font-size: 13.5px; margin: 0; }
.hist { grid-column: 1 / -1; }
.hist ul { list-style: none; padding: 0; margin: 4px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.hist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.hist li:first-child { border-top: 0; }
.hist .when { font-weight: 600; }
.hist .why { color: var(--muted); font-size: 13px; display: block; font-weight: 400; }
@media (max-width: 640px) { .drow { grid-template-columns: 1fr; } .dact { justify-content: flex-start; } }

/* ---------- settings ---------- */
.steps { margin: 16px 0 8px; padding-left: 22px; display: grid; gap: 18px; }
.steps p { margin: 0 0 10px; }
.qr { display: block; width: 240px; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-bottom: 10px; }
.key code { font-size: 15px; overflow-wrap: anywhere; }
.code-in { font-size: 20px; letter-spacing: .14em; }
.alt-code { margin-top: 16px; }
.alt-code summary { cursor: pointer; color: var(--muted); }
.codes { list-style: none; padding: 14px; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.codes code { font-size: 15px; white-space: nowrap; background: none; }
.people { list-style: none; padding: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.people > li { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.people > li:first-child { border-top: 0; }
.manage { flex-basis: 100%; }
.manage summary { list-style: none; display: inline-flex; }
.manage summary::-webkit-details-marker { display: none; }
.manage[open] summary { margin-bottom: 6px; }
.manage form { padding: 8px 0 4px; border-top: 1px dashed var(--line); }
.manage:not([open]) { flex-basis: auto; }

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

/* ---------- the Planners menu and the Settings gear (0.11): one row, beside the name, on every screen ---------- */
.nav .nav-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 600 14px/1 var(--f-body); padding: 9px 11px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.nav .nav-btn svg { width: 12px; height: 12px; transition: transform .15s; }
.nav .nav-btn:hover, .nav .nav-btn[aria-expanded="true"] { color: var(--fg); background: var(--surface-2); }
.nav .nav-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav .nav-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.nav a.gear { display: inline-flex; padding: 8px 9.7px 8px 8px; color: var(--muted); }   /* the drawing's right edge lines up with the page's */
.nav a.gear svg { width: 22px; height: 22px; display: block; }
.nav a.gear[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 270px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 32px rgba(0, 0, 0, .18); animation: dd-in .14s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes dd-fade { from { opacity: 0; } }
.dd-menu ul { list-style: none; margin: 0; padding: 0; }
.dd-menu a { display: flex; align-items: center; gap: 11px; padding: 7px 12px 7px 8px; border-radius: 9px; color: var(--fg); text-decoration: none; font-weight: 550; }
/* the planner's own icon on a soft tile of its colour, like its side menu */
.dd-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--pa, var(--muted));
  background: color-mix(in srgb, var(--pa, var(--muted)) 14%, transparent); }
.dd-ic svg { width: 18px; height: 18px; display: block; }
.dd-ic:empty { visibility: hidden; }
/* dark: the planners' colours are made for light backgrounds, so the drawing is lifted toward white to stay readable */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dd-ic { color: color-mix(in srgb, var(--pa, var(--muted)) 55%, #fff); background: color-mix(in srgb, var(--pa, var(--muted)) 26%, transparent); } }
:root[data-theme="dark"] .dd-ic { color: color-mix(in srgb, var(--pa, var(--muted)) 55%, #fff); background: color-mix(in srgb, var(--pa, var(--muted)) 26%, transparent); }
.dd-menu a[aria-current] .dd-ic { background: var(--pa, var(--accent)); color: var(--surface); }
.dd-menu .dd-manage { display: block; }
.dd-menu a:hover, .dd-menu a:focus-visible { background: var(--surface-2); outline: none; }
.dd-menu a[aria-current] { color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
.dd-menu .dd-manage { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.dd-none { padding: 8px 12px; margin: 0; }
/* the shade behind the menu on a phone: a tap on it closes the menu without landing on the page underneath */
.dd-scrim { display: none; }
/* a phone: the menu is a panel at the right under the bar, not the whole width, with rows big enough for a thumb */
@media (max-width: 560px) {
  .nav .nav-btn { padding: 9px 8px; }
  .dd { position: static; }
  .dd-menu { left: auto; right: 8px; width: min(280px, calc(100vw - 16px)); top: calc(100% + 2px); max-height: calc(100vh - 80px); }
  .dd-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, .28); animation: dd-fade .14s ease-out; }
  .dd-menu a { padding: 9px 12px 9px 8px; font-size: 16px; }
  .dd-ic { width: 34px; height: 34px; }
  .dd-ic svg { width: 20px; height: 20px; }
  .brand span { font-size: 16px; }
}
@media (max-width: 360px) { .brand span { display: none; } }

/* ---------- ticking things off on a card ---------- */
.dc-list.has-tick li { grid-template-columns: 22px 1fr auto; }
.dc-list.has-tick.has-w li { grid-template-columns: var(--ww, 4.5em) 22px 1fr auto; }
.dc-list.has-tick .dot { justify-self: center; }
.dc-list li.can-tick { align-items: center; }
.tick { position: relative; z-index: 1; width: 22px; height: 22px; margin: -6px 0; padding: 0; border-radius: 50%; cursor: pointer; background: var(--surface);
  border: 2px solid var(--c, var(--pa)); display: grid; place-items: center; }
.tick::before { content: ""; position: absolute; inset: -11px; }   /* a 44px target for a finger */
.tick::after { content: ""; width: 9px; height: 5px; margin-top: -3px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); color: var(--c, var(--pa)); opacity: 0; transition: opacity .12s; }
.tick:hover::after, .tick:focus-visible::after { opacity: .45; }
.tick:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.dc-list li.ticking .tick { background: var(--c, var(--pa)); }
.dc-list li.ticking .tick::after { opacity: 1; color: var(--surface); }
.dc-list li.can-tick.t-warn .tick { border-color: var(--warn); }

/* Skip this time, beside a tick: an icon only */
.dc-list .r.has-skip { display: inline-flex; align-items: center; gap: 8px; align-self: center; }
.skipb { position: relative; z-index: 1; width: 28px; height: 28px; margin: -4px -4px -4px 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; }
.skipb::before { content: ""; position: absolute; inset: -8px; }   /* a 44px target for a finger */
.skipb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skipb:hover { color: var(--fg); background: var(--surface-2); }
.skipb:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.dc-list li.skipping .lt { color: var(--muted); }
.dc-list li.skipping .skipb { opacity: .4; }

/* the question a tick asks first: who did it, or a job's details */
.ask-dlg .opts-head p { margin: 4px 0 0; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.who-b { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font: 600 15px/1.2 var(--f-body); text-align: left; cursor: pointer; }
.who-b:hover { border-color: var(--pa); background: color-mix(in srgb, var(--pa) 8%, var(--surface)); }
.who-b:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.who-b .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--pa)); flex: none; }
.who-b .dot.plain { background: var(--line-strong); }
.ask-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ask-money { position: relative; display: block; }
.ask-money .sym { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.ask-money input { padding-left: 30px; }

/* what's more than an hour late, or already over, folded into one line at the end of a list */
.dc-earlier { position: relative; z-index: 1; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 7px; font-size: 13.5px; }
.dc-earlier > summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; }
.dc-earlier > summary::-webkit-details-marker { display: none; }
.dc-earlier > summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.dc-earlier[open] > summary::before { transform: rotate(45deg); }
.dc-earlier.is-late > summary { color: var(--warn); }
.dc-earlier > .dc-list { margin-top: 8px; }
.dc-earlier > .dc-list li:first-child { border-top: 0; }

/* ---------- a folded card on a phone: its title and one line; the arrow opens it ---------- */
.dc-head { position: relative; }
.dc-fold { position: absolute; z-index: 1; top: -8px; right: -10px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--muted); }
.dc-fold::after { content: ""; position: absolute; left: 18px; top: 16px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg); transition: transform .15s; }
.dc.folded .dc-fold::after { transform: rotate(45deg); top: 13px; }
.dc-fold:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.dc-head:has(.dc-fold) .dc-link { padding-right: 34px; }
.dc-peek { display: none; margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.dc.folded .dc-peek { display: block; }
.dc.folded .dc-body, .dc.folded .dc-sub { display: none; }
.dc.folded { padding-bottom: 14px; }

/* ---------- the note at the bottom after a tick, with Undo ---------- */
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(520px, calc(100vw - 24px)); padding: 10px 10px 10px 16px; border-radius: 12px;
  background: var(--fg); color: var(--bg); font-size: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); transition: opacity .16s, transform .16s; }
.toast.in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast > span { flex: 1; }
.toast .btn { flex: none; background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }

/* Settings > Home page layout: the computer-only choices */
@media (max-width: 560px) { .desk-opts { display: none; } }

/* ---------- stage 3: customizing the dashboard ----------
   Each person arranges their own cards: drag by the handle, wide or normal, hide, choose what a card shows. */
.dc-body { display: grid; gap: 14px; min-width: 0; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.hello #customize { margin-bottom: 2px; }

.editbar { position: sticky; top: calc(var(--top-h, 58px) + 8px); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 0 0 16px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent); border-radius: 12px; box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .35); }
.editbar p { margin: 0; }
.eb-text { flex: 1 1 340px; font-size: 14px; }
.eb-how { color: var(--muted); }
.eb-status { font-size: 13px; color: var(--muted); min-width: 4em; }
.eb-status.bad { color: var(--bad); font-weight: 600; }
.eb-acts { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 560px) { .eb-how { display: none; } }

/* cards while customizing: controls on top, links switched off, quiet hover */
.editing .dc-link::after { display: none; }
.editing .dc-link { cursor: default; }
.editing .dc { padding-top: 8px; }
.dc-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 -8px -4px; }
.dc-tools .tr { display: flex; gap: 2px; }
.tb { display: inline-flex; align-items: center; gap: 6px; min-width: 40px; min-height: 40px; justify-content: center; padding: 0 9px;
  border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font: 600 13px/1 var(--f-body); cursor: pointer; }
.tb:hover { background: var(--surface-2); color: var(--fg); }
.tb:focus-visible { outline: 2px solid var(--pa, var(--accent)); outline-offset: 1px; }
.tb .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-move { cursor: grab; touch-action: none; background: var(--pa-soft); color: var(--pa-text); }
.t-move .ic { stroke-width: 3.2; }
.t-move:hover { background: color-mix(in srgb, var(--pa) 20%, transparent); color: var(--pa-text); }
.t-size[aria-pressed="true"] { color: var(--pa-text); }
@media (max-width: 700px) { .t-size { display: none; } }
.dc.is-empty { border-style: dashed; border-top-style: solid; background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.dc-none { margin: 0; font-size: 13.5px; color: var(--muted); }

/* the card being dragged follows the pointer; a dashed gap shows where it will land */
.dc.dragging { position: fixed; z-index: 50; margin: 0; pointer-events: none; max-height: 300px; overflow: hidden;
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .08); transform: rotate(-1deg) scale(1.015); }
.dc.dragging .t-move { cursor: grabbing; }
.dc.dragging::after { content: ""; position: absolute; inset: auto 0 0 0; height: 48px; background: linear-gradient(transparent, var(--surface)); }
.dc-ph { border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line-strong)); border-radius: 12px; background: var(--accent-soft); min-height: 90px; }
.dc-ph.wide { grid-column: span 2; }
@media (max-width: 700px) { .dc-ph.wide { grid-column: auto; } }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* on a phone, cards shrink to their titles while you arrange them, so the whole list fits on a few screens */
@media (max-width: 700px) {
  .editing .dash .dc-body, .editing .dash .dc-sub, .editing .dash .dc-none { display: none; }
  .editing .dash .dc { gap: 6px; padding-bottom: 12px; }
  .editing .dash { gap: 10px; }
  .dc.dragging .dc-body { display: none; }
}

/* hidden cards, under the dashboard while customizing */
.tray { margin-top: 22px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.tray h2 { font-size: 16px; }
.tray-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); max-width: 520px; gap: 8px; }
/* hidden cards: two columns of equal length, read down the first and then the second (--rows comes from dash.js). One column on a phone. */
@media (min-width: 641px) {
  #tray .tray-list { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), auto); grid-auto-flow: column; }
  #tray .tray-list li.tray-none { grid-column: 1 / -1; }
}
.tray-list li { --pa: var(--accent); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--pa); border-radius: 10px; }
.tray-list .tt { display: grid; min-width: 0; }
.tray-list .tt b { font: 700 14.5px/1.25 var(--f-display); }
.tray-list .tt small { color: var(--muted); font-size: 12.5px; }
.tray-list .btn .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tray-list li.tray-none { display: block; border: 0; background: none; padding: 0; color: var(--muted); font-size: 14px; }

/* "Choose what it shows" */
.opts-dlg { --pa: var(--accent); --pa-text: color-mix(in srgb, var(--pa) 80%, var(--fg)); width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line-strong); border-top: 4px solid var(--pa); border-radius: 14px; background: var(--surface); color: var(--fg);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.opts-dlg::backdrop { background: rgba(10, 14, 12, .45); }
.opts-form { display: grid; gap: 16px; padding: 18px 20px 16px; }
.opts-head { display: grid; gap: 2px; }
.opts-head .dc-app { font: 600 12.5px/1.3 var(--f-body); color: var(--pa-text); }
.opts-head h2 { margin: 0; }
.opts-form .fld { gap: 6px; }
.chk { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 40px; cursor: pointer; }
.chk input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--pa); flex: none; }
.pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.pick legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.pick .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--pa)); flex: none; }
.pick .dot.plain { background: var(--line-strong); }
.pick .hint { margin: 4px 0 0; font-size: 12.5px; }
.opts-err { margin: 0; color: var(--bad); font-weight: 600; font-size: 13.5px; }
.opts-err:empty { display: none; }
.opts-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.opts-acts .sp { flex: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .opts-dlg { --pa-text: color-mix(in srgb, var(--pa) 55%, #ffffff); }
  :root:not([data-theme="light"]) .opts-dlg::backdrop { background: rgba(0, 0, 0, .6); }
}
:root[data-theme="dark"] .opts-dlg { --pa-text: color-mix(in srgb, var(--pa) 55%, #ffffff); }
:root[data-theme="dark"] .opts-dlg::backdrop { background: rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .dc.dragging { transform: none; } }

/* ---------- budget sync ---------- */
.sync-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sync-link h2 { margin-bottom: 2px; }
.sync-link p { margin: 0; }
.sync-start { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sync-start input { width: auto; }
.sync-row { display: block; }
.sync-on { display: flex; align-items: center; gap: 10px; }
.sync-on input, .sync-tick input { width: 20px; height: 20px; flex: none; }
.sync-row > .pl-meta { display: block; margin: 4px 0 0 30px; }
.sync-who { border: 0; padding: 0; margin: 12px 0 0 30px; }
.sync-who legend { font-weight: 600; padding: 0; }
.sync-who p { margin: 2px 0 6px; font-size: 13.5px; }
.sync-tick { display: inline-flex; align-items: center; gap: 8px; margin: 4px 18px 4px 0; }
.sync-map { margin: 10px 0 0 30px; }
.sync-map summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.sync-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.sync-grid label { display: grid; gap: 4px; font-size: 13.5px; }
.page-budget-sync form > .row { margin-top: 16px; }

/* ---------- notifications ---------- */
.notify-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .notify-times { grid-template-columns: 1fr; } }
.push-row { align-items: center; justify-content: space-between; }
.push-state { flex: 1 1 240px; margin: 0; }
.warn-pill { background: var(--warn-soft); color: var(--fg); }
.opt-hint { color: var(--muted); font-size: 13px; margin: -12px 0 0 0; }
.stack h3 { margin-bottom: 0; }

/* Settings > Notifications and Your account: each part in its own panel, its heading on a tinted strip across the top */
.ntf-part { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 0 16px 16px; margin: 0 0 14px; display: grid; gap: 12px; min-width: 0; }
.ntf-part > h3, .stack .ntf-part > h3 { margin: 0 -16px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ntf-part > p, .ntf-part > form, .ntf-part .people { margin: 0; }
.ntf-part > .flash { margin: 0; }
.ntf-part .push-row, .ntf-part > .row { margin: 0; }
.ntf-part > .grid2 > :last-child, .ntf-part > form > .row:last-child { margin-bottom: 0; }
.ntf-form { gap: 0; }
.ntf-form > .ntf-part { margin-bottom: 14px; }
.ntf-save { margin: 0 0 14px; }
.set-body > .ntf-part:last-child { margin-bottom: 0; }

/* ---------- syncing with a server ---------- */
.link-pick { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0; }
.link-pick legend { padding: 0 4px; }
#sync .row { margin-top: 10px; }

/* ---------- Appearance and Home page layout: each choice's title, note and options sit close together ---------- */
.stack.opts { gap: 0; margin-top: 4px; }
.opts h3 { margin: 14px 0 2px; }
.opts > p.muted, .opts > .hc-why { margin: 0 0 2px; font-size: 13.5px; line-height: 1.4; max-width: 68ch; }
.opts .sync-tick { margin: 2px 16px 2px 0; font-size: 14px; }
/* the radios don't take the 44px height of a text box; the whole label is still easy to tap */
.opts .sync-tick { min-height: 32px; }
.opts .sync-tick input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; }
.opts > div:last-child { margin-top: 12px; }
#appearance > p.muted, #home-layout > p.muted { margin-bottom: 4px; }

/* ---------- setting up the Android app: notifications and the battery ---------- */
.phone-setup .ps-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.phone-setup .ps-row > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.phone-setup .ps-row .muted { font-size: 13.5px; line-height: 1.35; }
.phone-setup .ps-row.done b::after { content: " \2713"; color: var(--ok, var(--accent)); }
.phone-setup .ps-row .btn { flex: none; min-height: 44px; }
.phone-setup .opts-head p { margin: 4px 0 0; }
.battery-row { margin-top: 8px; }

/* a planner still on its sample, in the planner list */
.pl-sample { color: var(--muted); font-style: italic; }

/* Settings > Notifications: what to tell you about, a group per planner */
.ntf-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px 18px; }
.ntf-group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; align-content: start; }
.ntf-group legend { padding: 0; margin-bottom: 4px; font-weight: 700; }
.ntf-group .chk span { display: grid; gap: 1px; }
.ntf-group small { font-size: 12.5px; line-height: 1.35; }
.ntf-group .chk { align-items: flex-start; min-height: 0; padding: 3px 0; }
.ntf-group .chk input { margin-top: 1px; accent-color: var(--accent); }

/* ---------- Settings in the app: sections that start folded (pages.js settings, app.js) ---------- */
details.set-sec { padding: 0; margin-bottom: 10px; scroll-margin-top: 80px; }
details.set-sec [id] { scroll-margin-top: 80px; }
details.set-sec > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 14px 18px; cursor: pointer; border-radius: var(--radius); -webkit-tap-highlight-color: transparent; }
details.set-sec > summary::-webkit-details-marker { display: none; }
details.set-sec > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 4px auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.set-sec[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
details.set-sec > summary:active { background: var(--surface-2); }
details.set-sec[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.set-sum { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-title { font: 700 17px/1.25 var(--f-display); letter-spacing: -.01em; color: var(--fg); }
.set-sub { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.set-sec[open] .set-sub { display: none; }
.set-body { padding: 16px 18px 20px; border-top: 1px solid var(--line); }
.set-body > :first-child { margin-top: 0; }

/* Settings: the owners' sections under their own heading, and the note a form that saves as it changes leaves */
.set-group { margin: 30px 0 10px; font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.set-group .muted { font-size: 13px; font-weight: 600; }
.saved-note { margin: 0; min-height: 1.2em; }
.saved-note:empty { display: none; }
.po-more { margin-top: 0; }
/* a linked phone's app version, under its name: faint when not known, in the warning colour when older than this site */
.people small .faint { color: var(--faint); }
.people small .warn-text { color: var(--warn); font-weight: 600; }
