Skip to content

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 is frontend/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:

  1. Read this whole document, then open the mockups in docs/02 - ARCHITECTURE_DESIGN/assets/calmcare/ — they are the visual target.
  2. Tokens already exist — do not invent new colors/fonts/shadows. Use the cc-* classes and the healing / apricot / sage / coral / lilac / amber palette + canvas / ink / muted neutrals + font-display + shadow-soft.
  3. 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.
  4. Do not break functionality. Same data, same API calls, same routes — only presentation changes. Follow .cursor/rules/rules.mdc (all calls via lib/api.ts, no any, mobile + desktop, etc.).
  5. Verify after each screen: npm run build, npm run lint:strict, and a manual look at mobile + desktop + dark mode.
  6. 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.


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).

  1. Warm, not clinical. Warm-neutral canvas, warm-charcoal text (never pure black), soft rounded surfaces, a friendly display font, one warm accent.
  2. Answer “what’s happening today?” first. Home surfaces a glanceable summary (adherence ring, next dose, one CTA). Depth is one tap away (progressive disclosure).
  3. Real-world metaphors reduce load. Medications = a pill organiser (Morning/Midday/Evening/Night). Prescriptions = bottle-style stock cards. History = a timeline.
  4. Soft elevation over hard borders. shadow-soft separates cards; avoid the 1px slate border as the primary divider.
  5. Calm, large, accessible. ≥44–48px touch targets, WCAG AA contrast, prefers-reduced-motion respected, dark mode parity.
  6. 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.

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).

ScreenFile
Design system boardassets/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 doseassets/calmcare/lyncareos-log-dose.png
Care calendarassets/calmcare/lyncareos-calendar.png
Prescriptions / Scriptsassets/calmcare/lyncareos-scripts.png
Pain & Stats (body map)assets/calmcare/lyncareos-pain.png
Vitals & Sleepassets/calmcare/lyncareos-vitals-sleep.png
Shoppingassets/calmcare/lyncareos-shopping.png
History (timeline)assets/calmcare/lyncareos-history.png
Care team / Key contactsassets/calmcare/lyncareos-contacts.png
Settings (desktop admin)assets/calmcare/lyncareos-settings-desktop.png
Login + onboardingassets/calmcare/lyncareos-login-onboarding.png

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.

TokenTailwindHexUsage
Canvasbg-canvas#f5f7f9App background (warm-neutral mist)
Inktext-ink#25303bPrimary text (warm charcoal-navy)
Mutedtext-muted#6b7785Secondary text, captions
Whitebg-white#ffffffCard surface

Slate scale is retained for legacy components and dark-mode surfaces.

RoleTokenKey hexTint (chip/section)Usage
Primary “Sky”brand-500/600 + gradient#4fb3fe / #1a9af2; gradient #1f9dec→#5bc2febrand-50Confirm/save buttons, active nav, primary lines
Healing tealhealing-500#19b5a6healing-50/100Wellness / vitals / tracking accent
Warm apricotapricot-500#ff8a5bapricot-50/100The one friendly CTA per screen
Sage (success)sage-500#46c28esage-50/100Dose given, healthy, “done”
Amber (attention)amber-400 (Tailwind built-in)#fbbf24amber-50/100Due soon, low stock, pending
Coral (urgent)coral-500#f4685fcoral-50/100Overdue, emergency, errors
Lilac (sleep)lilac-500#7c83f0lilac-50/100Sleep module theming

Rules

  • Semantic colors are distinct names (healing, apricot, sage, coral, lilac) so they do not override Tailwind defaults (teal, orange, emerald, rose, indigo remain available untouched).
  • Every accent has a pale 50/100 tint used for chip and section fills, and a 600/700 for hover/active.
  • Status mapping is fixed: sage = good/done, amber = attention, coral = urgent. Never use red/green ad hoc; use these.

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).


AspectStandardToken
Card radius24pxrounded-3xl
Button radius16pxrounded-2xl
Pills/chipsfullrounded-full
Bottom nav28pxrounded-[1.75rem]
Resting elevationsoft, borderlessshadow-soft
Raised cards / vitals capturelayered depthshadow-elev-1 → .cc-surface
Floating panels / hero capturegradient + larger shadowshadow-elev-2/3 → .cc-surface-float
Raised / sheets / navsofter/largershadow-soft-lg
Section padding20–24pxp-5 sm:p-6
Touch target≥44px (48px primary)min-h-[44px] / min-h-[48px]
Motion150–300ms ease-out, gentleexisting 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:

TokenTailwindTypical use
--cc-shadow-elev-1shadow-elev-1.cc-surface — resting clinical cards
--cc-shadow-elev-2shadow-elev-2.cc-surface-float, tooltips
--cc-shadow-elev-3shadow-elev-3Modals, 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 chips
Bowel: horizontal scroll-snap carousel for types 1–7
Save/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.


All Calm Care components are additive classes in @layer components. They coexist with legacy .card / .btn-*. Mapping:

