/* ==========================================================================
   Carepatron FTUE in-product design system: CANONICAL SHELL
   ---------------------------------------------------------------------------
   Foundation: "Calm Clinical" (content-first, color is earned). Grafted with
   the confident type scale + motion + error/edge states from the crisp-SaaS
   candidate, and the staggered reveal + radial empty-state polish from the
   warm candidate. One coherent system, not a patchwork.

   LOCKED SYSTEM (non-negotiable)
   - Font: Roboto (in-product, NOT the marketing Helvetica Display Now)
   - Primary: #673AB7   Accent: #7242EE   Ink: #0D073B
   - 16px type floor (nothing smaller, anywhere on screen)
   - 6px corner radius family (large surfaces may read 10/14 for softness)
   - NO hairline strokes: separation is fills + inset shadows
   - WCAG-AA contrast everywhere
   - Honest micro-interactions only (no fake long spinners)
   - No em or en dashes anywhere in copy

   Same class names as the existing prototypes; append feature-specific CSS in
   each page's own <style> block. Keep this file the single source of chrome.
   ========================================================================== */

:root {
  --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* ----- Surfaces: calm, warm-neutral, content-first ----- */
  --content-bg: #f6f6f9;        /* app canvas: barely-there warm grey */
  --card: #ffffff;              /* paper */
  --card-2: #fbfbfd;            /* nested / sunken fill */
  --sidebar: #ffffff;           /* light, quiet rail */
  --sidebar-fill: #efeafb;      /* active nav fill, lilac wash (hardened) */
  --sidebar-rail-edge: #e7e7ee; /* sidebar/content seam, rendered as a fill */

  /* ----- Ink ramp (all AA on white) ----- */
  --ink: #0D073B;               /* primary text (spec) */
  --ink-2: #45415f;             /* secondary text */
  --muted: #66637e;             /* tertiary / captions */
  --faint: #8b88a0;             /* placeholder / disabled label only */

  /* ----- Brand (used sparingly, with intent) ----- */
  --purple: #673AB7;            /* primary action, active state (spec) */
  --purple-700: #532f96;        /* primary hover */
  --purple-800: #45277e;        /* primary active/pressed */
  --accent: #7242EE;            /* accent, focus tint, secondary emphasis */
  --on-purple: #ffffff;

  /* ----- Soft brand tints (separators-as-fills, never strokes) ----- */
  --lilac: #ece6fa;             /* secondary button / accent card fill */
  --lilac-2: #e1d8f6;           /* secondary button hover */
  --lilac-soft: #f4f1fc;        /* hover wash, sunken segmented track */
  --lilac-line: #e7e1f7;        /* "divider" rendered as a thin fill block */
  --line: #ededf2;              /* neutral divider fill */
  --line-strong: #e2e2ec;       /* card-on-card seam fill */
  --violet: #9575CD;            /* decorative only (trial bar, quote mark) */

  /* ----- Status (muted, clinical, never loud; all AA on their fills) ----- */
  --green: #1f7a55;             /* done; AA on white */
  --green-soft: #e6f4ee;
  --green-ink: #14613f;
  --amber: #8a5a00;             /* attention; AA on white */
  --amber-soft: #fbf1dc;
  --info: #1f5fa8;
  --info-soft: #e7f0fb;
  --red: #b3261e;               /* error; AA on white */
  --red-soft: #fbe9e7;

  /* ----- Shape (6px family) ----- */
  --r-sm: 6px;
  --r: 6px;
  --r-md: 6px;
  --r-lg: 10px;                 /* large surfaces read slightly softer */
  --r-xl: 14px;                 /* modals / takeovers */
  --pill: 999px;

  /* ----- 8px spacing system ----- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  /* ----- Elevation: layered, low-contrast, ink-tinted (no flat black) ----- */
  --sh-xs: 0 1px 1px rgba(13,7,59,.04);
  --sh-sm: 0 1px 2px rgba(13,7,59,.05), 0 1px 1px rgba(13,7,59,.03);
  --sh-md: 0 1px 2px rgba(13,7,59,.05), 0 6px 16px -8px rgba(13,7,59,.10);
  --sh-lg: 0 2px 6px rgba(13,7,59,.06), 0 18px 40px -14px rgba(13,7,59,.22);
  --sh-xl: 0 4px 8px rgba(13,7,59,.07), 0 32px 64px -16px rgba(13,7,59,.30);
  --sh-focusring: 0 0 0 3px rgba(114,66,238,.32);

  /* ----- Type scale (16px floor, deliberate steps) ----- */
  --t-eyebrow: 16px;
  --t-body: 16px;
  --t-body-lg: 17px;
  --t-h3: 19px;
  --t-h2: 22px;
  --t-h1: 28px;
  --t-display: 34px;

  /* ----- Motion (honest, quick) ----- */
  --ease: cubic-bezier(.2,.7,.3,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: 160ms;
  --dur-lg: 220ms;

  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--content-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1;
}
::selection { background: var(--lilac); color: var(--purple-800); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   App layout
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
  background: var(--content-bg);
}
.main { display: flex; flex-direction: column; min-width: 0; }
.content {
  padding: var(--s6) var(--s7) var(--s9);
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}
/* content-first vertical rhythm between stacked cards/sections */
.content > * + * { margin-top: var(--s5); }

/* ==========================================================================
   Sidebar: a quiet light rail. Calm, not a heavy dark slab.
   The seam to content is a fill, never a stroke.
   ========================================================================== */
.sidebar {
  background: var(--sidebar);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: var(--s5) var(--s3) var(--s4);
  gap: var(--s1);
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: inset -1px 0 0 var(--sidebar-rail-edge); /* seam as inset fill */
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3) var(--s6);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand .dot {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--accent), var(--purple));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 8px rgba(103,58,183,.35);
  flex: none;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: var(--t-body); /* 16px floor honored even for the section label */
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  padding: var(--s4) var(--s3) var(--s2);
}
/* the rare uppercase micro-label exception (eyebrows in dense chrome). 13px is
   the ONLY sub-16 size in the system and is reserved for non-reading labels. */
