LynCareOS — Design System ("Calm Care")
Version: 1.2.2
Last Updated: 2026-08-01 19:48:52
Status: App-wide Calm Care migration complete through Shopping (Phase 4)
Owner: Frontend
Location: docs/02 - ARCHITECTURE_DESIGN/03-DESIGN-SYSTEM.md (canonical web UI design system)
This is the canonical web UI design system referenced throughout the docs (it was previously a known gap — see
docs/00-INDEX.md). It defines the Calm Care visual language: tokens, typography, components, patterns, and the page-by-page migration plan. Source of truth for tokens isfrontend/tailwind.config.js+frontend/src/index.css; this document explains intent, usage, and standards.
0. How to continue this work (read first if you are picking this up)
Section titled “0. How to continue this work (read first if you are picking this up)”The Calm Care foundation is in place and builds clean (npm run build ✓).
What remains is migrating each screen to the new patterns. Do this:
- Read this whole document, then open the mockups in
docs/02 - ARCHITECTURE_DESIGN/assets/calmcare/— they are the visual target. - Tokens already exist — do not invent new colors/fonts/shadows. Use the
cc-*classes and thehealing / apricot / sage / coral / lilac / amberpalette +canvas / ink / mutedneutrals +font-display+shadow-soft. - Migrate one screen at a time (see §8 phased plan). For each screen:
legacy
.card→.cc-card,.btn-primary→.cc-btn-primary, the screen’s single friendly CTA →.cc-btn-accent, page<h1>→.cc-page-title. - Do not break functionality. Same data, same API calls, same routes — only
presentation changes. Follow
.cursor/rules/rules.mdc(all calls vialib/api.ts, noany, mobile + desktop, etc.). - Verify after each screen:
npm run build,npm run lint:strict, and a manual look at mobile + desktop + dark mode. - Update §8 status table in this doc as you complete screens.
The legacy classes (.card, .btn-*, brand, lyn, slate neutrals) are
intentionally retained so the app keeps working during migration. Calm Care
is additive; nothing was deleted.
1. Design principles
Section titled “1. Design principles”Calm Care moves LynCareOS from a competent-but-generic cool-blue/slate dashboard to a warm, reassuring, modern care companion. Grounded in 2026 health-UX research (progressive disclosure, real-world metaphors, calm palettes, one-tap logging, generous whitespace).
- Warm, not clinical. Warm-neutral canvas, warm-charcoal text (never pure black), soft rounded surfaces, a friendly display font, one warm accent.
- Answer “what’s happening today?” first. Home surfaces a glanceable summary (adherence ring, next dose, one CTA). Depth is one tap away (progressive disclosure).
- Real-world metaphors reduce load. Medications = a pill organiser (Morning/Midday/Evening/Night). Prescriptions = bottle-style stock cards. History = a timeline.
- Soft elevation over hard borders.
shadow-softseparates cards; avoid the 1px slate border as the primary divider. - Calm, large, accessible. ≥44–48px touch targets, WCAG AA contrast,
prefers-reduced-motionrespected, dark mode parity. - One accent per screen. Apricot is the single inviting “do it” CTA per view (Log dose, Scan script, Add contact). Sky gradient is confirm/save.
2. Mockup gallery (the visual target)
Section titled “2. Mockup gallery (the visual target)”High-fidelity concept mockups live in
docs/02 - ARCHITECTURE_DESIGN/assets/calmcare/. They show fuller states than
some real screens to communicate the pattern; nav labels are illustrative (real
nav is fixed to enabled modules — see §7).
| Screen | File |
|---|---|
| Design system board | assets/calmcare/lyncareos-style-guide.png |
| Dashboard (mobile) | assets/calmcare/lyncareos-dashboard.png |
| Dashboard (desktop) | assets/calmcare/lyncareos-dashboard-desktop.png |
| Medications (pill organiser) | assets/calmcare/lyncareos-medication-schedule.png |
| Log dose | assets/calmcare/lyncareos-log-dose.png |
| Care calendar | assets/calmcare/lyncareos-calendar.png |
| Prescriptions / Scripts | assets/calmcare/lyncareos-scripts.png |
| Pain & Stats (body map) | assets/calmcare/lyncareos-pain.png |
| Vitals & Sleep | assets/calmcare/lyncareos-vitals-sleep.png |
| Shopping | assets/calmcare/lyncareos-shopping.png |
| History (timeline) | assets/calmcare/lyncareos-history.png |
| Care team / Key contacts | assets/calmcare/lyncareos-contacts.png |
| Settings (desktop admin) | assets/calmcare/lyncareos-settings-desktop.png |
| Login + onboarding | assets/calmcare/lyncareos-login-onboarding.png |
3. Color
Section titled “3. Color”Defined in frontend/tailwind.config.js (theme.extend.colors) and mirrored as
CSS variables in frontend/src/index.css (:root, prefixed --cc-*) for
ECharts themes, inline SVG (body-map), and JS.
3.1 Neutrals
Section titled “3.1 Neutrals”| Token | Tailwind | Hex | Usage |
|---|---|---|---|
| Canvas | bg-canvas | #f5f7f9 | App background (warm-neutral mist) |
| Ink | text-ink | #25303b | Primary text (warm charcoal-navy) |
| Muted | text-muted | #6b7785 | Secondary text, captions |
| White | bg-white | #ffffff | Card surface |
Slate scale is retained for legacy components and dark-mode surfaces.
3.2 Brand & accents
Section titled “3.2 Brand & accents”| Role | Token | Key hex | Tint (chip/section) | Usage |
|---|---|---|---|---|
| Primary “Sky” | brand-500/600 + gradient | #4fb3fe / #1a9af2; gradient #1f9dec→#5bc2fe | brand-50 | Confirm/save buttons, active nav, primary lines |
| Healing teal | healing-500 | #19b5a6 | healing-50/100 | Wellness / vitals / tracking accent |
| Warm apricot | apricot-500 | #ff8a5b | apricot-50/100 | The one friendly CTA per screen |
| Sage (success) | sage-500 | #46c28e | sage-50/100 | Dose given, healthy, “done” |
| Amber (attention) | amber-400 (Tailwind built-in) | #fbbf24 | amber-50/100 | Due soon, low stock, pending |
| Coral (urgent) | coral-500 | #f4685f | coral-50/100 | Overdue, emergency, errors |
| Lilac (sleep) | lilac-500 | #7c83f0 | lilac-50/100 | Sleep module theming |
Rules
- Semantic colors are distinct names (
healing,apricot,sage,coral,lilac) so they do not override Tailwind defaults (teal,orange,emerald,rose,indigoremain available untouched). - Every accent has a pale
50/100tint used for chip and section fills, and a600/700for hover/active. - Status mapping is fixed: sage = good/done, amber = attention, coral = urgent. Never use red/green ad hoc; use these.
4. Typography
Section titled “4. Typography”Two faces, both loaded in index.css:
- Display —
Plus Jakarta Sans(font-display): friendly, rounded. Page titles, section titles, hero numbers. - Body / UI / data —
Inter(font-sans, default): all body copy, labels, inputs, and tabular numbers (tabular-nums) for doses/vitals.
Named scale (unchanged, in tailwind.config.js): 2xs 10 · xs 12 · sm 14 · base 16 · lg 18 · xl 20 · 2xl 24 · 3xl 30.
Helper classes (in index.css):
.cc-page-title—font-display text-2xl font-extrabold tracking-tight text-ink.cc-section-title—font-display text-lg font-bold text-ink.cc-stat-number—font-display text-3xl font-extrabold tabular-nums text-ink
Legacy .page-title / .section-title remain; migrate by switching to the
cc- variants (adds the display font + warm ink).
5. Shape, elevation, spacing, motion
Section titled “5. Shape, elevation, spacing, motion”| Aspect | Standard | Token |
|---|---|---|
| Card radius | 24px | rounded-3xl |
| Button radius | 16px | rounded-2xl |
| Pills/chips | full | rounded-full |
| Bottom nav | 28px | rounded-[1.75rem] |
| Resting elevation | soft, borderless | shadow-soft |
| Raised cards / vitals capture | layered depth | shadow-elev-1 → .cc-surface |
| Floating panels / hero capture | gradient + larger shadow | shadow-elev-2/3 → .cc-surface-float |
| Raised / sheets / nav | softer/larger | shadow-soft-lg |
| Section padding | 20–24px | p-5 sm:p-6 |
| Touch target | ≥44px (48px primary) | min-h-[44px] / min-h-[48px] |
| Motion | 150–300ms ease-out, gentle | existing animate-* keyframes |
prefers-reduced-motion is already globally honored in index.css — keep new
animations under that umbrella.
5.1 Elevation scale (elev-1 / elev-2 / elev-3)
Section titled “5.1 Elevation scale (elev-1 / elev-2 / elev-3)”CSS variables in frontend/src/index.css:
| Token | Tailwind | Typical use |
|---|---|---|
--cc-shadow-elev-1 | shadow-elev-1 | .cc-surface — resting clinical cards |
--cc-shadow-elev-2 | shadow-elev-2 | .cc-surface-float, tooltips |
--cc-shadow-elev-3 | shadow-elev-3 | Modals, full-screen sheets (sparingly) |
Component classes:
.cc-surface— white/dark surface,rounded-2xl,shadow-elev-1.cc-surface-float— same + subtle top gradient for vitals capture hero panels
Vitals-specific class strings live in frontend/src/lib/vitalsTheme.ts (VITALS_CAPTURE_CARD, section icon tints).
5.2 Vitals capture surfaces (mobile-first)
Section titled “5.2 Vitals capture surfaces (mobile-first)”Desktop (≥640px): urine capture uses three columns — vertical slider | beaker | vertical colour strip inside cc-surface-float.
Mobile (≤639px): single-column hero flow inside VitalsCaptureSheet:
Beaker (centred) → horizontal slider → volume card → horizontal colour strip → preset chipsBowel: horizontal scroll-snap carousel for types 1–7Save/Cancel: StickyActionBar (always visible)Touch targets: preset/flag chips and primary actions min-h-11 (44px). Collapsed “today” rows use UrineEntryStrip / BowelEntryVisual for visual parity.
Full component map: 14-FRONTEND-PRESENTATION-STACK.md §9.
6. Components (cc-* layer in index.css)
Section titled “6. Components (cc-* layer in index.css)”All Calm Care components are additive classes in @layer components. They
coexist with legacy .card / .btn-*. Mapping:
| Pattern | Calm Care class | Replaces / notes |
|---|---|---|
| Card surface | .cc-card (+ .cc-card-pad) | .card — soft shadow, 24px radius, no hard border |
| Tinted compartment | .cc-section + a tint (bg-amber-50…) | pill-organiser sections, alert panels |
| Primary button (Sky) | .cc-btn-primary | .btn-primary — confirm/save/sign-in |
| Accent button (Apricot) | .cc-btn-accent | the single friendly CTA per screen |
| Soft button | .cc-btn-soft | .btn-secondary |
| Filter/segmented chip | .cc-chip / .cc-chip-active | range tabs, filters |
| Icon chip | .cc-icon-chip + tint (bg-healing-100 text-healing-600) | rounded line icon in tinted circle |
| Floating bottom nav | .cc-bottom-nav + .cc-nav-item / .cc-nav-item-active | mobile nav (see §7) |
| Status tint | .cc-status-done / .cc-status-due / .cc-status-overdue | dose/vitals/alert states |
Icons: Lucide (already a dependency), 2px stroke, placed inside .cc-icon-chip.
Reusable primitives that already exist and should be reused (do not
re-create): components/ui/ — Modal, BottomSheet, Select,
ClockPickerField, ColorPicker, DayDateStrip, Spinner, Skeleton,
ThemeToggle, etc. Re-skin these to cc-* rather than replacing them.
Overlay inventory: every dialog, sheet, and task overlay is catalogued in
04-OVERLAY-REGISTER.md (tier, migration verdict,
stacking hotspots). Default dialog UX: centred Modal on all viewports
(reference: LogDoseQuickMedsModal); do not add new bespoke fixed inset-0
shells without a register tier of T1, T2, or documented X1.
6.1 Signature patterns
Section titled “6.1 Signature patterns”- Auth welcome screen — full-viewport illustrated backdrop (
AuthWelcomeBackdrop): soft blue blob (top-left), teal leaves + line-art heart (top-right), peach blob (bottom-left) on a light canvas; portrait crop for phones, landscape crop for wider screens (auth-welcome-bg-portrait.png/auth-welcome-bg.png). Art stays light even in dark mode. Hero cluster (AuthBrandHeader): Heartmark 2 (lyncareos-heart-mark.png), tri-colour wordmark viaBrandWordmark(Lyn#2b3138· Care#1f9dec· OS#2cbebe, Plus Jakarta Sans ExtraBold), apricot tagline Care that feels like home, icon-inset fields, sky Sign in CTA. Shell incomponents/auth/; assets inpublic/brand/. Primary public verbal line — same string on marketing hero /<title>/og:title(marketing/palliative/index.html) and auth (AuthBrandHeader). - In-app brand block — desktop sidebar and mobile top bar (
DesktopSidebar.tsx,MobileTopBar.tsx): Heartmark 2 +BrandWordmark; must stay in parity (seecheck-brand-touchpoints.mjs). - Browser tab favicon — split blue/green heart + white cross (
favicon.ico,favicon-16/32/48.png); built fromBranding/lyncareos tab icon.png. - Getting Started welcome hero — Heartmark 2 as back-layer; hand cradling house
- leaves as front-layer (
getting-started-hero.pngonGettingStarted.tsx).
- leaves as front-layer (
- Adherence / progress ring — circular SVG ring, sage when on-track; center shows “N of M”. Used on Dashboard hero + desktop stat card.
- Pill-organiser sections — Morning ☀ / Midday / Evening 🌙 / Night cards, each with a per-section progress (“2 of 3 given”) and large round check buttons (sage filled = given, amber outline = due, coral = overdue).
- Bottle-style stock card — medicine dot + name/strength, horizontal stock bar (sage→amber), fills/scripts count pill.
- Timeline list — vertical connector with colored dots; used for History and “Up next” dose lists.
- Wellness tile — compact stat with tiny sparkline + tinted icon chip (Pain/Vitals/Sleep), horizontally scrollable on mobile.
- Week at a glance (Dashboard) — Monday–Sunday strip in
WeekAtAGlance.tsx: prev/next week navigation, “Today” reset when viewing another week, day cells with carer initial chips (first letter of login username, carer profile colour, max 2 + overflow), optional appointment (Achip) and sage/lilac dots for tasks/handovers. Footer is a single row on mobile: truncated summary (Nothing scheduled/N appts · N shifts) +Open calendarlink — never wrap to two lines. Pure week maths live inlib/weekGlanceHelpers.ts. - Calendar scroll-anchor pills — sticky filter dock on
/calendarwith[All][Appointments][Tasks][Handovers]. Pills are scroll anchors, not content filters: every section stays mounted; tapping smooth-scrolls that section under the dock. Trailing spacer lets the last section reach the top.
7. Navigation (unchanged behavior, restyled)
Section titled “7. Navigation (unchanged behavior, restyled)”Nav items are module-gated and derived in components/Layout.tsx — do not
hardcode the list. Real primary nav = Dashboard · Calendar · Sleep · Vitals ·
Pain · Scheduled Doses · Scripts · Shopping · More (filtered by enabled
modules; super-admin sees all). Secondary destinations (History, Analytics, Log
Dose, Contacts, Help board, admin) live under More.
- Mobile: floating bottom nav (
.cc-bottom-nav) + top bar. Mockup nav labels are illustrative only — keep the real derived items. - Desktop: left sidebar (
DesktopSidebar.tsx) with Heartmark 2 +BrandWordmark, patient switcher, nav list, theme toggle, account. Re-skin to soft surfaces +cc-nav-item. - The patient switcher (“Caring for …”) is global and on nearly every screen.
8. Migration plan & status
Section titled “8. Migration plan & status”Migrate per screen; keep PRs small. Update the Status column as you go.
| Phase | Screen / area | Mockup | Status |
|---|---|---|---|
| 0 | Tokens, cc-* classes, this doc, mockups in repo | board | ✅ Done |
| 1 | Layout shell (sidebar, top bar, bottom nav) | dashboard / desktop | 🟡 In progress — bg-canvas app shell; floating cc-bottom-nav; soft top bar + sidebar shadow. Pending: desktop stat-card row polish |
| 2 | Dashboard / Today | dashboard(+desktop) | 🟡 In progress — Calm Care hero, alerts, contacts chips, trends cc-card. Pending: wellness sparkline tiles, desktop stat-card row |
| 2 | Medication Schedule (pill organiser) | medication-schedule | ✅ Done — cc-card slots; sage left border when fully dispensed, slot color_hex when pending; DayDateStrip; legend label Dispensed (sage tick); hero + Log dose CTA |
| 2 | Log Dose | log-dose | ✅ Done — section cards; Now/Earlier; 2×2 quick-pick medicine pills + other-medicines dropdown; +/− stepper only (no custom amount field); apricot Record dose; no proof photo |
| 3 | Medications + Script Detail (unified /scripts) | scripts | 🟡 In progress — unified MedicationCard list ✅; scan modal cc-card; detail ✅ Archive + edit; shortcuts at top of Medications. Pending: fill modal polish |
| 3 | History (timeline) | history | ✅ Done — chip tabs, filter + date-group cc-card, audit table, cc-status-* badges |
| 3 | Pain & Stats | pain | 🟡 In progress — tabs, DayDateStrip, PainScaleBar in cc-card, trend cc-card. Pending: weekly sparkline summary |
| 3 | Vitals / Sleep | vitals-sleep | ✅ Done — Vitals page shell + VitalsBar cc-card; intake/output mobile capture sheet, elevation tokens, trend charts via chartTheme; Sleep week/month chips, grid cc-card, edit/save buttons |
| 4 | Calendar | calendar | 🟡 In progress — header, scroll-anchor chips, grid card, FAB. Pending: AddShiftForm / bottom-sheet interior |
| 4 | Shopping | shopping | ✅ Done — cc-page-title, row list in cc-card; mobile swipe (right Purchased / left Remove via SwipeActionRow); desktop inline ±/✓/✕; catalog in AddItemsSheet, apricot FAB, cc-chip list tabs |
| 4 | Key Contacts / Help board | contacts | ✅ Done — bottle-style contact cards, cc-btn-accent add; Help board full Calm Care restyle |
| 5 | Settings (admin) | settings-desktop | ✅ Done — chip tabs, section cc-cards, soft dividers |
| 5 | Account / Login / Register / Onboarding | login-onboarding | ✅ Done — Login + Register (AuthShell, illustrated backdrop, Heartmark 2, BrandWordmark, icon fields); Getting Started welcome hero + 8-step checklist |
| 5 | Admin (People, Alerts, Export, Subscriptions) | settings-desktop | ✅ Done |
| 5 | More / Getting started / Schedule / Analytics / Auto-dispense | — | ✅ Done |
| 6 | Shared primitives (Modal, legacy .card bridge) | — | ✅ Done — Modal → cc-card; legacy .card/.page-title/.section-title aligned to Calm Care tokens |
| 6 | Dark mode parity, ECharts theme (via --cc-*), empty-state illustrations | — | 🟡 In progress — intake/output charts use intakeOutputChartBase; global chart polish + empty-state illustrations remain |
Per-screen checklist (paste into each migration PR)
Section titled “Per-screen checklist (paste into each migration PR)”-
.card→.cc-card; hard borders removed in favor ofshadow-soft - One
.cc-btn-accent(apricot) CTA; confirm/save uses.cc-btn-primary - Page
<h1>uses.cc-page-title; section heads.cc-section-title - Status colors use sage/amber/coral tokens (no ad-hoc red/green)
- Icons are Lucide inside
.cc-icon-chiptints - Mobile + desktop + dark mode checked
- No functional/data/route changes; all fetches still via
lib/api.ts -
npm run build+npm run lint:strictpass
9. Token source-of-truth map
Section titled “9. Token source-of-truth map”| What | Where |
|---|---|
Colors, fonts, radius scale, shadow-soft | frontend/tailwind.config.js (theme.extend) |
Font imports, :root --cc-* vars, cc-* component classes | frontend/src/index.css |
| Legacy tokens (kept for back-compat) | same files — brand, lyn, slate, .card, .btn-* |
| Shared UI primitives to re-skin | frontend/src/components/ui/ |
| Mockups | docs/02 - ARCHITECTURE_DESIGN/assets/calmcare/ |
| Migration roadmap & decisions | this doc + docs/plans/2026-05-30-calm-care-design-system.md |
| Presentation stack (tools + vitals map) | 14-FRONTEND-PRESENTATION-STACK.md |
10. Open decisions (for product/owner)
Section titled “10. Open decisions (for product/owner)”- Brand evolution vs. replace. Calm Care keeps the Sky blue lineage and adds
warmth. If a full teal-primary rebrand is wanted, change
branditself. - Greeting personalization (mockups show “Good morning, {name}”) — confirm data source (carer name vs patient name).
- Gamification (streaks/celebratory states on adherence) — opt-in; clinical tone must stay primary.
- Empty-state illustrations — need a small illustration set in the warm palette (Phase 6).
Change log
- 1.2.2 (2026-08-01 19:48:52) — Primary public verbal line unified: marketing hero / title / og:title share auth tagline Care that feels like home (§6.1).
- 1.2.0 (2026-06-15 20:02:59) — Elevation scale (
elev-1/2/3,cc-surface-float); vitals capture mobile-first patterns (§5.1–5.2); Phase 6 charts partial; link to presentation stack doc. - 1.1.9 (2026-06-01 12:47:33) — Shopping catalog tiles: fix
IconResolvercached-raster visibility in add-items sheet (gray placeholder bug); catalog surfaces useloadPriority="eager". - 1.1.8 (2026-05-31 18:54:20) — Shopping active list mobile UX:
SwipeActionRow— swipe right Purchased, swipe left Remove; single-line row with tap-to-edit qty sheet (desktop keeps inline controls). - 1.1.7 (2026-05-31 17:37:29) — Shopping shape language: card surfaces use
rounded-2xlrounded-xlicon wells (list rows, catalog tiles, category picker) — not circular.cc-icon-chip/ vertical.cc-chipon card-like pickers. Subcategory filters and list tabs remain horizontalcc-chippills.
- 1.1.6 (2026-05-31 17:35:41) — Shopping add-items polish: uniform catalog product tiles (
CatalogItemTile, 40×40 icon well, sharedCATALOG_TILE_GRID); category picker compacted for the add-items sheet. - 1.1.5 (2026-05-30 16:49:30) — Shopping Calm Care migration: row-based active list (
ShoppingListRow), catalog browse moved toAddItemsSheetbottom sheet, mobile apricot FAB,cc-*shell and chips. - 1.1.4 (2026-05-30 19:04:21) — Brand system: Heartmark 2 on auth + sidebar;
shared
BrandWordmark(tri-colour LynCareOS); illustrated auth backdrop (portrait- wide crops); tab favicon set; Getting Started welcome hero; asset build scripts
in
frontend/scripts/.
- wide crops); tab favicon set; Getting Started welcome hero; asset build scripts
in
- 1.1.3 (2026-05-30) — Auth login/register restyled to onboarding mockup: outline
mark, backdrop art,
AuthShellcomponents; Getting Started welcome art pending. - 1.1.2 (2026-05-30) — Medication Schedule: dispensed slots use sage-500 left border (matches tick); pending slots keep admin slot colour. Footer legend Dispensed.
- 1.1.1 (2026-05-30) — Medication Schedule slot cards aligned to app-wide
cc-cardpattern (slot-colour left border replaces daypart background tints). Medications page renamed in migration table (unified/scriptssurface). - 1.0.2 (2026-05-30) — Dashboard
WeekAtAGlance(carer initial chips, single-line mobile footer); Calendar scroll-anchor pills documented; removed obsoleteCalendarUpNextreference. - 1.0.1 (2026-05-30) — Dashboard recommendation pass: overdue banner, next-up doses, section reorder, shopping/contacts/strip/trends Calm Care restyle. Calendar: up-next section, page title, icon filter chips, list-row icon chips + typography.
- 1.0.0 (2026-05-30) — Initial Calm Care design system: tokens shipped
(
tailwind.config.js,index.css),cc-*component layer added, 14 mockups imported, migration plan defined. Foundation builds clean.