/* A phone-native utility: cool grouped lists, bold sans titles, one evergreen
   brand color. System fonts only: the app loads nothing from other sites. */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --ink: #1c2333; --muted: #667085; --faint: #a3a9b6;
  --line: #e7e5df; --line-strong: #d6d3cb;
  --brand: #1f2d4d; --brand-strong: #162139; --brand-ink: #ffffff; --brand-soft: #e8ebf2;
  --lemon: #d8b866; --lemon-ink: #2a2110;
  --hero: #1f2d4d; --hero-ink: #ffffff;
  --blue-bg: #e6ebf4; --blue: #2f4a7a; --green-bg: #e3efe6; --green: #2e6b45;
  --amber-bg: #f6edd6; --amber: #7d5a12; --red-bg: #f6e3e1; --red: #9b2c24;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --radius: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151d; --surface: #1a202b; --ink: #eef0f4; --muted: #a2a9b7; --faint: #6c7383;
    --line: #262d3a; --line-strong: #343c4b;
    --brand: #c9d3e8; --brand-strong: #dfe5f2; --brand-ink: #141a26; --brand-soft: #253049;
    --lemon: #d8b866; --lemon-ink: #2a2110;
    --hero: #2a3b62; --hero-ink: #ffffff;
    --blue-bg: #1f2a40; --blue: #a9bde3; --green-bg: #1b2e24; --green: #94c9a6;
    --amber-bg: #33290f; --amber: #e2c27a; --red-bg: #3a1e1c; --red: #eba39b;
    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(--ink); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.05rem/1 var(--display); color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
nav { display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
nav a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
nav a.on { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
body.in-setup nav { visibility: hidden; }
@media (max-width: 480px) { .hide-sm { display: none; } nav a { padding: 6px 10px; } }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 112px; }

/* hero: the signature color, full width */
.hero { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); background: var(--hero); color: var(--hero-ink); border-radius: 32px; padding: 24px 24px 20px; margin: 0 0 30px; position: relative; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; border: 22px solid rgb(216 184 102 / .35); }
.hero::after { content: ""; position: absolute; z-index: -1; right: 110px; bottom: -36px; width: 90px; height: 90px; border-radius: 26px; background: rgb(255 255 255 / .05); transform: rotate(18deg); }
.eyebrow { margin: 0; font: 700 .8rem/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.big { margin: 4px 0 0; font: 800 clamp(4.2rem, 19vw, 6.5rem)/0.95 var(--display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.big .of { opacity: .55; font-size: .5em; letter-spacing: -0.02em; }
.sub { margin: 6px 0 16px; font-weight: 600; opacity: .9; }
.sub b { background: var(--lemon); color: var(--lemon-ink); padding: 1px 8px; border-radius: 8px; }
.bar { height: 12px; border-radius: 6px; background: rgb(255 255 255 / .22); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--lemon); border-radius: 6px; transition: width .7s cubic-bezier(.16, 1, .3, 1); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { border: 0; border-radius: 999px; padding: 9px 14px; background: rgb(255 255 255 / .16); color: #fff; font: 700 .9rem/1 var(--display); cursor: pointer; }
.pill b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px; border-radius: 11px; background: var(--lemon); color: var(--lemon-ink); font-size: .78rem; }
.pill:active { transform: scale(.96); }
.art { display: block; width: 150px; margin: 10px auto 4px; }

/* grouped sections */
.group { margin-bottom: 26px; animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }
.group:nth-of-type(3) { animation-delay: 40ms; } .group:nth-of-type(4) { animation-delay: 80ms; } .group:nth-of-type(5) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .group { animation: none; } .bar span { transition: none; } }
.group > h2 { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font: 800 1.45rem/1.15 var(--display); letter-spacing: -0.025em; }
.card { background: var(--surface); border-radius: var(--radius); padding: 6px 18px; margin-bottom: 16px; box-shadow: 0 1px 0 var(--line), 0 10px 30px -20px rgb(20 30 50 / .25); }
.group > .card { margin-bottom: 0; }
.card > .hint:first-child { margin: 12px 0 2px; }
section.card { padding: 18px; } /* stand-alone cards: families, settings, wizard */
section.card h2 { margin: 0 0 8px; font: 700 1.2rem/1.25 var(--display); letter-spacing: -0.015em; }
.card h3 { margin: 18px 0 6px; font-size: .95rem; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  font: 700 .75rem/1 var(--sans); background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); font-variant-numeric: tabular-nums; }
.count.blue { background: var(--blue-bg); color: var(--blue); } .count.green { background: var(--green-bg); color: var(--green); }
.count.yellow { background: var(--amber-bg); color: var(--amber); } .count.red { background: var(--red-bg); color: var(--red); }
.meta, .hint { color: var(--muted); font-size: .875rem; }
.hint { margin: 0 0 8px; }
.center { text-align: center; }
.empty { text-align: center; padding: 36px 20px; }

/* rows */
ul { margin: 0; padding: 0; list-style: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.card ul > .row:first-child { border-top: 0; }
.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px;
  background: hsl(var(--h) 35% 91%); color: hsl(var(--h) 40% 30%); font: 800 1rem/1 var(--display); letter-spacing: .02em; }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 25% 28%); color: hsl(var(--h) 45% 88%); } }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.who a, .who b { font-weight: 650; text-decoration: none; color: var(--ink); }