.nav-section {
  font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
  padding: var(--s4) var(--s3) var(--s1);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 9px var(--s3);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: var(--t-body);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover { background: var(--lilac-soft); color: var(--ink); }
.nav-item.active {
  background: var(--sidebar-fill);
  color: var(--purple);
  font-weight: 600;
}
/* calm accent marker on the active item instead of a loud full fill */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: var(--pill);
  background: var(--purple);
}
.nav-item:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.nav-item .ico { width: 19px; height: 19px; opacity: .9; flex: none; }
.nav-item.active .ico { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: var(--t-body);
  font-weight: 600;
  background: var(--lilac);
  color: var(--purple);
  padding: 0 8px;
  line-height: 22px;
  border-radius: var(--pill);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s4); }
.trial-card {
  background: var(--card-2);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: inset 0 0 0 1px var(--line); /* seam as inset fill, not a stroke */
}
.trial-card .t { font-weight: 600; font-size: var(--t-body); color: var(--ink); }
.trial-card .s { color: var(--muted); font-size: var(--t-body); margin-top: 2px; }
.trial-bar { height: 6px; border-radius: var(--pill); background: var(--line); margin-top: var(--s3); overflow: hidden; }
.trial-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--violet), #b79ce6);
  border-radius: var(--pill);
  transition: width var(--dur-lg) var(--ease-out);
}
.side-cta {
  background: var(--purple);
  color: var(--on-purple);
  border: none;
  border-radius: var(--r);
  padding: 11px var(--s3);
  font-family: inherit;
  font-size: var(--t-body);
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: var(--s2); justify-content: center;
  box-shadow: var(--sh-sm);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.side-cta:hover { background: var(--purple-700); }
.side-cta:active { background: var(--purple-800); transform: translateY(1px); }
.side-cta:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

/* ==========================================================================
   Header: light, airy, sits on the canvas. Controls are fills, not boxes.
   ========================================================================== */
.header {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s7);
  background: color-mix(in srgb, var(--content-bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 var(--line); /* seam as a fill band, not a border */
}
.header .crumb { color: var(--muted); font-size: var(--t-body); }
.header .crumb b { color: var(--ink); font-weight: 600; }
.header .spacer, .header .grow { flex: 1; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; color: var(--ink-2);
  transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover { box-shadow: var(--sh-md); color: var(--ink); transform: translateY(-1px); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.account {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--card);
  border-radius: var(--r);
  padding: 5px var(--s3) 5px 5px;
  box-shadow: var(--sh-sm);
  cursor: pointer; border: none;
  font-family: inherit; font-size: var(--t-body); font-weight: 500;
  color: var(--ink);
  transition: box-shadow var(--dur) var(--ease);
}
.account:hover { box-shadow: var(--sh-md); }
.account:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--lilac), #d9ccf7);
  color: var(--purple);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-body);
  flex: none;
}