PatternCalm Care classReplaces / 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-accentthe single friendly CTA per screen
Soft button.cc-btn-soft.btn-secondary
Filter/segmented chip.cc-chip / .cc-chip-activerange 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-activemobile nav (see §7)
Status tint.cc-status-done / .cc-status-due / .cc-status-overduedose/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.

  • 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 via BrandWordmark (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 in components/auth/; assets in public/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 (see check-brand-touchpoints.mjs).
  • Browser tab favicon — split blue/green heart + white cross (favicon.ico, favicon-16/32/48.png); built from Branding/lyncareos tab icon.png.
  • Getting Started welcome hero — Heartmark 2 as back-layer; hand cradling house
    • leaves as front-layer (getting-started-hero.png on GettingStarted.tsx).
  • 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 (A chip) and sage/lilac dots for tasks/handovers. Footer is a single row on mobile: truncated summary (Nothing scheduled / N appts · N shifts) + Open calendar link — never wrap to two lines. Pure week maths live in lib/weekGlanceHelpers.ts.
  • Calendar scroll-anchor pills — sticky filter dock on /calendar with [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.

Migrate per screen; keep PRs small. Update the Status column as you go.

Phase 0: Foundation

tokens + cc-* + docs

Phase 1: Shell

Layout, sidebar, bottom nav

Phase 2: Daily core

Dashboard, Medications, Log Dose

Phase 3: Clinical

Scripts, History, Pain, Vitals, Sleep

Phase 4: Coordination

Calendar, Shopping, Contacts, Help

Phase 5: Admin + auth

Settings, Account, Login, Register, Onboarding

Phase 6: Polish

dark mode, charts theme, empty states

PhaseScreen / areaMockupStatus
0Tokens, cc-* classes, this doc, mockups in repoboard✅ Done
1Layout 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
2Dashboard / Todaydashboard(+desktop)🟡 In progress — Calm Care hero, alerts, contacts chips, trends cc-card. Pending: wellness sparkline tiles, desktop stat-card row
2Medication 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
2Log Doselog-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
3Medications + 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
3History (timeline)history✅ Done — chip tabs, filter + date-group cc-card, audit table, cc-status-* badges
3Pain & Statspain🟡 In progress — tabs, DayDateStrip, PainScaleBar in cc-card, trend cc-card. Pending: weekly sparkline summary
3Vitals / Sleepvitals-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
4Calendarcalendar🟡 In progress — header, scroll-anchor chips, grid card, FAB. Pending: AddShiftForm / bottom-sheet interior
4Shoppingshopping✅ 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
4Key Contacts / Help boardcontacts✅ Done — bottle-style contact cards, cc-btn-accent add; Help board full Calm Care restyle
5Settings (admin)settings-desktop✅ Done — chip tabs, section cc-cards, soft dividers
5Account / Login / Register / Onboardinglogin-onboarding✅ Done — Login + Register (AuthShell, illustrated backdrop, Heartmark 2, BrandWordmark, icon fields); Getting Started welcome hero + 8-step checklist
5Admin (People, Alerts, Export, Subscriptions)settings-desktop✅ Done
5More / Getting started / Schedule / Analytics / Auto-dispense—✅ Done
6Shared primitives (Modal, legacy .card bridge)—✅ Done — Modal → cc-card; legacy .card/.page-title/.section-title aligned to Calm Care tokens
6Dark 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 of shadow-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-chip tints
  • Mobile + desktop + dark mode checked
  • No functional/data/route changes; all fetches still via lib/api.ts
  • npm run build + npm run lint:strict pass

WhatWhere
Colors, fonts, radius scale, shadow-softfrontend/tailwind.config.js (theme.extend)
Font imports, :root --cc-* vars, cc-* component classesfrontend/src/index.css
Legacy tokens (kept for back-compat)same files — brand, lyn, slate, .card, .btn-*
Shared UI primitives to re-skinfrontend/src/components/ui/
Mockupsdocs/02 - ARCHITECTURE_DESIGN/assets/calmcare/
Migration roadmap & decisionsthis doc + docs/plans/2026-05-30-calm-care-design-system.md
Presentation stack (tools + vitals map)14-FRONTEND-PRESENTATION-STACK.md

  1. Brand evolution vs. replace. Calm Care keeps the Sky blue lineage and adds warmth. If a full teal-primary rebrand is wanted, change brand itself.
  2. Greeting personalization (mockups show “Good morning, {name}”) — confirm data source (carer name vs patient name).
  3. Gamification (streaks/celebratory states on adherence) — opt-in; clinical tone must stay primary.
  4. 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 IconResolver cached-raster visibility in add-items sheet (gray placeholder bug); catalog surfaces use loadPriority="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-2xl
    • rounded-xl icon wells (list rows, catalog tiles, category picker) — not circular .cc-icon-chip / vertical .cc-chip on card-like pickers. Subcategory filters and list tabs remain horizontal cc-chip pills.
  • 1.1.6 (2026-05-31 17:35:41) — Shopping add-items polish: uniform catalog product tiles (CatalogItemTile, 40×40 icon well, shared CATALOG_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 to AddItemsSheet bottom 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/.
  • 1.1.3 (2026-05-30) — Auth login/register restyled to onboarding mockup: outline mark, backdrop art, AuthShell components; 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-card pattern (slot-colour left border replaces daypart background tints). Medications page renamed in migration table (unified /scripts surface).
  • 1.0.2 (2026-05-30) — Dashboard WeekAtAGlance (carer initial chips, single-line mobile footer); Calendar scroll-anchor pills documented; removed obsolete CalendarUpNext reference.
  • 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.