.who .meta { font-size: .85rem; }
.note { margin-top: 3px; align-self: flex-start; font-size: .78rem; padding: 2px 8px; border-radius: 6px; background: var(--amber-bg); color: var(--amber); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.plain li { padding: 11px 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.line { display: flex; justify-content: space-between; gap: 12px; }
.line a { color: var(--ink); text-decoration: none; font-weight: 600; }
.line .meta { font-variant-numeric: tabular-nums; text-align: right; }
.fams li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fams a { color: var(--ink); text-decoration: none; font-weight: 600; }
.status { font-size: .75rem; font-weight: 650; padding: 3px 9px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--muted); }
.s-scheduled { background: var(--blue-bg); color: var(--blue); } .s-declared { background: var(--green-bg); color: var(--green); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); font: 750 .95rem/1 var(--display); text-decoration: none;
  cursor: pointer; transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); width: 44px; padding: 0; }
.btn.ghost span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn.no-contact { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.no-contact.primary { color: var(--muted); }
.btn.danger { color: var(--red); background: var(--red-bg); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: 600 .9rem var(--sans); cursor: pointer; }

/* forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 650; font-size: .9rem; }
.form label .meta { font-weight: 400; }
input, select, textarea { font: 400 1rem/1.4 var(--sans); padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input[type=file] { padding: 6px 0; border: 0; background: none; }
.acts select { width: auto; min-width: 170px; }
.inline { display: flex; gap: 8px; } .inline input { flex: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .toolbar input { flex: 1 1 200px; }
.preview { font-weight: 400; font-size: .85rem; color: var(--muted); white-space: pre-wrap; border-left: 3px solid var(--brand-soft); padding-left: 10px; }
code { font: .85em var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 5px; }

/* slots */
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.chip { padding: 8px 13px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: .875rem; font-variant-numeric: tabular-nums; }
.slots + .link { display: inline-block; margin-bottom: 14px; }

/* sync bar, toast */
.syncbar { max-width: 720px; margin: 12px auto 0; padding: 0 20px; font-size: .8rem; color: var(--muted); }
.syncbar.warn { color: var(--amber); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; display: flex; gap: 14px; align-items: center;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 14px; background: #14123a; color: #fff; font-size: .9rem; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
.toast .link { color: var(--lemon); }

/* wizard */
.wizard { padding: 26px 22px; }
.wizard h2 { font-size: 1.6rem !important; letter-spacing: -0.025em; }
.wiz-nav { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin: 26px 0 0; }
.wiz-nav [data-back] { margin-right: auto; }
.promise { background: var(--brand-soft); border-radius: 14px; padding: 16px 20px; }
.promise h3 { margin-top: 0; color: var(--brand); }
.promise ul, ol.how { list-style: disc; padding-left: 20px; } ol.how { list-style: decimal; }
.promise li, ol.how li { margin: 6px 0; }
.warn { background: var(--amber-bg); color: var(--amber); padding: 10px 14px; border-radius: 10px; font-size: .9rem; }
.sample { border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.sample p { margin: 6px 0 0; white-space: pre-wrap; }
details summary { cursor: pointer; font-weight: 650; }

@media (max-width: 480px) {
  .row .acts { width: 100%; margin-left: 0; }
  .row:has(.avatar) .acts { margin-left: 56px; width: calc(100% - 56px); }
  .row:has(.avatar) .who { flex-basis: calc(100% - 56px); }
  .hero { border-radius: 28px; padding: 20px 20px 18px; }
  .hero::before { width: 130px; height: 130px; right: -46px; top: -52px; border-width: 16px; }
}