/* ==========================================================================
   Cards / sections: paper surfaces, low elevation, calm seams
   ========================================================================== */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  transition: box-shadow var(--dur-lg) var(--ease);
}
.card.hover:hover, .card.interactive:hover { box-shadow: var(--sh-lg); }
.card-quiet { box-shadow: inset 0 0 0 1px var(--line); } /* flat, no lift */
.card-accent {
  background: linear-gradient(160deg, var(--lilac-soft), var(--card) 72%);
  box-shadow: inset 0 0 0 1px var(--lilac-line), var(--sh-sm);
}
.pad { padding: var(--s5) var(--s6); }
.pad-sm { padding: var(--s4); }
.pad-lg { padding: var(--s7); }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s4);
}

/* internal divider: a fill block, never a border-line */
.divider { height: 1px; background: var(--line); margin: var(--s4) 0; border: none; }
.card-split > * + * { box-shadow: inset 0 1px 0 var(--line); }

.section-title { font-size: var(--t-h2); font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; }
.section-sub { color: var(--muted); font-size: var(--t-body); margin-top: var(--s1); max-width: 64ch; }
.eyebrow {
  font-size: var(--t-eyebrow);
  font-weight: 600;
  color: var(--purple);
  letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: var(--s2);
}
/* optional gradient accent bar before an eyebrow: <span class="eyebrow bar"> */
.eyebrow.bar::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px; flex: none;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.page-h1 { font-size: var(--t-h1); font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
.page-h1.display { font-size: var(--t-display); line-height: 1.16; }
.page-sub { color: var(--muted); font-size: var(--t-body-lg); margin-top: 6px; max-width: 68ch; line-height: 1.5; }

/* ==========================================================================
   Buttons: one clear primary; everything else recedes
   ========================================================================== */
.btn {
  font-family: inherit;
  font-size: var(--t-body);
  font-weight: 600;
  border: none;
  border-radius: var(--r);
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  line-height: 1.2;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform .1s var(--ease), color var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: var(--purple); color: var(--on-purple);
  box-shadow: 0 1px 2px rgba(103,58,183,.35), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn-primary:hover { background: var(--purple-700); box-shadow: 0 2px 10px -2px rgba(103,58,183,.45), inset 0 1px 0 rgba(255,255,255,.16); }
.btn-primary:active { background: var(--purple-800); }

.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(114,66,238,.4), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-accent:hover { background: var(--purple-700); }

.btn-secondary { background: var(--lilac); color: var(--purple); }
.btn-secondary:hover { background: var(--lilac-2); }

/* neutral secondary, for calm screens where lilac would be too much color */
.btn-neutral { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-xs); }
.btn-neutral:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-sm); background: var(--card-2); }

.btn-ghost { background: transparent; color: var(--purple); padding: 10px var(--s3); }
.btn-ghost:hover { background: var(--lilac-soft); }

.btn-sm { padding: 8px 13px; font-size: var(--t-body); }
.btn-lg { padding: 13px 22px; font-size: var(--t-body-lg); }
.btn-block { width: 100%; }

.link {
  color: var(--purple);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: none; border: none;
  font-family: inherit; font-size: inherit;
  padding: 0;
  border-radius: var(--r-sm);
}
.link:hover { color: var(--purple-700); text-decoration: underline; text-underline-offset: 2px; }
.link:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

