/* =====================================================================
   HOUSE STYLE  -  one look for every app (CRM, Study, CRM Training,
   Shopping, Soul Winning, Bible RPG). Built 2026-11-29 by APP CRM.
   Kenneth's bar: very organized, very intuitive, very easy to use,
   very pretty.  Do not fork this file per app: set data-app on <html>
   to pick your accent, and add app-only rules in your own app.css.
   ===================================================================== */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}

/* ---------- 1. TOKENS (light) ---------- */
:root {
  /* neutrals: warm paper, like the study site and the CRM site */
  --bg: #f6f3ec;          /* page */
  --surface: #fffdf9;     /* cards, sheets, lists */
  --surface-2: #f0ebe1;   /* inset fields, pressed rows */
  --surface-3: #e6dfd2;   /* skeletons, tracks */
  --ink: #1b2320;         /* main text */
  --ink-2: #44504a;       /* secondary text */
  --muted: #5f6862;       /* captions, meta */
  --line: #e4ddcf;        /* hairlines */
  --line-2: #d4cab8;      /* field borders */
  --scrim: rgba(20, 24, 22, .38);
  --glass: rgba(250, 248, 243, .82);
  --bar: #faf8f3;         /* bottom bars: opaque so page text never shows through */

  /* accent (default = CRM green; data-app swaps it, section 2) */
  --accent: #1f6a50; --accent-ink: #ffffff; --accent-soft: #e1eee6; --accent-line: #b8d5c5;

  /* meaning colours: same in every app */
  --good: #1c7048;  --good-soft: #e0f0e6;
  --warn: #8c5700;  --warn-soft: #f7ebd2;
  --bad: #b23b25;   --bad-soft: #f8e1da;
  --on-good: #ffffff; --on-bad: #ffffff;   /* text on solid good / bad fills */
  --info: #3a5a9c;  --info-soft: #e2e8f5;

  /* type */
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --fs-hero: 2.125rem;  --fs-title: 1.375rem; --fs-head: 1.125rem; --fs-body: 1.0625rem;
  --fs-sub: .9375rem;   --fs-cap: .8125rem;   --fs-tiny: .75rem;

  /* spacing scale: use only these */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;

  /* shape and depth */
  --r-s: 10px; --r: 14px; --r-l: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(27, 35, 32, .05), 0 2px 8px rgba(27, 35, 32, .04);
  --shadow-2: 0 2px 6px rgba(27, 35, 32, .06), 0 12px 32px rgba(27, 35, 32, .10);

  /* layout */
  --tap: 48px;           /* smallest touch target */
  --tabbar: 4rem;        /* tab bar min height (64px at 100%, grows with text size) above the home-indicator inset */
  --topbar: 52px;
  --maxw: 720px;         /* content column on iPad / desktop */
  /* Capacitor 8 on Android sets --safe-area-inset-* itself (older Android WebViews report env() as 0); iOS and browsers use env() */
  --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-l: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-r: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

/* ---------- 1b. TOKENS (dark) : follows the phone unless data-theme is set ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1311; --surface: #171c19; --surface-2: #1f2522; --surface-3: #29312d;
    --ink: #edece6; --ink-2: #c7ccc6; --muted: #949d97; --line: #262e2a; --line-2: #34403a;
    --scrim: rgba(0, 0, 0, .55); --glass: rgba(18, 23, 20, .80); --bar: #121714;
    --accent: #5fc596; --accent-ink: #0b1a12; --accent-soft: #19302a; --accent-line: #2b4d3e;
    --on-good: #0b1a12; --on-bad: #2a0d06;
    --good: #5fc596; --good-soft: #193026; --warn: #e5b45a; --warn-soft: #332a17;
    --bad: #ef8e76; --bad-soft: #3a211b; --info: #9db4ea; --info-soft: #1f2639;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1311; --surface: #171c19; --surface-2: #1f2522; --surface-3: #29312d;
  --ink: #edece6; --ink-2: #c7ccc6; --muted: #949d97; --line: #262e2a; --line-2: #34403a;
  --scrim: rgba(0, 0, 0, .55); --glass: rgba(18, 23, 20, .80); --bar: #121714;
  --accent: #5fc596; --accent-ink: #0b1a12; --accent-soft: #19302a; --accent-line: #2b4d3e;
  --on-good: #0b1a12; --on-bad: #2a0d06;
  --good: #5fc596; --good-soft: #193026; --warn: #e5b45a; --warn-soft: #332a17;
  --bad: #ef8e76; --bad-soft: #3a211b; --info: #9db4ea; --info-soft: #1f2639;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- 2. APP ACCENTS : <html data-app="..."> ---------- */
/* crm (green) is the default above. Each app gets one accent, light + dark. */
:root[data-app="study"]  { --accent: #3d4f9e; --accent-ink: #fff; --accent-soft: #e4e8f6; --accent-line: #c2cbec; }
:root[data-app="train"]  { --accent: #8a4b14; --accent-ink: #fff; --accent-soft: #f5e7d8; --accent-line: #e4c6a6; }
:root[data-app="shop"]   { --accent: #b53f26; --accent-ink: #fff; --accent-soft: #f9e4dc; --accent-line: #efc0b0; }
:root[data-app="soul"]   { --accent: #23558c; --accent-ink: #fff; --accent-soft: #e0eaf5; --accent-line: #b8cde6; }
:root[data-app="bible"]  { --accent: #7a5a12; --accent-ink: #fff; --accent-soft: #f4ecd6; --accent-line: #e2d0a0; }
@media (prefers-color-scheme: dark) {
  :root[data-app="study"]:not([data-theme="light"]) { --accent: #9fb0f2; --accent-ink: #111a3a; --accent-soft: #1f2540; --accent-line: #34406e; }
  :root[data-app="train"]:not([data-theme="light"]) { --accent: #eaa766; --accent-ink: #2a1604; --accent-soft: #33241a; --accent-line: #5a3d26; }
  :root[data-app="shop"]:not([data-theme="light"])  { --accent: #f28a6e; --accent-ink: #2e0d05; --accent-soft: #3a201a; --accent-line: #63362a; }
  :root[data-app="soul"]:not([data-theme="light"])  { --accent: #8ab8ec; --accent-ink: #0a1b2e; --accent-soft: #1a2738; --accent-line: #2d4462; }
  :root[data-app="bible"]:not([data-theme="light"]) { --accent: #e3c06a; --accent-ink: #261b02; --accent-soft: #312915; --accent-line: #574823; }
}
:root[data-app="study"][data-theme="dark"] { --accent: #9fb0f2; --accent-ink: #111a3a; --accent-soft: #1f2540; --accent-line: #34406e; }
:root[data-app="train"][data-theme="dark"] { --accent: #eaa766; --accent-ink: #2a1604; --accent-soft: #33241a; --accent-line: #5a3d26; }
:root[data-app="shop"][data-theme="dark"]  { --accent: #f28a6e; --accent-ink: #2e0d05; --accent-soft: #3a201a; --accent-line: #63362a; }
:root[data-app="soul"][data-theme="dark"]  { --accent: #8ab8ec; --accent-ink: #0a1b2e; --accent-soft: #1a2738; --accent-line: #2d4462; }
:root[data-app="bible"][data-theme="dark"] { --accent: #e3c06a; --accent-ink: #261b02; --accent-soft: #312915; --accent-line: #574823; }

/* ---------- 3. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 400 var(--fs-body)/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none; min-height: 100dvh;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--muted); opacity: 1; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }

/* ---------- 4. APP SHELL ---------- */
.shell { min-height: 100dvh; padding-top: var(--safe-t); padding-bottom: calc(var(--tabbar) + var(--safe-b)); }
.shell.no-tabs { padding-bottom: var(--safe-b); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s2);
  min-height: calc(var(--topbar) + var(--safe-t)); padding: var(--safe-t) calc(var(--s3) + var(--safe-r)) 0 calc(var(--s3) + var(--safe-l));
  margin-top: calc(-1 * var(--safe-t));
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .t { flex: 1; min-width: 0; text-align: center; font-size: var(--fs-head); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .side { min-width: var(--tap); display: flex; align-items: center; gap: var(--s1); }
.topbar .side.r { justify-content: flex-end; }

.page { max-width: var(--maxw); margin: 0 auto; padding: var(--s2) calc(var(--s4) + var(--safe-r)) var(--s7) calc(var(--s4) + var(--safe-l)); }
.hero { padding: var(--s2) 0 var(--s4); }
.hero h1 { font-size: var(--fs-hero); font-weight: 750; letter-spacing: -.02em; }
.hero .sub { margin-top: var(--s1); color: var(--muted); font-size: var(--fs-sub); }

.section { margin-top: var(--s6); }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0 var(--s1) var(--s2); }
.section-h h2 { font-size: var(--fs-cap); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.section-h a, .section-h button { font-size: var(--fs-sub); font-weight: 600; color: var(--accent); background: none; border: 0; padding: var(--s3) var(--s2); margin: calc(-1 * var(--s3)) calc(-1 * var(--s2)); min-height: 44px; min-width: 44px; cursor: pointer; }

/* ---------- 5. TAB BAR ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--bar);
  border-top: 1px solid var(--line);
}
.tabbar .tabs { display: flex; width: 100%; max-width: var(--maxw); }
.tab {
  flex: 1; min-height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: var(--fs-tiny); font-weight: 650; letter-spacing: .01em; min-width: 44px;
  background: none; border: 0; cursor: pointer; position: relative; text-decoration: none;
}
.tab .ico { width: 24px; height: 24px; transition: transform .2s var(--ease); }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .ico { stroke-width: 2.3; }
.tab:active .ico { transform: scale(.9); }
.tab .badge { position: absolute; top: 7px; left: calc(50% + 6px); }

/* ---------- 6. SURFACES ---------- */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.card.tight { padding: var(--s3); }
.card.accent { background: var(--accent); color: var(--accent-ink); }
.card.soft { background: var(--accent-soft); box-shadow: none; }

/* grouped list (iOS-settings style) */
.list { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 60px; padding: var(--s3) var(--s4);
  width: 100%; text-align: left; background: none; border: 0; color: inherit; text-decoration: none; cursor: pointer;
  position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--row-inset, var(--s4)); border-top: 1px solid var(--line); }
.list.with-lead .row { --row-inset: 68px; }
.row:active { background: var(--surface-2); }
.row .lead { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: min(var(--fs-sub), 15px); }   /* initials capped so they stay inside the 40px badge at big text */
.row .lead.round { border-radius: 50%; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }   /* up to 2 lines: big system text never cuts an address to a stub */
.row .sub { color: var(--muted); font-size: var(--fs-sub); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub.wrap { white-space: normal; }
.row .end { flex: none; display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: var(--fs-sub); }
.row .chev { color: var(--line-2); }

/* key/value lines inside a card */
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: var(--fs-sub); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s3); }
.stat { min-height: 44px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-1); padding: var(--s3) var(--s4); text-align: left; border: 0; color: inherit; cursor: pointer; }
.stat .n { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: var(--fs-cap); color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat.bad .n { color: var(--bad); } .stat.good .n { color: var(--good); } .stat.warn .n { color: var(--warn); } .stat.accent .n { color: var(--accent); }

/* ---------- 7. BUTTONS ---------- */
.btn {
  --b-bg: var(--accent); --b-ink: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5); border-radius: var(--r);
  background: var(--b-bg); color: var(--b-ink); border: 0;
  font-size: var(--fs-body); font-weight: 650; letter-spacing: .005em; text-decoration: none; cursor: pointer;
  transition: transform .12s var(--ease), filter .12s, opacity .12s; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); filter: brightness(.94); }
.btn[disabled], .btn.busy { opacity: .5; pointer-events: none; }
.btn.secondary { --b-bg: var(--accent-soft); --b-ink: var(--accent); }
.btn.quiet { --b-bg: transparent; --b-ink: var(--accent); }
.btn.plain { --b-bg: var(--surface-2); --b-ink: var(--ink); }
.btn.danger { --b-bg: var(--bad); --b-ink: var(--on-bad); }
.btn.danger.secondary { --b-bg: var(--bad-soft); --b-ink: var(--bad); }
.btn.good { --b-bg: var(--good); --b-ink: var(--on-good); }
.btn.block { display: flex; width: 100%; }
.btn.lg { min-height: 56px; font-size: var(--fs-head); border-radius: var(--r-l); }
.btn.sm { min-height: 44px; padding: 0 var(--s3); font-size: var(--fs-sub); border-radius: var(--r-s); }
.btns { display: flex; gap: var(--s3); }
.btns > .btn { flex: 1; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%;
  background: none; border: 0; color: var(--accent); cursor: pointer; transition: background .15s;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.filled { background: var(--accent-soft); }

/* big round action under a header: Call / Text / Note */
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: var(--s3); }
.action { min-height: 64px; min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s3) var(--s1); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); border: 0; color: var(--accent); font-size: var(--fs-cap); font-weight: 650; cursor: pointer; }
.action .ico { width: 26px; height: 26px; }
.action:active { transform: scale(.97); }
.action.primary { background: var(--accent); color: var(--accent-ink); }

.fab {
  position: fixed; right: calc(var(--s5) + var(--safe-r)); bottom: calc(var(--tabbar) + var(--safe-b) + var(--s4)); z-index: 25;
  width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2); cursor: pointer;
}
.fab .ico { width: 28px; height: 28px; }
.fab:active { transform: scale(.94); }

/* ---------- 8. CHIPS, SEGMENTS, BADGES, PILLS ---------- */
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 2px 0; margin: 0 calc(-1 * var(--s4)); padding-inline: var(--s4); }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding-inline: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 var(--s4);
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: var(--fs-sub); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chips.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.chips.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.chip .n { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.on .n, .chip[aria-pressed="true"] .n { color: inherit; opacity: .9; }

.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; }
.seg button { flex: 1; min-height: 44px; min-width: 44px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font-size: var(--fs-sub); font-weight: 650; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.badge { display: inline-grid; place-items: center; min-width: 20px; min-height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--bad); color: var(--on-bad); font-size: .75rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-cap); font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- 9. FORMS ---------- */
.field { display: block; margin-top: var(--s4); }
.field > span, .field > label { display: block; font-size: var(--fs-cap); font-weight: 650; color: var(--ink-2); margin: 0 var(--s1) 6px; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: var(--s3) var(--s4);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: var(--fs-body); color: var(--ink); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: var(--fs-cap); color: var(--muted); margin: 6px var(--s1) 0; }
.field.bad input, .field.bad textarea { border-color: var(--bad); }
.err { color: var(--bad); font-size: var(--fs-sub); font-weight: 600; margin-top: var(--s3); }

.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.search input { width: 100%; min-height: 44px; padding: 0 var(--s4) 0 44px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: var(--fs-body); color: var(--ink); outline: none; }
.search input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

.switch { position: relative; width: 51px; height: 44px; flex: none; }   /* 44 px hit area, 31 px drawn */
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 7px 0 6px; border-radius: 99px; background: var(--surface-3); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- 10. SHEET (bottom sheet on <dialog class="sheet">) ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: var(--maxw); max-height: 92dvh;
  border: 0; padding: 0; border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); overflow: auto;
  animation: sheet-up .32s var(--ease);
}
dialog.sheet::backdrop { background: var(--scrim); animation: fade .25s; }
dialog.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
dialog.sheet .in { padding: var(--s4) calc(var(--s5) + var(--safe-r)) calc(var(--s5) + var(--safe-b)) calc(var(--s5) + var(--safe-l)); }
dialog.sheet h3 { font-size: var(--fs-title); }
dialog.sheet .eyebrow { font-size: var(--fs-cap); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
dialog.sheet .acts { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s5); }
dialog.sheet.closing { animation: sheet-down .22s ease-in forwards; }
@media (min-width: 760px) { dialog.sheet { inset: 0; margin: auto; border-radius: var(--r-l); max-height: 86dvh; height: fit-content; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- 11. FEEDBACK: toast, banner, empty, skeleton ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-b) + var(--s3)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none; padding: 0 var(--s4); }
.shell.no-tabs ~ .toasts { bottom: calc(var(--safe-b) + var(--s4)); }
.toast {
  display: flex; align-items: center; gap: var(--s2); max-width: 520px;
  padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--ink); color: var(--bg);
  font-size: var(--fs-sub); font-weight: 600; box-shadow: var(--shadow-2); pointer-events: auto;
  animation: toast-in .3s var(--ease);
}
.toast.bad { background: var(--bad); color: var(--on-bad); }
.toast.good { background: var(--good); color: var(--on-good); }
.toast.out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.banner { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); border-radius: var(--r); font-size: var(--fs-sub); font-weight: 600; background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.good { background: var(--good-soft); color: var(--good); }

.empty { text-align: center; padding: var(--s8) var(--s5); color: var(--muted); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto var(--s3); color: var(--accent); opacity: .8; }
.empty h3 { color: var(--ink); font-size: var(--fs-head); margin-bottom: var(--s1); }

.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: 8px; height: 14px; }
@keyframes skel { to { background-position: -200% 0; } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* pull-to-refresh indicator (H.pull) */
.ptr { position: fixed; left: 50%; top: calc(var(--safe-t) + var(--topbar) + var(--s2)); z-index: 40; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-2); opacity: 0; transform: translateY(-70px); pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.ptr .spinner { animation: none; }
.ptr.go .spinner { animation: spin .8s linear infinite; }

/* progress bar: <div class="pbar"><i style="width:40%"></i></div> */
.pbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pbar > i { display: block; height: 100%; max-width: 100%; border-radius: 3px; background: var(--accent); transition: width .3s var(--ease); }

/* ---------- 12. SIGN-IN SCREEN ---------- */
.signin { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + var(--s7)) var(--s6) calc(var(--safe-b) + var(--s7)); }
.signin .mark { width: 72px; height: 72px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-2); margin-bottom: var(--s6); }
.signin .mark .ico { width: 36px; height: 36px; }
.signin h1 { font-size: var(--fs-hero); font-weight: 750; letter-spacing: -.02em; }
.signin .sub { color: var(--muted); margin: var(--s2) 0 var(--s4); }
.signin .btn { margin-top: var(--s6); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
