/* fairfamily — one stylesheet for the site and the app. Plain on purpose: the
   people reading it are busy, often tired, and sometimes on a phone in a
   hospital corridor. Large text, clear buttons, nothing that moves. */

:root {
  color-scheme: light dark;
  --ink: #1f2522;
  --bg: #f6f4ef;
  --paper: #ffffff;
  --line: #e1ddd3;
  --muted: #5d6762;
  --brand: #2f5d50;
  --brand-ink: #f6f4ef;
  --accent: #b5622f;
  --good: #1d7a4f;
  --bad: #b23b3b;
  --warn-bg: #fff4dc;
  --warn-line: #ecc77a;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e5df; --bg: #121715; --paper: #1a211e; --line: #2c3632; --muted: #9ba7a1;
    --brand: #7cc0aa; --brand-ink: #0d1412; --accent: #e3a26f; --good: #4cc08a; --bad: #ef7d7d;
    --warn-bg: #2d2717; --warn-line: #6d5a2c;
  }
}

* { box-sizing: border-box; }
/* Classes that set display (.claim, .btn, .card…) must not win over hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
h1 { font-size: clamp(28px, 4.6vw, 42px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small, .hint { font-size: 14px; }
.hint { color: var(--muted); margin-top: 6px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.debt { color: var(--bad); font-weight: 650; }
.credit { color: var(--good); font-weight: 650; }
.error { color: var(--bad); min-height: 1em; }
.ok { color: var(--good); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

main { max-width: 780px; margin: 0 auto; padding: 36px 20px 64px; }
main.wide { max-width: 1120px; }

/* ── Header and footer ─────────────────────────────────────────────────── */

.site-header {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 550; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--ink); }
.site-header .account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync-dot[data-state="synced"] { background: var(--good); }
.sync-dot[data-state="syncing"] { background: var(--accent); }
.sync-dot[data-state="error"], .sync-dot[data-state="offline"] { background: var(--bad); }

.claim { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }

.site-footer {
  display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap;
  padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 14px; }
.btn.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.honeypot { position: absolute; left: -5000px; }

/* ── Blocks ────────────────────────────────────────────────────────────── */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
.notice ul { margin: 0; padding-left: 18px; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.bad { color: var(--bad); border-color: var(--bad); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
tr:last-child td { border-bottom: 0; }


/* ── App ───────────────────────────────────────────────────────────────── */

.app-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.app-top select { width: auto; min-width: 220px; font-weight: 650; }

/* The month grid. Seven columns, a day per cell, a line per task. */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.month .dow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: center; padding: 4px 0; }
.month .day { min-height: 86px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 4px 5px; font-size: 13px; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.month .day.other { opacity: 0.45; }
.month .day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.month .day.selected { background: color-mix(in srgb, var(--brand) 10%, var(--paper)); }
.month .day .d { font-weight: 700; font-size: 13px; }
.month .chip { display: block; font-size: 12px; line-height: 1.3; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--who, var(--muted)); background: color-mix(in srgb, var(--who, var(--muted)) 12%, transparent); }
.month .chip.open { border-left-style: dashed; background: var(--warn-bg); }
.month .chip.done { text-decoration: line-through; opacity: 0.7; }
@media (max-width: 640px) {
  .month .day { min-height: 54px; }
  .month .chip { font-size: 0; height: 6px; padding: 0; }
}

/* A task in a list: what, when, who, and the one button that matters. */
.task { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .what { font-weight: 650; }
.task .meta { color: var(--muted); font-size: 14px; }
.task .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.task.done .what { text-decoration: line-through; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.who::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--who, var(--muted)); }
.who.open { color: var(--accent); }
.who.open::before { background: transparent; border: 2px dashed var(--accent); width: 8px; height: 8px; }

/* The fairness bars: one per person, the share of the care they gave. */
.bars { display: grid; gap: 10px; margin: 12px 0; }
.bar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; }
.bar .track { height: 16px; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--who, var(--brand)); }
.bar .fair { position: relative; }
.bar .num { font-size: 14px; }
.verdict { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 8px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; max-width: 560px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }

/* ── Marketing ─────────────────────────────────────────────────────────── */

.hero { padding: 24px 0 8px; }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 640px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.hero .cta { margin-top: 18px; }
.steps { counter-reset: step; padding: 0; list-style: none; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin: 0 0 14px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 750; font-size: 14px; }
.plan-pro { border: 2px solid var(--brand); }

@media print {
  .site-header, .site-footer, .claim, .tabs, .no-print, .app-top select, .app-top .btn { display: none !important; }
  body { background: #fff; color: #000; }
  main, main.wide { max-width: none; padding: 0; }
  .card, table { border-color: #ccc; }
}