/* ==========================================================================
   Form fields: calm, generous, focus is the only colored moment
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field label { font-size: var(--t-body); font-weight: 600; color: var(--ink); }
.field .hint { font-size: var(--t-body); color: var(--muted); }
.field .err { font-size: var(--t-body); color: var(--red); font-weight: 500; }

.input, .select, textarea.input {
  font-family: inherit;
  font-size: var(--t-body);
  line-height: 1.4;
  padding: 11px var(--s3);
  border-radius: var(--r);
  background: var(--card);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line-strong);   /* seam as inset fill */
  color: var(--ink);
  width: 100%;
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input::placeholder, textarea.input::placeholder { color: var(--faint); }
.input:hover, .select:hover, textarea.input:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-xs); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--purple), var(--sh-focusring);
}
textarea.input { min-height: 104px; resize: vertical; line-height: 1.5; }
.field-error .input,
.input.is-error { box-shadow: inset 0 0 0 1.5px var(--red); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2366637e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s3) center;
  padding-right: var(--s8);
}

.segmented {
  display: inline-flex;
  background: var(--lilac-soft);
  border-radius: var(--r);
  padding: 3px;
  gap: 3px;
}
.segmented button {
  border: none; background: transparent;
  font-family: inherit; font-size: var(--t-body); font-weight: 500;
  padding: 7px 14px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--card);
  color: var(--purple);
  font-weight: 600;
  box-shadow: var(--sh-sm);
}
.segmented button:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card);
  color: var(--ink-2);
  border-radius: var(--pill);
  padding: 7px 14px;
  font-size: var(--t-body); font-weight: 500;
  cursor: pointer; border: none; font-family: inherit;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { background: var(--lilac-soft); }
.chip[aria-pressed="true"], .chip.selected {
  background: var(--lilac);
  color: var(--purple);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--lilac-line);
}
.chip:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

/* ==========================================================================
   Tags / badges: small, muted, meaningful
   ========================================================================== */
