:root {
  /* The same palette as Yomi Focus on iPhone and iPad (mobile/src/ui/kit.tsx) and in Chrome. */
  --bg: #f4f5fa; --surface: #fff; --surface-2: #f0f1f7; --border: #e2e4ee;
  --text: #121527; --text-2: #61697f; --text-3: #8b92a6;
  --accent: #5b4ae8; --accent-hover: #4b3bd6; --accent-soft: #edeafd; --accent-text: #fff;
  --good: #15803d; --good-soft: #e8f6ee; --warm: #b45309; --warm-soft: #fff6e6; --bad: #dc2626; --bad-soft: #fdeeee;
  --radius: 16px; --radius-lg: 22px; --shadow: 0 1px 2px rgba(20,20,60,.04), 0 8px 24px rgba(30,27,75,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d18; --surface: #151827; --surface-2: #1c2033; --border: #262b40;
    --text: #f3f4fa; --text-2: #99a0b8; --text-3: #747b93;
    --accent: #7c6cff; --accent-hover: #9083ff; --accent-soft: #241f4a;
    --good: #34d399; --good-soft: #1b2e24; --warm: #fbbf24; --warm-soft: #2b2416; --bad: #f87171; --bad-soft: #3a1f22; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.pad { padding: 24px; }
.faint { color: var(--text-3); font-size: 12.5px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand em { font-style: normal; color: var(--text-2); font-weight: 500; }
.brand img { border-radius: 7px; }
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-right .who { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 53px); }
.shell:has(nav[hidden]) { grid-template-columns: minmax(0, 1fr); }
.side { padding: 16px 10px; border-right: 1px solid var(--border); background: var(--surface); }
.side h4 { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.side { position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; }
.side a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.side a .ico { flex: none; color: var(--text-2); }
.side a[aria-current="page"] .ico { color: var(--accent); }
.side a .lbl { flex: 1; min-width: 0; }
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--warm); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
main { padding: 28px 32px 64px; max-width: 1100px; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card > h2 { margin-bottom: 10px; }
.card.center { max-width: 440px; margin: 48px auto; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--text-2); font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--text-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.sm, .btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 12px; }

label.f { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; }
.field { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 11px; }
.field:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.narrow { width: auto; min-width: 0; }
.field.code { font: 600 22px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .3em; text-align: center; }
textarea.field { resize: vertical; min-height: 70px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
table.t input.field { padding: 6px 8px; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warm-soft); color: var(--warm); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.note { border-radius: 12px; padding: 12px 14px; background: var(--accent-soft); }
.note.warn { background: var(--warm-soft); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.good { background: var(--good-soft); }
.errors { margin: 8px 0 0; padding-left: 20px; color: var(--bad); font-size: 14px; }

.check { list-style: none; padding: 0; margin: 0; }
.check li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.check li:last-child { border-bottom: none; }
.check .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 1px; }
.check .done .dot { background: var(--good); border-color: var(--good); color: #fff; }

.week { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; }
.week label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.week label.today { color: var(--accent); }
.week input { margin-top: 4px; }
.section-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }

.req { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.req:last-child { border-bottom: none; }
.req .what { font-size: 16px; font-weight: 600; }
.req q { quotes: "“" "”"; }
.req.fresh { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--warm-soft); } to { background: transparent; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 20; max-width: min(560px, calc(100vw - 32px)); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 56px minmax(0, 1fr); }
  main { min-width: 0; }
  /* Wide tables scroll inside the page instead of pushing it sideways. */
  main table.t { display: block; overflow-x: auto; max-width: 100%; }
  
  main { padding: 20px 16px 48px; }
  .week { grid-template-columns: 1fr; }
  .top-right .who { display: none; }
}

button.link-pill { border: 0; cursor: pointer; margin: 0 4px 4px 0; font: inherit; font-size: 12px; font-weight: 600; }
button.link-pill:hover { text-decoration: underline; }

.subject-pill { margin: 0 4px 4px 0; }

/* ---- Welcome and families ---- */
.welcome-head { max-width: 920px; margin: 24px auto 12px; }
.welcome-head h1 { margin-bottom: 6px; }
.welcome-head .note { margin-top: 10px; }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; max-width: 1100px; margin: 0 auto; align-items: start; }
.reward { margin-top: 12px; }
.reward .row { justify-content: space-between; margin-bottom: 6px; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
fieldset.days { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
fieldset.days legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
.daybox { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.pill.small { font-size: 11px; margin-top: 4px; }
@media print {
  .top, .side, .noprint, .toast, .page-head { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
}

.stack-sm { display: grid; gap: 4px; justify-items: start; }

/* Allowed and blocked words */
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.word.block { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); background: var(--bad-soft); }
.word.allow { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); background: var(--good-soft); }
.word .btn { padding: 2px 8px; min-height: 0; }
.word.site { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }

/* Plan and billing */
.seg-row { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; width: fit-content; }
.seg-btn { border: 0; background: transparent; padding: 8px 14px; font: inherit; cursor: pointer; color: inherit; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.price-summary { margin: 0; font-size: 16px; }
.good-text { color: var(--good); }
.price-table tr.here td { background: var(--accent-soft); }
.price-table td.strong { font-weight: 700; }
.card .f > span:first-child { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.people-row { display: grid; gap: 4px; width: fit-content; }
.top-right .btn.ghost.current { background: var(--surface-2); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---- My focus (individuals) ---- */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; align-items: start; }
.next-list, .plain-list, .q-list { list-style: none; margin: 0; padding: 0; }
.next-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.next-list li:first-child { padding-top: 2px; }
.next-list li:last-child { border-bottom: none; }
.next-main { min-width: 0; }
.next-project { font-size: 13px; font-weight: 600; color: var(--text-2); }
.next-step { font-size: 16px; font-weight: 600; margin-top: 2px; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.plain-list li:last-child { border-bottom: none; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
.wb { display: grid; gap: 6px; justify-items: center; }
.wb-track { width: 100%; max-width: 34px; height: 84px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.wb-track span { display: block; width: 100%; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 8px 8px 0 0; min-height: 0; }
.wb-track span.on { background: var(--accent); }
.wb-label { font-size: 12px; font-weight: 600; color: var(--text-3); }
.wb.today .wb-label { color: var(--accent); }
.wb.today .wb-track { outline: 2px solid var(--accent-soft); }
.wb.future .wb-track { opacity: .5; }
details > summary { cursor: pointer; }
details.add-project > summary, details.done-group > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details.add-project > summary::before, details.done-group > summary::before { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
details.add-project[open] > summary::before, details.done-group[open] > summary::before { content: '−'; }
details > summary::-webkit-details-marker { display: none; }
.add-project > summary h2 { margin: 0; }
.group-title { margin: 22px 0 10px; font-size: 16px; }
.done-group { margin-top: 8px; }
.project.stale { border-color: color-mix(in srgb, var(--warm) 35%, var(--border)); }
.project .section-head h2 { margin: 0; }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.next-line { margin: 10px 0 0; font-weight: 600; }
.project-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.project-details > summary { color: var(--accent); font-size: 14px; font-weight: 600; }
.project-details[open] > summary { margin-bottom: 10px; }
.project-details .why { display: grid; gap: 4px; margin-bottom: 10px; }
.project-details .steps { margin: 0 0 10px; padding: 0; list-style: none; }
.project-details .steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.project-details .steps li.done .step-check span { text-decoration: line-through; color: var(--text-3); }
.step-check { display: flex; gap: 10px; align-items: center; cursor: pointer; overflow-wrap: anywhere; }
.step-check input { width: 18px; height: 18px; accent-color: var(--good); flex: none; }
.step-tools { display: flex; }
.step-tools .btn { padding: 4px 7px; }
.add-row { flex-wrap: nowrap; }
.add-row .field { flex: 1; min-width: 0; }
.ideas { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.project-actions { margin-top: 14px; }
.q-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.q-item:last-child { border-bottom: none; }
.q-item .pill { margin-left: 6px; }
.week-rows { display: grid; gap: 10px; }
.wr { display: grid; grid-template-columns: 130px minmax(0, 1fr) 200px; gap: 12px; align-items: center; font-size: 14px; }
.wr .bar span { background: var(--accent); }
.wr-label { color: var(--text-2); }
.wr-value { color: var(--text-2); font-size: 13px; }
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .wr { grid-template-columns: 1fr; gap: 4px; }
  .project-details .steps li { grid-template-columns: minmax(0, 1fr) auto; }
  .project-details .steps li .pill { display: none; }
  .add-row { flex-wrap: wrap; }
  .q-item { flex-direction: column; align-items: flex-start; }
}
.top-right .btn .long { display: none; }
.top-right .setup-btn .long { display: inline; }
.top-right .setup-btn .short { display: none; }
@media (max-width: 760px) {
  .top-right .setup-btn .long { display: none; }
  .top-right .setup-btn .short { display: inline; }
}
.add-row select.field { flex: none; width: auto; }
.grid.stats3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid.stats3 .stat { padding: 12px 14px; }
.grid.stats3 .stat b { font-size: 22px; }
.grid.stats3 .stat b { white-space: nowrap; font-size: clamp(17px, 4.6vw, 22px); }
details.assign-ctx { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
details.assign-ctx > summary { cursor: pointer; color: var(--text); }
details.assign-ctx[open] > summary { margin-bottom: 4px; }

/* ---- Matching review ---- */
.review-card { display: grid; gap: 14px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.review-goal { font-size: 16px; font-weight: 600; }
.review-query { font-size: 20px; font-weight: 700; }
.review-results ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.review-decision { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.review-buttons .btn { gap: 8px; }
.review-btn kbd { font: 600 11px/1 ui-monospace, Menlo, monospace; padding: 2px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; }
.consent-card { border-color: var(--accent); }

/* Staff: All searches */
.row.filters { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.row.filters .field.narrow { width: auto; min-width: 140px; }
table.all-searches td { vertical-align: top; }

/* Family: high-fives */
.wins-card .win { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border, #e5e7eb); }
.wins-card .win:first-of-type { border-top: 0; }
.cheer-row { gap: 6px; flex-wrap: wrap; }
.cheer-btn { font-size: 20px; line-height: 1; padding: 6px 9px; }

/* Fundraising */
.share-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.big-code { font: 800 32px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--accent); overflow-wrap: anywhere; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; max-width: 260px; }
.code-status { margin: -4px 0 0; min-height: 1.2em; }
.payout-line { font-size: 18px; font-weight: 600; }
.support-card .row { flex-wrap: wrap; }
.fund-card .note { margin: 0; }
ul.plain { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.bad-text { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card.tile { display: grid; gap: 2px; padding: 16px; text-align: center; }
.card.tile b { font-size: 26px; line-height: 1.1; }
.card.tile span { color: var(--text-2); font-size: 13px; }
.goal-bar { margin: -4px 0 14px; }
.section-title { margin: 18px 0 8px; }
.warn-text { color: var(--warn, #b45309); }

/* Home */
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.home-needs { border-left: 4px solid var(--warn, #b45309); }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.checklist .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.checklist li.done .check { background: var(--good, #15803d); border-color: var(--good, #15803d); color: #fff; }
.checklist li.done b { color: var(--text-3); text-decoration: line-through; }
.quick-links { flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tutorial */
.tut-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }
.tut-card { position: fixed; z-index: 42; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px));
  background: var(--card, var(--bg)); color: var(--text); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; }
.tut-card h2 { margin: 2px 0 6px; font-size: 19px; }
.tut-card .tut-count { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.tut-card .tut-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }
#nav a.tut-spot { position: relative; z-index: 41; background: var(--accent-soft); outline: 3px solid var(--accent); border-radius: 10px; }
@media (min-width: 761px) { .tut-card { left: auto; right: 24px; transform: none; } }

/* ---- Family pages built like Yomi Parents (parent.js), with the shared pieces in app/app.css ---- */
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.pa-date { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.pa-date > div { display: grid; }
.pa-date span { color: var(--text-2); font-size: 12px; }
.pa-needs { display: grid; gap: 6px; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--warm) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warm) 35%, transparent); }
.pa-needs p { margin: 0; }
.pa-needs a { color: inherit; text-decoration: none; }
.pa-kids { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.pa-kid { display: grid; gap: 14px; align-content: start; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.pa-kid:hover { border-color: var(--accent); }
.pa-avatar { border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.pa-minis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.pa-mini { display: flex; gap: 8px; align-items: flex-start; }
.pa-mini > div { display: grid; }
.pa-mini b { font-size: 19px; font-weight: 800; }
.pa-mini span { color: var(--text-2); font-size: 12.5px; }
.pa-mini em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--good); }
.pa-mini em.bad { color: var(--bad); }
.pa-reward { display: grid; gap: 6px; }
.pa-cal { width: 46px; flex: none; display: grid; justify-items: center; padding: 4px 0; border-radius: 10px; border: 1px solid var(--border); }
.pa-cal span { font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.pa-cal span.bad { color: var(--bad); }
.pa-cal b { font-size: 18px; line-height: 1.1; }
@container (min-width: 1040px) { .app-cols.pa-c3 { grid-template-columns: 1fr 1fr 0.85fr; } }
@container (min-width: 760px) and (max-width: 1039px) { .app-cols.pa-c3 { grid-template-columns: 1fr 1fr; } }
.pa-heat { display: grid; grid-template-columns: 34px repeat(8, 1fr); gap: 4px; align-items: center; text-align: center; }
.pa-heat i { display: block; height: 22px; border-radius: 6px; }
.pa-settings { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pa-setting { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; }
.pa-setting:hover { border-color: var(--accent); }
.pa-setting .grow { flex: 1; display: grid; min-width: 0; }
.pa-setting span { color: var(--text-2); font-size: 13px; }

/* The menu folds to icons on a narrower window (each icon keeps its name as a tooltip and for screen readers). */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .side { padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .side h4 { width: 32px; height: 0; margin: 8px 0; border-top: 1px solid var(--border); font-size: 0; overflow: hidden; }
  .side h4:first-child { display: none; }
  .side a { justify-content: center; width: 48px; padding: 11px; }
  .side a .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side a .badge { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 5px; font-size: 11px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 56px minmax(0, 1fr); }
  .side { padding: 10px 4px; }
  .side a { width: 44px; padding: 10px; }
}
.keep-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.keep-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.keep-row > span { display: grid; gap: 2px; }
/* A button that's working: a small spinner after its label. */
.btn[aria-busy="true"]::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation-duration: 2.4s; } }
/* Touch screens: menu items and buttons at least 44 points tall; a clear keyboard focus ring everywhere. */
@media (pointer: coarse) {
  .btn, .side a, select.field, input.field, .btn.sm { min-height: 44px; }
  .side a { min-width: 44px; }
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Fundraising pages (fund.js), with the shared pieces in app/app.css ---- */
.fund-crumb { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; }
.fund-crumb a { color: var(--text-2); text-decoration: none; }
.fund-crumb a:hover { color: var(--accent); }
.fund-crumb [aria-current] { color: var(--text); font-weight: 600; }
.fund-hero { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: 22px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent); overflow: hidden; }
.fund-hero-text { flex: 1; min-width: 0; display: grid; gap: 6px; }
.fund-hero small { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; }
.fund-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.fund-where { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--text-2); }
.fund-where .ico { color: var(--accent); }
.fund-line { margin: 4px 0 0; color: var(--text-2); max-width: 560px; }
.fund-art { width: 260px; flex: none; }
@media (max-width: 700px) { .fund-art { display: none; } .fund-hero h1 { font-size: 26px; } }
.fund-step { display: flex; gap: 12px; align-items: flex-start; }
.fund-step b { display: block; }
.fund-step p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.fund-num { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.fund-code { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px; border-radius: 16px; border: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.fund-code span { font-size: 34px; font-weight: 800; letter-spacing: .12em; color: var(--accent); font-family: ui-monospace, Menlo, monospace; }
.fund-qr-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.fund-qr { width: 132px; height: 132px; border-radius: 12px; border: 1px solid var(--border); image-rendering: pixelated; flex: none; }
.fund-qr-actions { display: grid; gap: 8px; flex: 1; min-width: 160px; }
.fund-qr-actions .btn { justify-content: flex-start; }
.fund-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 10px; color: var(--text-2); text-align: center; }
.fund-empty .ico { color: var(--accent); opacity: .7; }
.fund-empty b { color: var(--text); }
.fund-payout { margin: 0; font-size: 16px; font-weight: 600; }
.fund-link { display: flex; gap: 8px; align-items: center; }
.fund-link .field { flex: 1; min-width: 0; }
.fund-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fund-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; align-content: start; }
.fund-form label.wide { grid-column: 1 / -1; }
.fund-form small { font-weight: 400; }
.fund-form .need { color: var(--bad); font-style: normal; }
.fund-preview { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.fund-preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.fund-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: inset 0 0 0 5px var(--accent), inset 0 0 0 7px #fff; }
.fund-preview-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; padding: 16px; align-items: center; }
.fund-preview-body small { color: var(--accent); font-weight: 700; font-size: 12px; }
.fund-preview-body h3 { font-size: 22px; font-weight: 800; margin: 2px 0; }
.fund-preview-body p { margin: 4px 0 10px; }
.fund-preview-body .fund-art { width: 100%; }
@media (max-width: 700px) { .fund-preview-body { grid-template-columns: 1fr; } }
.fund-faq { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.fund-faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.fund-faq summary::after { content: '⌄'; color: var(--text-2); }
.fund-faq[open] summary::after { content: '⌃'; }
.fund-faq p { margin: 0 0 12px; color: var(--text-2); }
/* The menu's nudge to share (hidden when the menu folds to icons). */
.nav-promo { margin: 18px 4px 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 6px; }
.nav-promo-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.nav-promo b { font-size: 16px; }
.nav-promo span { color: var(--text-2); font-size: 13.5px; }
.nav-promo .btn { margin-top: 6px; }
@media (max-width: 1100px) { .nav-promo { display: none; } }

/* ---- Sign in and sign up ---- */
main.signin-wide { max-width: none; padding: 0; }
.si-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 53px); }
.si-story { position: relative; overflow: hidden; padding: 64px 48px 0 clamp(24px, 8vw, 128px); background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 10%, transparent) 0 26%, transparent 27%),
  linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, var(--bg)), var(--bg)); display: flex; flex-direction: column; gap: 18px; }
.si-story h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; max-width: 520px; }
.si-story h1 em { font-style: normal; color: var(--accent); }
.si-lead { margin: 0; font-size: 19px; color: var(--text-2); max-width: 470px; line-height: 1.5; }
.si-feature { display: flex; gap: 18px; align-items: flex-start; max-width: 460px; }
.si-feature-icon { width: 64px; height: 64px; flex: none; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); color: var(--accent); }
.si-feature b { display: block; font-size: 17px; margin-top: 6px; }
.si-feature > div > span { color: var(--text-2); }
.si-laptop { margin-top: auto; align-self: flex-start; width: min(560px, 100%); transform: rotate(-3deg) translate(-40px, 24px); background: #2b2f45; border-radius: 22px 22px 0 0; padding: 14px 14px 0; box-shadow: 0 30px 60px rgba(30, 27, 75, .18); }
.si-screen { position: relative; background: #eef0fa; border-radius: 12px 12px 0 0; padding: 18px 18px 60px; min-height: 230px; }
.si-search { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 10px 14px; width: 72%; font-size: 13px; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.si-lines { display: grid; gap: 10px; margin-top: 18px; width: 52%; }
.si-lines i { display: block; height: 9px; border-radius: 5px; background: #dfe2f1; }
.si-lines i:nth-child(2n) { width: 70%; }
.si-dialog { position: absolute; right: -40px; top: 52px; width: 290px; background: #fff; color: #121527; border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px rgba(30, 27, 75, .22); transform: rotate(3deg); display: grid; gap: 12px; }
.si-dialog-head { display: flex; gap: 10px; align-items: center; }
.si-dialog-body { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.si-dialog-body > div { display: grid; gap: 2px; }
.si-dialog-body span { color: #61697f; }
.si-bulb { font-size: 26px; }
.si-dialog-actions { display: flex; gap: 10px; }
.si-dialog-actions .btn { flex: 1; justify-content: center; pointer-events: none; }
.si-card { align-self: center; justify-self: center; width: min(560px, calc(100% - 32px)); margin: 40px 16px; padding: 40px 48px; border-radius: 22px; text-align: center; }
.si-card h1 { font-size: 34px; font-weight: 800; }
.si-card > p { margin: 0; }
.si-card .f, .si-card .keep-row, .si-card .stack { text-align: left; }
.si-switch { margin: 0; }
.si-google { display: flex; gap: 12px; justify-content: center; padding: 13px; font-weight: 600; font-size: 16px; background: var(--surface); }
.si-or { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 14px; }
.si-or::before, .si-or::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.si-email { position: relative; display: block; }
.si-email .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.si-email .field { padding-left: 46px; height: 50px; }
.si-big { padding: 14px; font-size: 16px; border-radius: 12px; }
.si-terms { margin: 4px 0 0; }
.si-ask { color: var(--text-2); font-size: 14px; }
@media (max-width: 900px) {
  .si-wrap { grid-template-columns: 1fr; }
  .si-story { padding: 28px 20px; order: 2; }
  .si-laptop { display: none; }
  .si-card { padding: 28px 20px; margin: 20px auto; }
}
@media (max-width: 600px) { .si-ask { display: none; } }

.si-card { gap: 18px; }
.si-card .f { font-weight: 600; font-size: 15px; gap: 8px; }
.si-email .field { font-size: 16px; }
.si-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.si-card .f { color: var(--text); } .si-email { margin-top: 6px; }
.fund-money { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card.stack.si-card { gap: 18px; } .si-card .si-switch { margin-top: -6px; }
.si-apple { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 13px; font-weight: 600; font-size: 16px; background: #000; color: #fff; border-color: #000; }
.si-apple:hover { background: #1d1d1f; color: #fff; }
@media (prefers-color-scheme: dark) { .si-apple { background: #fff; color: #000; border-color: #fff; } .si-apple:hover { background: #f2f2f7; color: #000; } }
.si-apple[hidden], .si-google[hidden], .si-or[hidden] { display: none; }
/* Payout details: where direct deposit stands */
.fund-deposit { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2, var(--bg)); }
.fund-deposit.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, var(--border)); }
.fund-deposit.warn { background: var(--warm-soft); border-color: color-mix(in srgb, var(--warm) 35%, var(--border)); }
.fund-deposit-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.fund-deposit.good .fund-deposit-icon { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.fund-deposit.warn .fund-deposit-icon { background: color-mix(in srgb, var(--warm) 18%, transparent); color: var(--warm); }
.fund-deposit b { font-size: 17px; }
.fund-deposit p { margin: 4px 0 0; color: var(--text-2); }
.fund-deposit .fund-bank { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--text); font-weight: 600; }
.fund-page .app-actions .btn { max-width: 100%; white-space: normal; }
/* Staff: Focus Quarks analytics */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.grid2 .card h3 { margin: 0 0 8px; font-size: 16px; }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