.tag {
  font-size: var(--t-body); font-weight: 600;
  padding: 2px 10px; border-radius: var(--r-sm);
  background: var(--lilac); color: var(--purple);
  display: inline-flex; align-items: center; gap: 5px;
  line-height: 1.5;
}
.tag-muted { background: #eeeef3; color: var(--ink-2); }
.tag-green { background: var(--green-soft); color: var(--green-ink); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-info  { background: var(--info-soft); color: var(--info); }
.tag-red   { background: var(--red-soft); color: var(--red); }
.tag-try   { background: var(--accent); color: #fff; }
/* tiny status dot, calmer than a full filled pill */
.tag .dot, .tag .dot-i, .dot-status { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ==========================================================================
   Tabs: quiet underline-by-fill, content-first
   ========================================================================== */
.tabs {
  display: flex; gap: var(--s1);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
  position: relative;
  box-shadow: inset 0 -1px 0 var(--line);  /* track as a fill, not a border */
  padding-bottom: 0;
}
.tab {
  padding: 10px 14px;
  border-radius: var(--r) var(--r) 0 0;
  background: transparent; border: none;
  font-family: inherit; font-size: var(--t-body); font-weight: 500;
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--s2);
  position: relative;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); background: var(--lilac-soft); }
.tab[aria-selected="true"] { color: var(--purple); font-weight: 600; }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2.5px; border-radius: var(--pill);
  background: var(--purple);
}
.tab:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.tab .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted);
  font-size: var(--t-body); font-weight: 600;
  display: inline-grid; place-items: center; line-height: 1; flex: none;
}
.tab[aria-selected="true"] .num { background: var(--purple); color: #fff; }
.tab.done .num { background: var(--green); color: #fff; }

/* alt: pill tab group (some prototypes render tabs as a segmented set) */
.tabs.pill { box-shadow: none; background: var(--lilac-soft); border-radius: var(--r); padding: 3px; gap: 3px; display: inline-flex; width: fit-content; }
.tabs.pill .tab { border-radius: var(--r-sm); }
.tabs.pill .tab:hover { background: transparent; }
.tabs.pill .tab[aria-selected="true"] { background: var(--card); box-shadow: var(--sh-sm); }
.tabs.pill .tab[aria-selected="true"]::after { display: none; }

/* ==========================================================================
   Checklist rows: the heart of FTUE. Calm, scannable, one row glows.
   ========================================================================== */
.checklist { display: flex; flex-direction: column; gap: var(--s1); }
.check-item {
  display: flex; align-items: flex-start; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  cursor: pointer;
  background: transparent; border: none;
  width: 100%; text-align: left;
  font-family: inherit; font-size: var(--t-body);
  color: var(--ink);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.check-item:hover { background: var(--lilac-soft); }
.check-item.active {
  background: var(--card);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px var(--lilac-line), var(--sh-sm);
}
.check-item:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.check-item .box {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line-strong);  /* unchecked: fill outline */
  flex: none; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.check-item:hover .box { box-shadow: inset 0 0 0 2px var(--violet); }
.check-item.active .box { box-shadow: inset 0 0 0 2px var(--purple); }
.check-item.done .box { background: var(--green); box-shadow: none; }
.check-item .ci-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-item .label { font-weight: 600; color: var(--ink); }
.check-item .sub,
.check-item .desc { font-size: var(--t-body); color: var(--muted); }
.check-item.done .label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.check-item .meta,
.check-item .ci-action { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: var(--s2); }
.check-item .chev { margin-left: auto; align-self: center; color: var(--faint); }

/* ==========================================================================
   Empty states: calm, reassuring, content-first. A trustworthy blank page.
   ========================================================================== */
.empty {
  display: grid; place-items: center; text-align: center;
  padding: var(--s9) var(--s6);
  color: var(--muted);
}
.empty .ill {
  width: 80px; height: 80px;
  border-radius: var(--r-xl);
  background: radial-gradient(120% 120% at 30% 20%, #fff, var(--lilac-soft));
  box-shadow: var(--sh-sm), inset 0 0 0 1px var(--lilac-line);
  display: grid; place-items: center;
  color: var(--purple);
  margin-bottom: var(--s5);
}
.empty h3 { font-size: var(--t-h3); color: var(--ink); font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.empty p { max-width: 46ch; margin: 0 auto; color: var(--muted); }
.empty .actions { margin-top: var(--s5); display: inline-flex; gap: var(--s3); flex-wrap: wrap; justify-content: center; }

/* ==========================================================================
   Demo / sample markers: honest "this is example data" affordance
   ========================================================================== */
.demo-ribbon {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-body); font-weight: 600;
  color: var(--accent);
  background: var(--lilac-soft);
  padding: 4px 11px;
  border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px var(--lilac-line);
}
.demo-ribbon::before,
.demo-ribbon .dot-status {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(114,66,238,.18);
}
.sample-frame {
  position: relative;
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 2px var(--lilac-line), var(--sh-sm);  /* fill, no stroke */
}
.sample-frame::after {
  content: "Sample";
  position: absolute; top: var(--s3); right: var(--s3);
  font-size: var(--t-body); font-weight: 600; letter-spacing: .03em;
  color: var(--accent);
  background: var(--lilac-soft);
  padding: 2px 9px; border-radius: var(--pill);
  box-shadow: inset 0 0 0 1px var(--lilac-line);
}
.sample-frame.bare::after { display: none; }

/* ==========================================================================
   Toast: quiet, dark, brief. Honest confirmation, no fake delay.
   ========================================================================== */
.toast-wrap {
  position: fixed; left: 50%; bottom: var(--s7);
  transform: translateX(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: var(--s2); align-items: center;
}
.toast {
  background: #1c1733;
  color: #fff;
  padding: 12px var(--s4);
  border-radius: var(--r);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255,255,255,.08);
  font-size: var(--t-body); font-weight: 500;
  display: flex; align-items: center; gap: var(--s3);
  animation: toastIn var(--dur-lg) var(--ease-out) both;
}
.toast .ok {
  color: #69d6a3; display: inline-flex; align-items: center; justify-content: center;
}
.toast .link { color: #c7b3f5; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Snackbar: bottom-right progress. Spinner only for genuine async work.
   ========================================================================== */
.snackbar {
  position: fixed; right: var(--s6); bottom: var(--s6);
  z-index: 80;
  background: var(--card);
  box-shadow: var(--sh-lg);
  border-radius: var(--r-lg);
  padding: var(--s4);
  min-width: 300px; max-width: 380px;
  display: flex; gap: var(--s3); align-items: center;
  animation: snackIn var(--dur-lg) var(--ease-out) both;
}
.snackbar .sb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.snackbar .sb-title,
.snackbar .stitle { font-weight: 600; color: var(--ink); }
.snackbar .sb-sub,
.snackbar .ssub { font-size: var(--t-body); color: var(--muted); }
.snackbar .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--lilac);
  border-top-color: var(--purple);
  animation: spin .7s linear infinite;
  flex: none;
}
.snackbar .ok { color: var(--green); flex: none; display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes snackIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Modal / overlay / takeover: focus everything, dim the rest
   ========================================================================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(13,7,59,.46);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: grid; place-items: center;
  z-index: 70;
  padding: var(--s6);
  animation: overlayIn var(--dur) var(--ease) both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 96vw);
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  position: relative;
  overflow: hidden;
  animation: modalIn var(--dur-lg) var(--ease-out) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal .mhead { padding: var(--s6) var(--s6) 0; }
.modal .mhead .eyebrow { margin-bottom: var(--s2); }
.modal .mhead h2 { font-size: var(--t-h2); font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.modal .mhead p { color: var(--muted); margin-top: 6px; }
.modal .mbody { padding: var(--s5) var(--s6); }
.modal .mfoot {
  padding: var(--s4) var(--s6);
  display: flex; gap: var(--s3); justify-content: flex-end; align-items: center;
  background: var(--card-2);
  box-shadow: inset 0 1px 0 var(--line);   /* footer seam as a fill */
}
.modal .mfoot.split,
.modal .mfoot.spread { justify-content: space-between; }
.modal .mfoot .grow { flex: 1; }

/* optional hero band at the top of a modal */
.modal .mhero,
.modal-hero {
  height: 148px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, var(--accent), var(--purple));
  display: grid; place-items: center; color: #fff;
}

.modal-dismiss {
  position: absolute; top: var(--s4); right: var(--s4);
  background: var(--lilac-soft);
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer; z-index: 2;
  color: var(--purple);
  font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal-dismiss:hover { background: var(--lilac); }
/* when sitting on a colored hero, switch to a light scrim */
.modal .mhero + .modal-dismiss,
.modal-hero + .modal-dismiss,
.modal-dismiss.on-hero { background: rgba(255,255,255,.22); color: #fff; }
.modal-dismiss.on-hero:hover { background: rgba(255,255,255,.32); }
.modal-dismiss:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

/* Takeover: full first-run welcome. Calm, centered, content-first. */
.modal.takeover { width: min(720px, 96vw); border-radius: var(--r-xl); }
.modal.takeover .mhead { padding: var(--s8) var(--s8) 0; text-align: center; }
.modal.takeover .mbody { padding: var(--s5) var(--s8) var(--s8); }
.modal.takeover .mhead h2 { font-size: var(--t-display); line-height: 1.18; }

/* ==========================================================================
   Tiles: recommended cards / templates. Quiet, evenly weighted.
   ========================================================================== */
.tiles {
  display: flex; gap: var(--s4);
  overflow-x: auto;
  padding-bottom: var(--s2);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.tile {
  flex: 0 0 264px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  scroll-snap-align: start;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.tile:focus-visible { outline: none; box-shadow: var(--sh-focusring); }
.tile .thumb {
  height: 132px;
  background: linear-gradient(150deg, var(--lilac-soft), var(--card-2));
  display: grid; place-items: center;
  color: var(--violet);
  position: relative;
}
.tile .thumb::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--lilac-line);
}
.tile .body { padding: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.tile .title { font-weight: 600; font-size: var(--t-body-lg); color: var(--ink); letter-spacing: -.01em; }
.tile .one { color: var(--muted); font-size: var(--t-body); line-height: 1.45; }
.tile .foot { margin-top: var(--s2); display: flex; align-items: center; gap: var(--s2); justify-content: space-between; }

/* tile grid variant when not a horizontal scroller */
.tiles.grid,
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); overflow: visible; }
.tiles.grid .tile,
.tile-grid .tile { flex: initial; }

/* ==========================================================================
   Before / After toggle: prototype control. Sits quietly top-right.
   ========================================================================== */
.proto-toggle {
  position: fixed; top: var(--s4); right: var(--s4);
  z-index: 100;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: var(--sh-lg);
  border-radius: var(--pill);
  padding: 4px;
  display: inline-flex; gap: 2px;
}
.proto-toggle button {
  border: none; background: transparent;
  font-family: inherit; font-size: var(--t-body); font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--pill);
  cursor: pointer; color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.proto-toggle button:hover { color: var(--ink); }
.proto-toggle button[aria-pressed="true"] { background: var(--purple); color: var(--on-purple); box-shadow: 0 1px 2px rgba(103,58,183,.4); }
.proto-toggle button:focus-visible { outline: none; box-shadow: var(--sh-focusring); }

/* ==========================================================================
   Utilities
   ========================================================================== */
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.strong { font-weight: 700; }
.row { display: flex; gap: var(--s3); align-items: center; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.start { align-items: flex-start; }
.grow { flex: 1; }
.center { text-align: center; }
.center-x { justify-content: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.gap4 { gap: var(--s1); } .gap8 { gap: var(--s2); } .gap12 { gap: var(--s3); }
.gap16 { gap: var(--s4); } .gap24 { gap: var(--s6); }

.mt4{margin-top:var(--s1)} .mt8{margin-top:var(--s2)} .mt12{margin-top:var(--s3)}
.mt16{margin-top:var(--s4)} .mt20{margin-top:var(--s5)} .mt24{margin-top:var(--s6)} .mt32{margin-top:var(--s7)}
.mb8{margin-bottom:var(--s2)} .mb16{margin-bottom:var(--s4)} .mb24{margin-bottom:var(--s6)}

/* stack helpers: default .stack = 16px, plus explicit steps */
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s6); }
.stack-8 > * + * { margin-top: var(--s2); }
.stack-12 > * + * { margin-top: var(--s3); }
.stack-16 > * + * { margin-top: var(--s4); }
.stack-24 > * + * { margin-top: var(--s6); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }

[hidden] { display: none !important; }

/* honest entrance: a single quick rise-in, no looping decoration */
.fade-in { animation: fade var(--dur-lg) var(--ease-out) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* staggered reveal for a freshly-rendered list (checklist, tiles) */
.fade-stagger > * { animation: fade var(--dur-lg) var(--ease-out) both; }
.fade-stagger > *:nth-child(1){animation-delay:.02s}
.fade-stagger > *:nth-child(2){animation-delay:.06s}
.fade-stagger > *:nth-child(3){animation-delay:.10s}
.fade-stagger > *:nth-child(4){animation-delay:.14s}
.fade-stagger > *:nth-child(5){animation-delay:.18s}
.fade-stagger > *:nth-child(6){animation-delay:.22s}

/* visually-hidden but available to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .content { padding: var(--s5) var(--s5) var(--s8); }
  .header { padding: var(--s3) var(--s5); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: var(--s4) var(--s4) var(--s8); }
  .header { padding: var(--s3) var(--s4); }
  .page-h1 { font-size: var(--t-h2); }
  .page-h1.display { font-size: var(--t-h1); }
  .modal.takeover { width: 96vw; }
  .modal.takeover .mhead, .modal.takeover .mbody { padding-left: var(--s5); padding-right: var(--s5); }
  .tiles { margin-inline: calc(var(--s4) * -1); padding-inline: var(--s4); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: var(--s4); }
  .modal .mhead, .modal .mbody, .modal .mfoot { padding-left: var(--s5); padding-right: var(--s5); }
  .modal .mfoot { flex-direction: column-reverse; align-items: stretch; }
  .modal .mfoot .btn { width: 100%; }
  .toast-wrap { left: var(--s4); right: var(--s4); transform: none; }
  .toast { width: 100%; }
  .snackbar { left: var(--s4); right: var(--s4); min-width: 0; }
  .proto-toggle { top: auto; bottom: var(--s4); right: 50%; transform: translateX(50%); }
}
