{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"calendar-app","type":"registry:ui","title":"Calendar app","description":"A full calendar: day, week, month and agenda, a month picker and calendar toggles, a now line, and events you create by dragging, move by dragging or with Alt and the arrows, and edit in place.","dependencies":["@radix-ui/react-dialog","@radix-ui/react-popover","@radix-ui/react-slot","clsx","lucide-react","tailwind-merge"],"registryDependencies":["https://caliperui.site/r/styles.json"],"files":[{"path":"ui/button.tsx","type":"registry:ui","target":"components/ui/button.tsx","content":"\"use client\";\n\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { LoaderCircle } from \"lucide-react\";\nimport {\n  useLayoutEffect,\n  useRef,\n  useState,\n  type ComponentProps,\n  type ReactNode,\n} from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/loading-indicator.css\";\nimport \"./button.css\";\n\n/* Colour, material and press live in button.css keyed on data-variant, so a\n   consumer's utility classes still override them. Raised to press: the\n   button sinks 1px into an inner shade instead of scaling. */\nconst variants = {\n  default: \"\",\n  secondary: \"\",\n  ghost: \"\",\n  destructive: \"\",\n};\n\nconst sizes = {\n  sm: \"h-8 gap-1.5 rounded-full px-3 text-[13px] max-md:min-h-11 [@media(pointer:coarse)]:min-h-11\",\n  md: \"h-[var(--control-height)] gap-2 rounded-full px-3.5 text-sm\",\n  lg: \"h-11 gap-2 rounded-full px-[18px] text-[15px]\",\n  icon: \"size-[var(--control-height)] rounded-full p-0\",\n};\n\nexport type ButtonProps = ComponentProps<\"button\"> & {\n  variant?: keyof typeof variants;\n  size?: keyof typeof sizes;\n  asChild?: boolean;\n  /** Shows a spinner over the label and swallows clicks while keeping focus and width. */\n  loading?: boolean;\n  /** Animate a meaningful label/icon change, such as saving → saved. */\n  feedbackKey?: string;\n};\n\nexport function Button({\n  className,\n  variant = \"default\",\n  size = \"md\",\n  asChild = false,\n  loading = false,\n  feedbackKey,\n  disabled,\n  \"aria-disabled\": ariaDisabled,\n  children,\n  onClick,\n  onClickCapture,\n  tabIndex,\n  type = \"button\",\n  ...props\n}: ButtonProps) {\n  const Component = asChild ? Slot : \"button\";\n  const nativeDisabled = Boolean(disabled);\n  const blocked =\n    nativeDisabled ||\n    loading ||\n    ariaDisabled === true ||\n    ariaDisabled === \"true\";\n\n  return (\n    <Component\n      data-slot=\"button\"\n      data-variant={variant}\n      data-size={size}\n      type={asChild ? undefined : type}\n      className={cn(\n        \"relative inline-flex shrink-0 items-center justify-center whitespace-nowrap border border-transparent font-medium tracking-[-0.006em] outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none aria-disabled:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n        variants[variant],\n        sizes[size],\n        className,\n      )}\n      disabled={asChild ? undefined : nativeDisabled}\n      aria-disabled={nativeDisabled || ariaDisabled ? true : undefined}\n      aria-busy={loading || undefined}\n      tabIndex={asChild && nativeDisabled ? -1 : tabIndex}\n      {...props}\n      onKeyDown={(event) => {\n        if (blocked && (event.key === \"Enter\" || event.key === \" \")) {\n          event.preventDefault();\n        }\n        props.onKeyDown?.(event);\n      }}\n      onClickCapture={(event) => {\n        if (blocked) {\n          event.preventDefault();\n          event.stopPropagation();\n          return;\n        }\n        onClickCapture?.(event);\n      }}\n      onClick={onClick}\n    >\n      {loading && asChild && (\n        <LoaderCircle data-slot=\"loading-indicator\" aria-hidden=\"true\" />\n      )}\n      {loading && !asChild && feedbackKey === undefined && (\n        <span data-slot=\"button-busy\" aria-hidden=\"true\">\n          <LoaderCircle data-slot=\"loading-indicator\" />\n        </span>\n      )}\n      <Slottable>\n        {loading && !asChild && feedbackKey === undefined ? (\n          <span data-slot=\"button-label\" data-hidden=\"true\">\n            {children}\n          </span>\n        ) : feedbackKey !== undefined && !asChild ? (\n          <ButtonFeedback stateKey={feedbackKey}>\n            {loading && (\n              <LoaderCircle data-slot=\"loading-indicator\" aria-hidden=\"true\" />\n            )}\n            {children}\n          </ButtonFeedback>\n        ) : (\n          children\n        )}\n      </Slottable>\n    </Component>\n  );\n}\n\nfunction ButtonFeedback({\n  stateKey,\n  children,\n}: {\n  stateKey: string;\n  children: ReactNode;\n}) {\n  const content = useRef<HTMLSpanElement>(null);\n  const [initialKey] = useState(stateKey);\n  const [width, setWidth] = useState<number>();\n  useLayoutEffect(() => {\n    const element = content.current;\n    if (!element) return;\n    const measure = () => setWidth(element.offsetWidth);\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(element);\n    return () => observer.disconnect();\n  }, [stateKey]);\n  return (\n    <span data-slot=\"button-feedback\" style={{ width }}>\n      <span\n        key={stateKey}\n        ref={content}\n        data-slot=\"button-feedback-label\"\n        data-enter={stateKey !== initialKey}\n      >\n        {children}\n      </span>\n    </span>\n  );\n}\n"},{"path":"ui/calendar.tsx","type":"registry:ui","target":"components/ui/calendar.tsx","content":"\"use client\";\n\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent } from \"react\";\nimport { cn } from \"./lib/cn\";\nimport { RollingValue } from \"./rolling-value\";\nimport \"./shared/calendar-day.css\";\nimport \"./shared/chip-option.css\";\nimport \"./calendar.css\";\n\nconst weekdays = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n\nexport function isoDate(year: number, month: number, day: number) {\n  return `${year}-${String(month + 1).padStart(2, \"0\")}-${String(day).padStart(2, \"0\")}`;\n}\n\nexport function parseISODate(value: string) {\n  const [year, month, day] = value.split(\"-\").map(Number);\n  return { year, month: month - 1, day };\n}\n\nexport function formatISODate(value: string) {\n  const { year, month, day } = parseISODate(value);\n  return new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\", year: \"numeric\" }).format(new Date(year, month, day));\n}\n\nexport function shiftMonth(year: number, month: number, amount: number) {\n  const date = new Date(year, month + amount, 1);\n  return { year: date.getFullYear(), month: date.getMonth() };\n}\n\nfunction monthName(year: number, month: number) {\n  return new Intl.DateTimeFormat(\"en-US\", { month: \"long\", year: \"numeric\" }).format(new Date(year, month, 1));\n}\n\nfunction buildDays(year: number, month: number) {\n  const first = new Date(year, month, 1).getDay();\n  const count = new Date(year, month + 1, 0).getDate();\n  const cells: { iso: string; day: number; outside: boolean }[] = [];\n  for (let index = 0; index < first; index += 1) {\n    const date = new Date(year, month, index - first + 1);\n    cells.push({ iso: isoDate(date.getFullYear(), date.getMonth(), date.getDate()), day: date.getDate(), outside: true });\n  }\n  for (let day = 1; day <= count; day += 1) cells.push({ iso: isoDate(year, month, day), day, outside: false });\n  while (cells.length % 7 !== 0) {\n    const date = new Date(year, month + 1, cells.length - (first + count) + 1);\n    cells.push({ iso: isoDate(date.getFullYear(), date.getMonth(), date.getDate()), day: date.getDate(), outside: true });\n  }\n  return cells;\n}\n\nfunction addDays(iso: string, amount: number) {\n  const { year, month, day } = parseISODate(iso);\n  const date = new Date(year, month, day + amount);\n  return isoDate(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\nfunction blocked(iso: string, min?: string, max?: string, disabledDates?: (iso: string) => boolean) {\n  if (min && iso < min) return true;\n  if (max && iso > max) return true;\n  return disabledDates?.(iso) ?? false;\n}\n\nexport function Calendar({\n  label,\n  year,\n  month,\n  onMonthChange,\n  selected,\n  rangeStart,\n  rangeEnd,\n  onSelect,\n  onHover,\n  min,\n  max,\n  disabledDates,\n  disabledReason,\n  marks,\n  showToday = false,\n  className,\n}: {\n  label?: string;\n  year?: number;\n  month?: number;\n  onMonthChange?: (year: number, month: number) => void;\n  selected?: string | null;\n  rangeStart?: string | null;\n  rangeEnd?: string | null;\n  onSelect?: (iso: string) => void;\n  onHover?: (iso: string | null) => void;\n  min?: string;\n  max?: string;\n  disabledDates?: (iso: string) => boolean;\n  /** Read with an unavailable day, e.g. \"banks closed\". */\n  disabledReason?: (iso: string) => string | undefined;\n  /** A quiet data mark under the day, e.g. invoices due; the label is read with the date. */\n  marks?: (iso: string) => string | undefined;\n  showToday?: boolean;\n  className?: string;\n}) {\n  const initial = selected ? parseISODate(selected) : { year: 2026, month: 9 };\n  const [localYear, setLocalYear] = useState(initial.year);\n  const [localMonth, setLocalMonth] = useState(initial.month);\n  const [motion, setMotion] = useState<\"next\" | \"prev\">(\"next\");\n  const [selectionMarks, setSelectionMarks] = useState<Array<{ key: string; x: number; y: number; w: number; h: number }>>([]);\n  const days = useRef<HTMLDivElement>(null);\n  const pending = useRef<string | null>(null);\n  const viewYear = year ?? localYear;\n  const viewMonth = month ?? localMonth;\n  const cells = buildDays(viewYear, viewMonth);\n  const today = isoDate(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());\n  const prevMonth = shiftMonth(viewYear, viewMonth, -1);\n  const following = shiftMonth(viewYear, viewMonth, 1);\n  const prevDisabled = Boolean(min && isoDate(prevMonth.year, prevMonth.month, new Date(prevMonth.year, prevMonth.month + 1, 0).getDate()) < min);\n  const nextDisabled = Boolean(max && isoDate(following.year, following.month, 1) > max);\n  const start = rangeStart && rangeEnd && rangeStart > rangeEnd ? rangeEnd : rangeStart;\n  const end = rangeStart && rangeEnd && rangeStart > rangeEnd ? rangeStart : rangeEnd;\n\n  function setMonth(nextYear: number, nextMonth: number) {\n    const forward = nextYear > viewYear || (nextYear === viewYear && nextMonth > viewMonth);\n    setMotion(forward ? \"next\" : \"prev\");\n    if (onMonthChange) onMonthChange(nextYear, nextMonth);\n    else {\n      setLocalYear(nextYear);\n      setLocalMonth(nextMonth);\n    }\n  }\n\n  function focusIso(iso: string) {\n    const parsed = parseISODate(iso);\n    if (parsed.year !== viewYear || parsed.month !== viewMonth) {\n      pending.current = iso;\n      setMonth(parsed.year, parsed.month);\n      return;\n    }\n    days.current?.querySelector<HTMLButtonElement>(`[data-date=\"${iso}\"]`)?.focus();\n  }\n\n  function nearestOpen(iso: string, step: number) {\n    let next = iso;\n    for (let guard = 0; guard < 42 && blocked(next, min, max, disabledDates); guard += 1) next = addDays(next, step);\n    return blocked(next, min, max, disabledDates) ? null : next;\n  }\n\n  function move(event: KeyboardEvent<HTMLDivElement>) {\n    const current = (document.activeElement as HTMLElement | null)?.dataset.date;\n    if (!current) return;\n    const { year: y, month: m, day } = parseISODate(current);\n    const weekday = new Date(y, m, day).getDay();\n    let step = 0;\n    if (event.key === \"ArrowRight\") step = 1;\n    else if (event.key === \"ArrowLeft\") step = -1;\n    else if (event.key === \"ArrowDown\") step = 7;\n    else if (event.key === \"ArrowUp\") step = -7;\n    else if (event.key === \"Home\") step = -weekday;\n    else if (event.key === \"End\") step = 6 - weekday;\n    else if (event.key === \"PageDown\") step = event.shiftKey ? 365 : 30;\n    else if (event.key === \"PageUp\") step = event.shiftKey ? -365 : -30;\n    if (step === 0) return;\n    event.preventDefault();\n    const next = nearestOpen(addDays(current, step), step > 0 ? 1 : -1);\n    if (next) focusIso(next);\n  }\n\n  useEffect(() => {\n    const iso = pending.current;\n    if (!iso) return;\n    const button = days.current?.querySelector<HTMLButtonElement>(`[data-date=\"${iso}\"]`);\n    if (!button) return;\n    pending.current = null;\n    button.focus();\n  }, [viewYear, viewMonth, cells.length]);\n\n  useLayoutEffect(() => {\n    const root = days.current;\n    if (!root) return;\n    const ends = [selected, rangeStart, rangeEnd].filter((iso, index, list): iso is string => Boolean(iso) && list.indexOf(iso) === index);\n    const next = ends.flatMap((iso) => {\n      const node = root.querySelector<HTMLElement>(`[data-date=\"${iso}\"]`);\n      if (!node) return [];\n      return [{ key: iso, x: node.offsetLeft, y: node.offsetTop, w: node.offsetWidth, h: node.offsetHeight }];\n    });\n    setSelectionMarks((current) => (current.length === next.length && current.every((mark, index) => mark.key === next[index]?.key && mark.x === next[index]?.x && mark.y === next[index]?.y) ? current : next));\n  }, [selected, rangeStart, rangeEnd, viewYear, viewMonth, cells.length]);\n\n  return (\n    <div data-slot=\"calendar\" className={cn(\"w-[17.5rem] max-w-full\", className)}>\n      <div className=\"mb-2 flex items-center justify-between gap-2\">\n        <button type=\"button\" aria-label=\"Previous month\" aria-disabled={prevDisabled || undefined} disabled={prevDisabled} className=\"grid size-8 place-items-center rounded-control outline-none hover:bg-muted focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-35\" onClick={() => { const next = shiftMonth(viewYear, viewMonth, -1); setMonth(next.year, next.month); }}>\n          <ChevronLeft aria-hidden=\"true\" className=\"size-4\" />\n        </button>\n        <p className=\"text-sm font-semibold\">\n          <span className=\"sr-only\" aria-live=\"polite\">{monthName(viewYear, viewMonth)}</span>\n          <RollingValue value={monthName(viewYear, viewMonth)} direction={motion === \"next\" ? \"up\" : \"down\"} />\n        </p>\n        <button type=\"button\" aria-label=\"Next month\" aria-disabled={nextDisabled || undefined} disabled={nextDisabled} className=\"grid size-8 place-items-center rounded-control outline-none hover:bg-muted focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-35\" onClick={() => { const next = shiftMonth(viewYear, viewMonth, 1); setMonth(next.year, next.month); }}>\n          <ChevronRight aria-hidden=\"true\" className=\"size-4\" />\n        </button>\n      </div>\n      <div key={`${viewYear}-${viewMonth}`} role=\"grid\" aria-label={label ?? monthName(viewYear, viewMonth)} data-slot=\"calendar-grid\" data-motion={motion} onKeyDown={move} onMouseLeave={() => onHover?.(null)}>\n        <div className=\"grid grid-cols-7\" aria-hidden=\"true\">\n          {weekdays.map((day) => (\n            <span key={day} className=\"grid h-8 place-items-center text-xs font-medium text-muted-foreground\">{day}</span>\n          ))}\n        </div>\n        <div ref={days} className=\"relative grid grid-cols-7\">\n          {Array.from({ length: cells.length / 7 }, (_, week) => {\n            const row = cells.slice(week * 7, week * 7 + 7);\n            const first = row.findIndex((cell) => start && end && cell.iso >= start && cell.iso <= end);\n            let last = -1;\n            for (let index = row.length - 1; index >= 0; index -= 1) {\n              const cell = row[index];\n              if (cell && start && end && cell.iso >= start && cell.iso <= end) {\n                last = index;\n                break;\n              }\n            }\n            if (first < 0 || last < 0) return null;\n            return <span key={week} aria-hidden=\"true\" data-slot=\"calendar-range\" style={{ top: week * 36, left: `${(first / 7) * 100}%`, width: `${((last - first + 1) / 7) * 100}%` }} />;\n          })}\n          {selectionMarks.map((mark) => (\n            <span key={mark.key} aria-hidden=\"true\" data-slot=\"calendar-selection\" style={{ width: mark.w, height: mark.h, transform: `translate(${mark.x}px, ${mark.y}px)` }} />\n          ))}\n          {cells.map((cell) => {\n            const inRange = Boolean(start && end && cell.iso >= start && cell.iso <= end);\n            const isSelected = cell.iso === selected || cell.iso === rangeStart || cell.iso === rangeEnd;\n            const isDisabled = blocked(cell.iso, min, max, disabledDates);\n            const mark = marks?.(cell.iso);\n            const reason = isDisabled ? disabledReason?.(cell.iso) : undefined;\n            const tabIso = selected && cells.some((item) => item.iso === selected) ? selected : cells.find((item) => !item.outside && !blocked(item.iso, min, max, disabledDates))?.iso;\n            return (\n              <button\n                key={cell.iso}\n                type=\"button\"\n                role=\"gridcell\"\n                tabIndex={cell.iso === tabIso ? 0 : -1}\n                data-date={cell.iso}\n                data-slot=\"calendar-day\"\n                data-selected={isSelected || undefined}\n                data-in-range={inRange || undefined}\n                data-outside={cell.outside}\n                aria-selected={isSelected}\n                aria-current={cell.iso === today ? \"date\" : undefined}\n                aria-disabled={isDisabled || undefined}\n                aria-label={[formatISODate(cell.iso), mark, reason && `unavailable: ${reason}`].filter(Boolean).join(\", \")}\n                data-mark={mark ? true : undefined}\n                className=\"relative z-10 grid aspect-square w-full max-w-9 place-items-center text-sm outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring aria-disabled:opacity-35 data-[outside=true]:text-muted-foreground data-[selected=true]:text-accent-foreground\"\n                onMouseEnter={() => onHover?.(cell.iso)}\n                onClick={() => {\n                  if (!isDisabled) onSelect?.(cell.iso);\n                }}\n              >\n                {cell.day}\n              </button>\n            );\n          })}\n        </div>\n      </div>\n      {showToday && (\n        <button type=\"button\" className=\"mt-2 h-8 w-full rounded-surface text-sm font-medium outline-none hover:bg-muted focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-ring\" onClick={() => {\n          const now = new Date();\n          const today = isoDate(now.getFullYear(), now.getMonth(), now.getDate());\n          if (!blocked(today, min, max, disabledDates)) {\n            setMonth(now.getFullYear(), now.getMonth());\n            onSelect?.(today);\n          }\n        }}>\n          Today\n        </button>\n      )}\n    </div>\n  );\n}\n"},{"path":"ui/calendar-app.tsx","type":"registry:ui","target":"components/ui/calendar-app.tsx","content":"\"use client\";\n\nimport { ChevronLeft, ChevronRight, MapPin, Plus, SlidersHorizontal } from \"lucide-react\";\nimport { useEffect, useId, useMemo, useRef, useState, useSyncExternalStore, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Checkbox } from \"./checkbox\";\nimport { DatePicker } from \"./date-picker\";\nimport { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from \"./dialog\";\nimport { Field } from \"./field\";\nimport { Input } from \"./input\";\nimport { addMinutes, dayKey, formatLocal, hm, layoutColumns, minutesOf, parseLocal, startOfWeek } from \"./lib/calendar-time\";\nimport { cn } from \"./lib/cn\";\nimport { useSlideOnChange } from \"./lib/slide\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { SegmentedControl } from \"./segmented-control\";\nimport { SelectMenu } from \"./select-menu\";\nimport { Switch } from \"./switch\";\nimport { Textarea } from \"./textarea\";\nimport \"./shared/styles-4.css\";\nimport \"./calendar-app.css\";\n\nexport type CalendarSource = { id: string; label: string; /** Chart colour 1–6. */ tone: 1 | 2 | 3 | 4 | 5 | 6 };\nexport type CalendarAppEvent = {\n  id: string;\n  title: string;\n  /** Local date-time, \"2026-10-14T09:30\". All-day events use 00:00. */\n  start: string;\n  end: string;\n  calendar: string;\n  allDay?: boolean;\n  location?: string;\n  notes?: string;\n};\nexport type CalendarView = \"day\" | \"week\" | \"month\" | \"agenda\";\n\nconst HOUR = 48;\nconst SNAP = 15;\nconst snap = (minutes: number) => Math.round(minutes / SNAP) * SNAP;\n/* Quarter hours in the reader's clock, so the time reads the same in any OS language. Kept here so the item needs nothing beyond itself. */\nconst quarterHours = Array.from({ length: 96 }, (_, index) => {\n  const value = `${String(Math.floor(index / 4)).padStart(2, \"0\")}:${String((index % 4) * 15).padStart(2, \"0\")}`;\n  return { value, label: clock(value) };\n});\nfunction clock(value: string) {\n  const [hour, minute] = value.split(\":\").map(Number);\n  return `${hour % 12 || 12}:${String(minute).padStart(2, \"0\")} ${hour < 12 ? \"AM\" : \"PM\"}`;\n}\nfunction TimeField({ label, value, disabled, onChange }: { label: string; value: string; disabled: boolean; onChange: (value: string) => void }) {\n  const id = useId();\n  const options = quarterHours.some((slot) => slot.value === value) ? quarterHours : [...quarterHours, { value, label: clock(value) }].sort((a, b) => a.value.localeCompare(b.value));\n  return (\n    <div className=\"grid gap-1.5\">\n      <span id={id} className=\"text-sm font-medium\">{label}</span>\n      <SelectMenu aria-labelledby={id} disabled={disabled} value={value} onValueChange={onChange} options={options} />\n    </div>\n  );\n}\n\nconst longDay = (date: Date) => date.toLocaleDateString(\"en-GB\", { weekday: \"long\", day: \"numeric\", month: \"long\" });\nconst plusDays = (date: Date, days: number) => addMinutes(date, 0, days);\nlet seq = 0;\nconst newEventId = () => `ev-${Date.now().toString(36)}-${(seq += 1)}`;\n\n/* The clock in whole minutes, for the now line; the server has none. */\nconst minutes = {\n  subscribe(notify: () => void) {\n    const timer = window.setInterval(notify, 15_000);\n    return () => window.clearInterval(timer);\n  },\n  get: () => Math.floor(Date.now() / 60_000) * 60_000,\n  server: () => 0,\n};\n\ntype Draft = { id?: string; title: string; date: string; start: string; end: string; calendar: string; allDay: boolean; location: string; notes: string };\ntype Drag = { id: string; mode: \"move\" | \"size\" | \"create\"; x: number; y: number; origin: { start: Date; end: Date }; start: Date; end: Date; moved: boolean };\n\n/**\n * A full calendar for planning time: day, week, month and agenda views, a\n * month picker and calendar toggles beside them, and a now line that moves.\n * Drag across empty time to create an event, drag one to move it, drag its\n * edge to change its length, or focus it and use Alt with the arrows. On a\n * narrow screen the week shows three days and the side panel folds away.\n */\nexport function CalendarApp({\n  events,\n  calendars,\n  onEventsChange,\n  today = dayKey(new Date()),\n  now,\n  defaultView = \"week\",\n  weekStart = 0,\n  className,\n}: {\n  events: readonly CalendarAppEvent[];\n  calendars: readonly CalendarSource[];\n  onEventsChange: (events: CalendarAppEvent[]) => void;\n  /** ISO date treated as today. */\n  today?: string;\n  /** Local date-time for the now line; defaults to the clock. */\n  now?: string;\n  defaultView?: CalendarView;\n  /** 0 starts weeks on Sunday, like the month picker beside it; 1 on Monday. */\n  weekStart?: 0 | 1;\n  className?: string;\n}) {\n  const id = useId();\n  const [view, setView] = useState<CalendarView>(defaultView);\n  const [anchor, setAnchor] = useState(today);\n  // A new range slides in from the side you moved to; a new view fades (lib/slide).\n  const { ref: body, toward } = useSlideOnChange(`${view}|${anchor}`);\n  const [hidden, setHidden] = useState<string[]>([]);\n  const [draft, setDraft] = useState<Draft | null>(null);\n  const [drag, setDrag] = useState<Drag | null>(null);\n  const [announce, setAnnounce] = useState(\"\");\n  const [narrow, setNarrow] = useState(false);\n  const minute = useSyncExternalStore(minutes.subscribe, minutes.get, minutes.server);\n  const clock = now ? parseLocal(now) : minute ? new Date(minute) : null;\n  const root = useRef<HTMLDivElement>(null);\n  const grid = useRef<HTMLDivElement>(null);\n  const opener = useRef<HTMLElement | null>(null);\n\n  useEffect(() => {\n    const element = root.current;\n    if (!element) return;\n    const observer = new ResizeObserver(([entry]) => setNarrow(entry!.contentRect.width < 640));\n    observer.observe(element);\n    return () => observer.disconnect();\n  }, []);\n\n  useEffect(() => {\n    if (grid.current) grid.current.scrollTop = 7.5 * HOUR;\n  }, [view]);\n\n  const anchorDate = parseLocal(anchor);\n  const days = useMemo(() => {\n    if (view === \"day\") return [anchorDate];\n    if (view === \"week\") {\n      if (narrow) return [0, 1, 2].map((n) => plusDays(anchorDate, n));\n      const first = startOfWeek(anchorDate, weekStart);\n      return Array.from({ length: 7 }, (_, n) => plusDays(first, n));\n    }\n    return [];\n  }, [view, anchor, narrow, weekStart]); // eslint-disable-line react-hooks/exhaustive-deps\n\n  const visible = events.filter((event) => !hidden.includes(event.calendar));\n  const tone = (event: CalendarAppEvent) => calendars.find((source) => source.id === event.calendar)?.tone ?? 1;\n  const onDay = (date: Date) => visible.filter((event) => dayKey(parseLocal(event.start)) === dayKey(date));\n\n  const title = (() => {\n    if (view === \"day\") return longDay(anchorDate);\n    if (view === \"month\" || view === \"agenda\") return anchorDate.toLocaleDateString(\"en-GB\", { month: \"long\", year: \"numeric\" });\n    const a = days[0]!;\n    const b = days[days.length - 1]!;\n    return a.getMonth() === b.getMonth()\n      ? `${a.getDate()}–${b.getDate()} ${b.toLocaleDateString(\"en-GB\", { month: \"long\", year: \"numeric\" })}`\n      : `${a.toLocaleDateString(\"en-GB\", { day: \"numeric\", month: \"short\" })} – ${b.toLocaleDateString(\"en-GB\", { day: \"numeric\", month: \"short\", year: \"numeric\" })}`;\n  })();\n\n  function go(step: number) {\n    toward(step);\n    const next =\n      view === \"day\" ? plusDays(anchorDate, step) : view === \"week\" ? plusDays(anchorDate, step * (narrow ? 3 : 7)) : new Date(anchorDate.getFullYear(), anchorDate.getMonth() + step, 1);\n    setAnchor(dayKey(next));\n  }\n\n  function save(event: CalendarAppEvent) {\n    const exists = events.some((item) => item.id === event.id);\n    onEventsChange(exists ? events.map((item) => (item.id === event.id ? event : item)) : [...events, event]);\n  }\n\n  function openEditor(next: Draft, from?: HTMLElement | null) {\n    opener.current = from ?? (document.activeElement as HTMLElement | null);\n    setDraft(next);\n  }\n  const draftFor = (event: CalendarAppEvent): Draft => ({\n    id: event.id,\n    title: event.title,\n    date: event.start.slice(0, 10),\n    start: event.start.slice(11, 16),\n    end: event.end.slice(11, 16),\n    calendar: event.calendar,\n    allDay: !!event.allDay,\n    location: event.location ?? \"\",\n    notes: event.notes ?? \"\",\n  });\n  const newDraft = (start: Date, end: Date, allDay = false): Draft => ({ title: \"\", date: dayKey(start), start: hm(start), end: hm(end), calendar: calendars.find((source) => !hidden.includes(source.id))?.id ?? calendars[0]!.id, allDay, location: \"\", notes: \"\" });\n\n  function keys(event: KeyboardEvent, item: CalendarAppEvent) {\n    if (!event.altKey || item.allDay) return;\n    const start = parseLocal(item.start);\n    const end = parseLocal(item.end);\n    let next: [Date, Date] | null = null;\n    if (event.shiftKey && (event.key === \"ArrowUp\" || event.key === \"ArrowDown\")) {\n      const finish = addMinutes(end, event.key === \"ArrowUp\" ? -SNAP : SNAP);\n      if (finish.getTime() - start.getTime() >= SNAP * 60_000) next = [start, finish];\n    } else if (event.key === \"ArrowUp\" || event.key === \"ArrowDown\") {\n      const delta = event.key === \"ArrowUp\" ? -SNAP : SNAP;\n      next = [addMinutes(start, delta), addMinutes(end, delta)];\n    } else if (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") {\n      const delta = event.key === \"ArrowLeft\" ? -1 : 1;\n      next = [addMinutes(start, 0, delta), addMinutes(end, 0, delta)];\n    }\n    if (!next) return;\n    event.preventDefault();\n    save({ ...item, start: formatLocal(next[0]), end: formatLocal(next[1]) });\n    setAnnounce(`${item.title}: ${longDay(next[0])}, ${hm(next[0])} to ${hm(next[1])}.`);\n    requestAnimationFrame(() => root.current?.querySelector<HTMLElement>(`[data-event=\"${item.id}\"]`)?.focus());\n  }\n\n  /* ----- Pointer: create, move, resize ----- */\n  const columnWidth = () => grid.current?.querySelector<HTMLElement>(\"[data-day]\")?.getBoundingClientRect().width ?? 1;\n  function startCreate(event: PointerEvent<HTMLDivElement>, date: Date) {\n    if (event.button !== 0 || event.target !== event.currentTarget) return;\n    const rect = event.currentTarget.getBoundingClientRect();\n    const minutes = Math.floor((((event.clientY - rect.top) / HOUR) * 60) / SNAP) * SNAP;\n    const start = addMinutes(new Date(date.getFullYear(), date.getMonth(), date.getDate()), minutes);\n    event.currentTarget.setPointerCapture(event.pointerId);\n    setDrag({ id: \"new\", mode: \"create\", x: event.clientX, y: event.clientY, origin: { start, end: addMinutes(start, 30) }, start, end: addMinutes(start, 30), moved: false });\n  }\n  function startDrag(event: PointerEvent<HTMLElement>, item: CalendarAppEvent, mode: \"move\" | \"size\") {\n    if (event.button !== 0) return;\n    event.stopPropagation();\n    event.currentTarget.setPointerCapture(event.pointerId);\n    const origin = { start: parseLocal(item.start), end: parseLocal(item.end) };\n    setDrag({ id: item.id, mode, x: event.clientX, y: event.clientY, origin, ...origin, moved: false });\n  }\n  function moveDrag(event: PointerEvent<HTMLElement>) {\n    if (!drag) return;\n    const minutes = snap(((event.clientY - drag.y) / HOUR) * 60);\n    const moved = drag.moved || Math.abs(event.clientY - drag.y) > 4 || Math.abs(event.clientX - drag.x) > 4;\n    if (drag.mode === \"move\") {\n      const dayShift = Math.round((event.clientX - drag.x) / columnWidth());\n      setDrag({ ...drag, moved, start: addMinutes(drag.origin.start, minutes, dayShift), end: addMinutes(drag.origin.end, minutes, dayShift) });\n    } else {\n      const end = addMinutes(drag.mode === \"create\" ? drag.origin.start : drag.origin.end, drag.mode === \"create\" ? Math.max(SNAP, minutes + SNAP) : minutes);\n      if (end.getTime() - drag.start.getTime() >= SNAP * 60_000) setDrag({ ...drag, moved, end });\n    }\n  }\n  function endDrag(event: PointerEvent<HTMLElement>) {\n    if (!drag) return;\n    event.currentTarget.releasePointerCapture?.(event.pointerId);\n    const current = drag;\n    setDrag(null);\n    if (current.mode === \"create\") {\n      const end = current.moved ? current.end : addMinutes(current.start, 30);\n      return openEditor(newDraft(current.start, end), event.currentTarget);\n    }\n    const item = events.find((candidate) => candidate.id === current.id);\n    if (!item) return;\n    if (!current.moved) return openEditor(draftFor(item), event.currentTarget);\n    save({ ...item, start: formatLocal(current.start), end: formatLocal(current.end) });\n    setAnnounce(`${item.title} moved to ${longDay(current.start)}, ${hm(current.start)} to ${hm(current.end)}.`);\n  }\n\n  const nowLine = clock && <span data-slot=\"cal-now\" style={{ top: (minutesOf(clock) / 60) * HOUR }} aria-hidden=\"true\" />;\n\n  return (\n    <div ref={root} data-slot=\"cal-app\" className={cn(\"@container grid min-w-0 gap-4\", className)}>\n      <div data-slot=\"cal-toolbar\">\n        <div className=\"flex items-center gap-1\">\n          <Button size=\"sm\" variant=\"secondary\" onClick={() => { toward(today < anchor ? -1 : today > anchor ? 1 : 0); setAnchor(today); }}>Today</Button>\n          <Button size=\"sm\" variant=\"ghost\" aria-label={`Previous ${view === \"month\" || view === \"agenda\" ? \"month\" : view === \"day\" ? \"day\" : \"days\"}`} onClick={() => go(-1)}><ChevronLeft aria-hidden=\"true\" /></Button>\n          <Button size=\"sm\" variant=\"ghost\" aria-label={`Next ${view === \"month\" || view === \"agenda\" ? \"month\" : view === \"day\" ? \"day\" : \"days\"}`} onClick={() => go(1)}><ChevronRight aria-hidden=\"true\" /></Button>\n        </div>\n        <h2 id={`${id}-title`} className=\"min-w-0 flex-1 truncate text-base font-semibold\" aria-live=\"polite\">{title}</h2>\n        <div className=\"flex flex-wrap items-center gap-2\">\n          <SegmentedControl label=\"View\" value={view} onValueChange={(value) => setView(value as CalendarView)} options={[{ value: \"day\", label: \"Day\" }, { value: \"week\", label: narrow ? \"3 days\" : \"Week\" }, { value: \"month\", label: \"Month\" }, { value: \"agenda\", label: \"Agenda\" }]} />\n          <Popover>\n            <PopoverTrigger asChild>\n              <Button size=\"sm\" variant=\"ghost\" data-slot=\"cal-filter-button\" aria-label=\"Calendars\"><SlidersHorizontal aria-hidden=\"true\" /></Button>\n            </PopoverTrigger>\n            <PopoverContent align=\"end\" className=\"w-64\">\n              <Sources calendars={calendars} hidden={hidden} setHidden={setHidden} />\n            </PopoverContent>\n          </Popover>\n          <Button size=\"sm\" onClick={(e) => { const start = addMinutes(new Date(anchorDate), 9 * 60); openEditor(newDraft(start, addMinutes(start, 30)), e.currentTarget); }}>\n            <Plus aria-hidden=\"true\" />\n            New event\n          </Button>\n        </div>\n      </div>\n\n      <div data-slot=\"cal-body\">\n        <aside data-slot=\"cal-side\" aria-label=\"Date and calendars\">\n          <Calendar\n            label=\"Go to date\"\n            year={anchorDate.getFullYear()}\n            month={anchorDate.getMonth()}\n            onMonthChange={(year, month) => setAnchor(dayKey(new Date(year, month, 1)))}\n            selected={anchor}\n            onSelect={(iso) => setAnchor(iso)}\n            marks={(iso) => (events.some((event) => event.start.startsWith(iso)) ? \"has events\" : undefined)}\n            showToday\n          />\n          <Sources calendars={calendars} hidden={hidden} setHidden={setHidden} />\n        </aside>\n\n        <div ref={body} className=\"min-w-0\">\n          {(view === \"day\" || view === \"week\") && (\n            <div data-slot=\"cal-frame\" style={{ [\"--cal-days\" as string]: days.length }}>\n              <div data-slot=\"cal-head\">\n                <span />\n                {days.map((date) => (\n                  <button key={dayKey(date)} type=\"button\" data-today={dayKey(date) === today || undefined} onClick={() => { setAnchor(dayKey(date)); setView(\"day\"); }} aria-label={`${longDay(date)}, open day`}>\n                    <span>{date.toLocaleDateString(\"en-GB\", { weekday: \"short\" })}</span>\n                    <b>{date.getDate()}</b>\n                  </button>\n                ))}\n              </div>\n              <div data-slot=\"cal-allday\">\n                <span>All day</span>\n                {days.map((date) => (\n                  <div key={dayKey(date)}>\n                    {onDay(date).filter((event) => event.allDay).map((event) => (\n                      <button key={event.id} type=\"button\" data-event={event.id} data-slot=\"cal-chip\" style={{ [\"--tone\" as string]: `var(--chart-${tone(event)})` }} onClick={(e) => openEditor(draftFor(event), e.currentTarget)}>\n                        {event.title}\n                      </button>\n                    ))}\n                  </div>\n                ))}\n              </div>\n              <div ref={grid} data-slot=\"cal-grid\" role=\"grid\" aria-labelledby={`${id}-title`} aria-describedby={`${id}-help`}>\n                <div data-slot=\"cal-hours\" aria-hidden=\"true\">\n                  {Array.from({ length: 24 }, (_, hour) => <span key={hour}>{hour === 0 ? \"\" : `${String(hour).padStart(2, \"0\")}:00`}</span>)}\n                </div>\n                {days.map((date) => {\n                  const key = dayKey(date);\n                  const timed = visible\n                    .filter((event) => !event.allDay)\n                    .map((event) => {\n                      const live = drag && drag.id === event.id && drag.mode !== \"create\" ? drag : null;\n                      const start = live?.start ?? parseLocal(event.start);\n                      const end = live?.end ?? parseLocal(event.end);\n                      return { event, start, end, s: minutesOf(start), f: Math.max(minutesOf(start) + SNAP, dayKey(end) !== dayKey(start) ? 24 * 60 : minutesOf(end)) };\n                    })\n                    .filter((item) => dayKey(item.start) === key);\n                  return (\n                    <div key={key} data-day={key} role=\"row\" aria-label={longDay(date)} onPointerDown={(e) => startCreate(e, date)} onPointerMove={moveDrag} onPointerUp={endDrag}>\n                      {layoutColumns(timed).map(({ event, start, end, s, f, col, cols }) => (\n                        <div\n                          key={event.id}\n                          role=\"gridcell\"\n                          tabIndex={0}\n                          data-event={event.id}\n                          data-slot=\"cal-event\"\n                          data-dragging={drag?.id === event.id || undefined}\n                          data-short={f - s < 45 || undefined}\n                          aria-label={`${event.title}, ${hm(start)} to ${hm(end)}${event.location ? `, ${event.location}` : \"\"}`}\n                          style={{ top: (s / 60) * HOUR, height: Math.max(20, ((f - s) / 60) * HOUR - 2), left: `calc(${(col / cols) * 100}% + 2px)`, width: `calc(${100 / cols}% - 4px)`, [\"--tone\" as string]: `var(--chart-${tone(event)})` }}\n                          onPointerDown={(e) => startDrag(e, event, \"move\")}\n                          onPointerMove={moveDrag}\n                          onPointerUp={endDrag}\n                          onKeyDown={(e) => {\n                            if (e.key === \"Enter\") openEditor(draftFor(event), e.currentTarget);\n                            else keys(e, event);\n                          }}\n                        >\n                          <b>{event.title}</b>\n                          <span>{hm(start)}–{hm(end)}{event.location ? ` · ${event.location}` : \"\"}</span>\n                          <i data-slot=\"cal-grip\" aria-hidden=\"true\" onPointerDown={(e) => startDrag(e, event, \"size\")} onPointerMove={moveDrag} onPointerUp={endDrag} />\n                        </div>\n                      ))}\n                      {drag?.mode === \"create\" && dayKey(drag.start) === key && drag.moved && (\n                        <div data-slot=\"cal-event\" data-ghost=\"\" aria-hidden=\"true\" style={{ top: (minutesOf(drag.start) / 60) * HOUR, height: ((drag.end.getTime() - drag.start.getTime()) / 3_600_000) * HOUR, left: 2, right: 2, [\"--tone\" as string]: \"var(--brand)\" }}>\n                          <span>{hm(drag.start)}–{hm(drag.end)}</span>\n                        </div>\n                      )}\n                      {clock && dayKey(clock) === key && nowLine}\n                    </div>\n                  );\n                })}\n              </div>\n              <p id={`${id}-help`} className=\"sr-only\">Each event can be moved with Alt and the arrow keys, and made longer or shorter with Alt, Shift and Up or Down. Enter opens it.</p>\n            </div>\n          )}\n\n          {view === \"month\" && <MonthGrid anchor={anchorDate} today={today} weekStart={weekStart} events={visible} tone={tone} onOpenDay={(iso) => { setAnchor(iso); setView(\"day\"); }} onOpen={(event, from) => openEditor(draftFor(event), from)} onCreate={(date, from) => { const start = addMinutes(date, 9 * 60); openEditor(newDraft(start, addMinutes(start, 60)), from); }} />}\n\n          {view === \"agenda\" && <Agenda from={anchorDate} events={visible} calendars={calendars} onOpen={(event, from) => openEditor(draftFor(event), from)} />}\n        </div>\n      </div>\n\n      <p className=\"sr-only\" role=\"status\">{announce}</p>\n\n      <EventEditor\n        draft={draft}\n        calendars={calendars}\n        onClose={() => {\n          setDraft(null);\n          requestAnimationFrame(() => opener.current?.isConnected && opener.current.focus());\n        }}\n        onSave={(next) => {\n          const eventId = next.id ?? newEventId();\n          const start = next.allDay ? `${next.date}T00:00` : `${next.date}T${next.start}`;\n          const end = next.allDay ? `${next.date}T23:59` : `${next.date}T${next.end}`;\n          save({ id: eventId, title: next.title.trim() || \"Untitled event\", start, end, calendar: next.calendar, allDay: next.allDay, location: next.location.trim() || undefined, notes: next.notes.trim() || undefined });\n          setAnnounce(`${next.id ? \"Saved\" : \"Added\"} ${next.title.trim() || \"Untitled event\"}, ${longDay(parseLocal(start))}.`);\n          setDraft(null);\n        }}\n        onDelete={(eventId) => {\n          const removed = events.find((event) => event.id === eventId);\n          onEventsChange(events.filter((event) => event.id !== eventId));\n          setAnnounce(`Deleted ${removed?.title}.`);\n          setDraft(null);\n        }}\n      />\n    </div>\n  );\n}\n\nfunction Sources({ calendars, hidden, setHidden }: { calendars: readonly CalendarSource[]; hidden: string[]; setHidden: (next: string[]) => void }) {\n  return (\n    <fieldset data-slot=\"cal-sources\">\n      <legend>Calendars</legend>\n      {calendars.map((source) => (\n        <label key={source.id} style={{ [\"--tone\" as string]: `var(--chart-${source.tone})` }}>\n          <Checkbox checked={!hidden.includes(source.id)} onChange={(event) => setHidden(event.target.checked ? hidden.filter((item) => item !== source.id) : [...hidden, source.id])} />\n          <span data-slot=\"cal-swatch\" aria-hidden=\"true\" />\n          {source.label}\n        </label>\n      ))}\n    </fieldset>\n  );\n}\n\nfunction MonthGrid({\n  anchor,\n  today,\n  weekStart,\n  events,\n  tone,\n  onOpenDay,\n  onOpen,\n  onCreate,\n}: {\n  anchor: Date;\n  today: string;\n  weekStart: 0 | 1;\n  events: readonly CalendarAppEvent[];\n  tone: (event: CalendarAppEvent) => number;\n  onOpenDay: (iso: string) => void;\n  onOpen: (event: CalendarAppEvent, from: HTMLElement) => void;\n  onCreate: (date: Date, from: HTMLElement) => void;\n}) {\n  const first = startOfWeek(new Date(anchor.getFullYear(), anchor.getMonth(), 1), weekStart);\n  const cells = Array.from({ length: 42 }, (_, n) => plusDays(first, n));\n  const weekdays = cells.slice(0, 7).map((date) => date.toLocaleDateString(\"en-GB\", { weekday: \"short\" }));\n  return (\n    <div data-slot=\"cal-month\" role=\"grid\" aria-label={anchor.toLocaleDateString(\"en-GB\", { month: \"long\", year: \"numeric\" })}>\n      <div role=\"row\" data-slot=\"cal-month-head\">\n        {weekdays.map((day) => <span key={day} role=\"columnheader\">{day}</span>)}\n      </div>\n      {Array.from({ length: 6 }, (_, week) => (\n        <div role=\"row\" key={week} data-slot=\"cal-month-row\">\n          {cells.slice(week * 7, week * 7 + 7).map((date) => {\n            const key = dayKey(date);\n            const list = events.filter((event) => event.start.startsWith(key)).sort((a, b) => Number(!a.allDay) - Number(!b.allDay) || a.start.localeCompare(b.start));\n            return (\n              <div key={key} role=\"gridcell\" data-outside={date.getMonth() !== anchor.getMonth() || undefined} data-today={key === today || undefined} onDoubleClick={(e) => onCreate(date, e.currentTarget)}>\n                <button type=\"button\" data-slot=\"cal-month-day\" onClick={() => onOpenDay(key)} aria-label={`${longDay(date)}, ${list.length} ${list.length === 1 ? \"event\" : \"events\"}`}>{date.getDate()}</button>\n                {list.slice(0, 3).map((event) => (\n                  <button key={event.id} type=\"button\" data-event={event.id} data-slot=\"cal-chip\" data-timed={!event.allDay || undefined} style={{ [\"--tone\" as string]: `var(--chart-${tone(event)})` }} onClick={(e) => onOpen(event, e.currentTarget)}>\n                    {!event.allDay && <span className=\"tabular-nums\">{event.start.slice(11, 16)}</span>} {event.title}\n                  </button>\n                ))}\n                {list.length > 3 && <button type=\"button\" data-slot=\"cal-more\" onClick={() => onOpenDay(key)}>{list.length - 3} more</button>}\n              </div>\n            );\n          })}\n        </div>\n      ))}\n    </div>\n  );\n}\n\nfunction Agenda({ from, events, calendars, onOpen }: { from: Date; events: readonly CalendarAppEvent[]; calendars: readonly CalendarSource[]; onOpen: (event: CalendarAppEvent, from: HTMLElement) => void }) {\n  const start = new Date(from.getFullYear(), from.getMonth(), 1);\n  const days = Array.from({ length: new Date(from.getFullYear(), from.getMonth() + 1, 0).getDate() }, (_, n) => plusDays(start, n));\n  const withEvents = days.map((date) => ({ date, list: events.filter((event) => event.start.startsWith(dayKey(date))).sort((a, b) => a.start.localeCompare(b.start)) })).filter((day) => day.list.length);\n  if (!withEvents.length) return <p className=\"rounded-control px-4 py-10 text-center text-sm text-muted-foreground shadow-[inset_0_0_0_1px_var(--border)]\">Nothing planned this month.</p>;\n  return (\n    <ol data-slot=\"cal-agenda\">\n      {withEvents.map(({ date, list }) => (\n        <li key={dayKey(date)}>\n          <h3>{longDay(date)}</h3>\n          <ul>\n            {list.map((event) => (\n              <li key={event.id}>\n                <button type=\"button\" data-event={event.id} onClick={(e) => onOpen(event, e.currentTarget)} style={{ [\"--tone\" as string]: `var(--chart-${calendars.find((source) => source.id === event.calendar)?.tone ?? 1})` }}>\n                  <span className=\"tabular-nums text-xs text-muted-foreground\">{event.allDay ? \"All day\" : `${event.start.slice(11, 16)}–${event.end.slice(11, 16)}`}</span>\n                  <span data-slot=\"cal-swatch\" aria-hidden=\"true\" />\n                  <span className=\"min-w-0 flex-1 truncate text-sm font-medium\">{event.title}</span>\n                  {event.location && <span className=\"hidden items-center gap-1 text-xs text-muted-foreground @[560px]:inline-flex\"><MapPin aria-hidden=\"true\" className=\"size-3.5\" />{event.location}</span>}\n                </button>\n              </li>\n            ))}\n          </ul>\n        </li>\n      ))}\n    </ol>\n  );\n}\n\nfunction EventEditor({ draft, calendars, onClose, onSave, onDelete }: { draft: Draft | null; calendars: readonly CalendarSource[]; onClose: () => void; onSave: (draft: Draft) => void; onDelete: (id: string) => void }) {\n  const [form, setForm] = useState<Draft | null>(draft);\n  const [error, setError] = useState<string>();\n  const [shown, setShown] = useState(draft);\n  const formId = useId();\n  // A new draft replaces the form while rendering, so it never flashes the old one.\n  if (draft !== shown) {\n    setShown(draft);\n    setForm(draft);\n    setError(undefined);\n  }\n  const set = <K extends keyof Draft>(key: K, value: Draft[K]) => setForm((current) => (current ? { ...current, [key]: value } : current));\n  return (\n    <Dialog open={!!draft} onOpenChange={(open) => !open && onClose()}>\n      <DialogContent className=\"max-w-md\">\n        {form && (\n          <>\n            <DialogHeader>\n              <DialogTitle>{form.id ? \"Edit event\" : \"New event\"}</DialogTitle>\n              <DialogDescription>{longDay(parseLocal(form.date))}{form.allDay ? \", all day\" : `, ${clock(form.start)}–${clock(form.end)}`}</DialogDescription>\n            </DialogHeader>\n            <form\n              id={formId}\n              className=\"grid gap-3\"\n              onSubmit={(event) => {\n                event.preventDefault();\n                if (!form.allDay && form.end <= form.start) return setError(\"The end has to be after the start.\");\n                onSave(form);\n              }}\n            >\n              <Field label=\"Title\">\n                {(props) => <Input {...props} autoFocus value={form.title} placeholder=\"Untitled event\" onChange={(e) => set(\"title\", e.target.value)} />}\n              </Field>\n              <div className=\"grid grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)_minmax(0,1fr)] gap-2 max-sm:grid-cols-2\">\n                <DatePicker label=\"Date\" className=\"max-w-none max-sm:col-span-2\" value={form.date} onValueChange={(value) => value && set(\"date\", value)} />\n                <TimeField label=\"Starts\" disabled={form.allDay} value={form.start} onChange={(value) => set(\"start\", value)} />\n                <TimeField label=\"Ends\" disabled={form.allDay} value={form.end} onChange={(value) => { set(\"end\", value); setError(undefined); }} />\n              </div>\n              {error && <p role=\"alert\" className=\"-mt-1.5 text-[13px] text-destructive\">{error}</p>}\n              <label className=\"flex items-center gap-2 text-[13px]\">\n                <Switch checked={form.allDay} onChange={(e) => set(\"allDay\", e.target.checked)} />\n                All day\n              </label>\n              <div className=\"grid gap-1.5\">\n                <span id={`${formId}-cal`} className=\"text-sm font-medium\">Calendar</span>\n                <SelectMenu aria-labelledby={`${formId}-cal`} value={form.calendar} onValueChange={(value) => set(\"calendar\", value)} options={calendars.map((source) => ({ value: source.id, label: source.label, icon: <span data-slot=\"cal-swatch\" style={{ [\"--tone\" as string]: `var(--chart-${source.tone})` }} /> }))} />\n              </div>\n              <Field label=\"Location\" optional>\n                {(props) => <Input {...props} value={form.location} onChange={(e) => set(\"location\", e.target.value)} />}\n              </Field>\n              <Field label=\"Notes\" optional>\n                {(props) => <Textarea {...props} value={form.notes} onChange={(e) => set(\"notes\", e.target.value)} />}\n              </Field>\n            </form>\n            <DialogFooter className=\"sm:justify-between\">\n              {form.id ? <Button variant=\"ghost\" className=\"text-destructive\" onClick={() => onDelete(form.id!)}>Delete</Button> : <span />}\n              <div className=\"flex flex-col-reverse gap-2 sm:flex-row\">\n                <Button variant=\"secondary\" onClick={onClose}>Cancel</Button>\n                <Button type=\"submit\" form={formId}>{form.id ? \"Save\" : \"Add event\"}</Button>\n              </div>\n            </DialogFooter>\n          </>\n        )}\n      </DialogContent>\n    </Dialog>\n  );\n}\n"},{"path":"ui/checkbox.tsx","type":"registry:ui","target":"components/ui/checkbox.tsx","content":"\"use client\";\n\nimport {\n  useImperativeHandle,\n  useLayoutEffect,\n  useRef,\n  type ComponentProps,\n} from \"react\";\nimport \"./checkbox.css\";\n\nexport type CheckboxProps = Omit<ComponentProps<\"input\">, \"type\"> & {\n  indeterminate?: boolean;\n};\n\nexport function Checkbox({\n  ref,\n  indeterminate = false,\n  ...props\n}: CheckboxProps) {\n  const input = useRef<HTMLInputElement>(null);\n  useImperativeHandle(ref, () => input.current!, []);\n\n  // Native activation clears mixed state. Derive this prop from the group's\n  // selection; synchronize again whenever the caller renders that state.\n  useLayoutEffect(() => {\n    if (input.current) input.current.indeterminate = indeterminate;\n  });\n\n  return (\n    <span data-slot=\"checkbox-root\">\n      <input data-slot=\"checkbox\" {...props} type=\"checkbox\" ref={input} />\n      <span data-slot=\"checkbox-indicator\" aria-hidden=\"true\">\n        <svg viewBox=\"0 0 12 12\" fill=\"none\">\n          <path data-mark=\"check\" d=\"M2.5 6.2 5 8.5l4.5-5\" />\n          <path data-mark=\"mixed\" d=\"M3 6h6\" />\n        </svg>\n      </span>\n    </span>\n  );\n}\n"},{"path":"ui/date-picker.tsx","type":"registry:ui","target":"components/ui/date-picker.tsx","content":"\"use client\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { useId, useRef, useState } from \"react\";\nimport { Calendar, formatISODate, parseISODate } from \"./calendar\";\nimport { Label } from \"./label\";\nimport { RollingValue } from \"./rolling-value\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/date-menu.css\";\n\nfunction DateParts({ value, direction }: { value: string; direction: \"up\" | \"down\" | \"none\" }) {\n  const { year, month, day } = parseISODate(value);\n  const monthLabel = new Intl.DateTimeFormat(\"en-US\", { month: \"short\" }).format(new Date(year, month, day));\n  return (\n    <span className=\"inline-flex items-baseline gap-1\">\n      <RollingValue value={monthLabel} direction={direction} />\n      <RollingValue value={String(day)} direction={direction} />\n      <RollingValue value={String(year)} direction={direction} />\n    </span>\n  );\n}\n\nexport function DatePicker({\n  label,\n  value,\n  defaultValue = null,\n  onValueChange,\n  min,\n  max,\n  showToday = true,\n  name,\n  disabled,\n  className,\n}: {\n  label: string;\n  value?: string | null;\n  defaultValue?: string | null;\n  onValueChange?: (value: string | null) => void;\n  min?: string;\n  max?: string;\n  showToday?: boolean;\n  name?: string;\n  disabled?: boolean;\n  className?: string;\n}) {\n  const fieldId = useId();\n  const root = useRef<HTMLDivElement>(null);\n  const [local, setLocal] = useState(defaultValue);\n  const [open, setOpen] = useState(false);\n  const [direction, setDirection] = useState<\"up\" | \"down\" | \"none\">(\"none\");\n  const current = value === undefined ? local : value;\n\n  function choose(next: string) {\n    if (current) setDirection(next > current ? \"up\" : \"down\");\n    if (value === undefined) setLocal(next);\n    onValueChange?.(next);\n    window.setTimeout(() => setOpen(false), 240);\n  }\n\n  function clear() {\n    setDirection(\"none\");\n    if (value === undefined) setLocal(null);\n    onValueChange?.(null);\n    setOpen(false);\n  }\n\n\n  return (\n    <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n    <div ref={root} className={cn(\"relative grid max-w-sm gap-1.5\", className)}>\n      <Label htmlFor={fieldId}>{label}</Label>\n      <PopoverPrimitive.Trigger asChild>\n      <button\n        id={fieldId}\n        type=\"button\"\n        disabled={disabled}\n        aria-haspopup=\"dialog\"\n        aria-expanded={open}\n        className=\"flex h-[var(--control-height)] items-center rounded-control bg-[var(--field)] shadow-[var(--shadow-field)] transition-shadow hover:shadow-[var(--shadow-field-hover)] px-3 text-left text-sm outline-none focus-visible:shadow-[var(--shadow-field-focus)] disabled:opacity-45\"\n        onKeyDown={(event) => {\n          if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n            event.preventDefault();\n            setOpen(true);\n          }\n        }}\n      >\n        {current ? (\n          <>\n            <span className=\"sr-only\">{formatISODate(current)}</span>\n            <DateParts value={current} direction={direction} />\n          </>\n        ) : (\n          <span className=\"text-muted-foreground\">Select a date</span>\n        )}\n        <CalendarIcon aria-hidden=\"true\" className=\"ml-auto size-4 shrink-0 text-muted-foreground\" />\n      </button>\n      </PopoverPrimitive.Trigger>\n      <PopoverPrimitive.Portal>\n        <PopoverPrimitive.Content\n          aria-label={label}\n          data-slot=\"date-menu\"\n          align=\"start\"\n          sideOffset={4}\n          collisionPadding={12}\n          className=\"z-50 max-h-[var(--radix-popover-content-available-height)] overflow-y-auto p-3 outline-none\"\n          onOpenAutoFocus={(event) => {\n            // Land on the chosen day (or the first day) rather than the first button.\n            const target = (event.currentTarget as HTMLElement | null)?.querySelector<HTMLButtonElement>(current ? `[data-date=\"${current}\"]` : \"[data-date]\");\n            if (target) {\n              event.preventDefault();\n              target.focus();\n            }\n          }}\n        >\n          <Calendar label={label} selected={current} onSelect={choose} min={min} max={max} showToday={showToday} />\n          {current ? (\n            <button type=\"button\" className=\"mt-2 h-8 w-full rounded-surface text-sm font-medium outline-none hover:bg-muted focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-ring\" onClick={clear}>\n              Clear\n            </button>\n          ) : null}\n        </PopoverPrimitive.Content>\n      </PopoverPrimitive.Portal>\n      {name ? <input type=\"hidden\" name={name} value={current ?? \"\"} /> : null}\n    </div>\n    </PopoverPrimitive.Root>\n  );\n}\n"},{"path":"ui/dialog.tsx","type":"registry:ui","target":"components/ui/dialog.tsx","content":"\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"./lib/cn\";\nimport { Button } from \"./button\";\nimport \"./shared/dialog-overlay.css\";\nimport \"./dialog.css\";\n\nexport const Dialog = DialogPrimitive.Root;\nexport const DialogTrigger = DialogPrimitive.Trigger;\nexport const DialogClose = DialogPrimitive.Close;\n\nexport type DialogContentProps = ComponentProps<\n  typeof DialogPrimitive.Content\n> & {\n  showCloseButton?: boolean;\n};\n\nexport function DialogContent({\n  className,\n  children,\n  showCloseButton = true,\n  ...props\n}: DialogContentProps) {\n  return (\n    <DialogPrimitive.Portal>\n      <DialogPrimitive.Overlay\n        data-slot=\"dialog-overlay\"\n        className=\"fixed inset-0 z-50 bg-[var(--overlay)]\"\n      />\n      <DialogPrimitive.Content\n        data-slot=\"dialog-content\"\n        className={cn(\n          \"fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-5 overflow-y-auto rounded-overlay border border-border bg-elevated p-5 text-foreground shadow-overlay outline-none sm:p-6\",\n          // Phones: the dialog becomes a sheet resting on the bottom edge.\n          props[\"data-motion\" as keyof typeof props] !== \"sheet\" &&\n            \"max-sm:top-auto max-sm:bottom-2 max-sm:left-2 max-sm:w-[calc(100%-1rem)] max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:max-h-[calc(100dvh-1.5rem)]\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n        {showCloseButton && (\n          <DialogPrimitive.Close asChild>\n            <Button\n              variant=\"ghost\"\n              size=\"icon\"\n              className=\"absolute top-3.5 right-3.5 size-8 rounded-control max-sm:size-11\"\n              aria-label=\"Close dialog\"\n            >\n              <X aria-hidden=\"true\" />\n            </Button>\n          </DialogPrimitive.Close>\n        )}\n      </DialogPrimitive.Content>\n    </DialogPrimitive.Portal>\n  );\n}\n\nexport function DialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      className={cn(\"flex min-w-0 flex-col gap-2 pr-8\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function DialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      className={cn(\n        \"sticky bottom-[-1.25rem] z-10 -mx-5 -mb-5 flex flex-col-reverse gap-2 border-t border-border bg-[var(--elevated-glass)] px-4 py-3.5 sm:bottom-[-1.5rem] sm:-mx-6 sm:-mb-6 sm:flex-row sm:justify-end\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function DialogTitle({\n  className,\n  ...props\n}: ComponentProps<typeof DialogPrimitive.Title>) {\n  return (\n    <DialogPrimitive.Title\n      className={cn(\n        \"text-base leading-6 font-semibold tracking-tight break-words\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function DialogDescription({\n  className,\n  ...props\n}: ComponentProps<typeof DialogPrimitive.Description>) {\n  return (\n    <DialogPrimitive.Description\n      className={cn(\"text-sm leading-5 text-muted-foreground\", className)}\n      {...props}\n    />\n  );\n}\n"},{"path":"ui/field.tsx","type":"registry:ui","target":"components/ui/field.tsx","content":"\"use client\";\nimport { CircleAlert, CircleCheck, LoaderCircle } from \"lucide-react\";\nimport { useId, type ReactNode } from \"react\";\nimport { Label } from \"./label\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/field-message.css\";\nimport \"./shared/loading-indicator.css\";\nimport \"./field.css\";\n\nexport type FieldControlProps = {\n  id: string;\n  \"aria-describedby\"?: string;\n  \"aria-invalid\"?: true;\n  \"aria-required\"?: true;\n};\n\nexport const isEmail = (value: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value.trim());\n\n/**\n * A label, a control and one message line wired together for assistive\n * technology. Hint, async status and error share the same reserved line and\n * rewrite it in place, so validation never pushes the next field down.\n */\nexport function Field({\n  label,\n  description,\n  error,\n  status,\n  statusTone = \"pending\",\n  count,\n  required,\n  optional,\n  action,\n  className,\n  children,\n}: {\n  label: string;\n  /** Hint shown on the message line until a status or error replaces it. */\n  description?: ReactNode;\n  /** Replaces the hint and is announced when it appears. */\n  error?: string;\n  /** An async result such as “Checking availability…” or “Available”. */\n  status?: string;\n  statusTone?: \"pending\" | \"success\";\n  /** Right-aligned counter on the message line, e.g. “6 / 40”. */\n  count?: string;\n  required?: boolean;\n  /** Adds \"(optional)\" after the label. */\n  optional?: boolean;\n  /** Something aligned with the label, such as a \"Forgot password?\" link. */\n  action?: ReactNode;\n  className?: string;\n  children: (props: FieldControlProps) => ReactNode;\n}) {\n  const id = useId();\n  const message = `${id}-message`;\n  const hasMessage = Boolean(error || status || description || count);\n  const tone = error ? \"error\" : status ? statusTone : \"hint\";\n  return (\n    <div data-slot=\"field\" className={cn(\"grid gap-1.5\", className)}>\n      <div className=\"flex items-baseline justify-between gap-3\">\n        <Label htmlFor={id}>\n          {label}\n          {optional && <span className=\"ml-1 font-normal text-muted-foreground\">(optional)</span>}\n        </Label>\n        {action}\n      </div>\n      {children({\n        id,\n        \"aria-describedby\": hasMessage ? message : undefined,\n        \"aria-invalid\": error ? true : undefined,\n        \"aria-required\": required ? true : undefined,\n      })}\n      <p id={message} data-slot=\"field-message\" data-tone={tone} aria-live={error ? \"assertive\" : \"polite\"} role={error ? \"alert\" : undefined}>\n        {tone === \"error\" && <CircleAlert aria-hidden=\"true\" />}\n        {tone === \"success\" && <CircleCheck aria-hidden=\"true\" />}\n        {tone === \"pending\" && <LoaderCircle data-slot=\"loading-indicator\" aria-hidden=\"true\" />}\n        <span data-slot=\"field-error\" className=\"min-w-0 flex-1\">{error ?? status ?? description}</span>\n        {count && <span data-slot=\"field-count\">{count}</span>}\n      </p>\n    </div>\n  );\n}\n"},{"path":"ui/input.tsx","type":"registry:ui","target":"components/ui/input.tsx","content":"import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/input.css\";\nimport \"./shared/input-2.css\";\nimport \"./shared/input-group.css\";\nimport \"./input.css\";\n\nconst fieldText =\n  \"w-full min-w-0 text-base text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:text-sm\";\n\nexport type InputProps = ComponentProps<\"input\"> & {\n  /** Fixed text or an icon before the value, e.g. \"caliper.app/\". */\n  leading?: ReactNode;\n  /** Text, an icon or a status after the value, e.g. a spinner or a count. */\n  trailing?: ReactNode;\n};\n\n/**\n * A recessed text field. Fields sit slightly below the paper (an inner shade\n * and a 3:1 ring); buttons stand on it, so what you fill and what you press\n * never look alike.\n */\nexport function Input({ className, leading, trailing, ...props }: InputProps) {\n  if (leading === undefined && trailing === undefined) {\n    return (\n      <input\n        data-slot=\"input\"\n        className={cn(\"flex h-[var(--control-height)] rounded-button px-3\", fieldText, className)}\n        {...props}\n      />\n    );\n  }\n  return (\n    <span\n      data-slot=\"input-group\"\n      data-disabled={props.disabled || undefined}\n      data-invalid={props[\"aria-invalid\"] === true || props[\"aria-invalid\"] === \"true\" || undefined}\n      data-readonly={props.readOnly || undefined}\n      className={cn(\"flex h-[var(--control-height)] w-full min-w-0 items-center gap-2 rounded-button px-3\", className)}\n    >\n      {leading !== undefined && <span data-slot=\"input-affix\">{leading}</span>}\n      <input data-slot=\"input-bare\" className={cn(\"h-full flex-1 bg-transparent\", fieldText)} {...props} />\n      {trailing !== undefined && <span data-slot=\"input-trailing\">{trailing}</span>}\n    </span>\n  );\n}\n"},{"path":"ui/label.tsx","type":"registry:ui","target":"components/ui/label.tsx","content":"import type { ComponentProps } from \"react\";\nimport { cn } from \"./lib/cn\";\n\nexport function Label({ className, ...props }: ComponentProps<\"label\">) {\n  return (\n    <label\n      data-slot=\"label\"\n      className={cn(\n        \"inline-block max-w-full text-sm leading-5 font-medium [overflow-wrap:anywhere]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n"},{"path":"ui/lib/calendar-time.ts","type":"registry:ui","target":"components/ui/lib/calendar-time.ts","content":"/* Local date-time helpers shared by the week calendar and the calendar app.\n   Times are local \"YYYY-MM-DDTHH:mm\" strings, so an event never moves when\n   the viewer's time zone differs from the server's. */\n\nexport const pad = (n: number) => String(n).padStart(2, \"0\");\n\nexport function parseLocal(value: string) {\n  const [date, time = \"00:00\"] = value.split(\"T\");\n  const [y, m, d] = date!.split(\"-\").map(Number);\n  const [h, mi] = time.split(\":\").map(Number);\n  return new Date(y!, m! - 1, d!, h!, mi!);\n}\n\nexport const formatLocal = (date: Date) => `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\nexport const dayKey = (date: Date) => formatLocal(date).slice(0, 10);\nexport const hm = (date: Date) => `${pad(date.getHours())}:${pad(date.getMinutes())}`;\nexport const minutesOf = (date: Date) => date.getHours() * 60 + date.getMinutes();\n\n/** The first day of the week holding `date`; 1 starts weeks on Monday, 0 on Sunday. */\nexport function startOfWeek(date: Date, weekStart: 0 | 1 = 1) {\n  const day = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n  day.setDate(day.getDate() - ((day.getDay() - weekStart + 7) % 7));\n  return day;\n}\nexport const mondayOf = (date: Date) => startOfWeek(date, 1);\n\nexport function addMinutes(date: Date, minutes: number, days = 0) {\n  const next = new Date(date);\n  next.setMinutes(next.getMinutes() + minutes);\n  next.setDate(next.getDate() + days);\n  return next;\n}\n\n/** Lays overlapping items side by side: each gets a column and the column count of its cluster. */\nexport function layoutColumns<T extends { s: number; f: number }>(list: readonly T[]) {\n  const sorted = [...list].sort((a, b) => a.s - b.s || b.f - a.f);\n  const out: (T & { col: number; cols: number })[] = [];\n  let group: (T & { col: number; cols: number })[] = [];\n  let end = -1;\n  const flush = () => {\n    const n = Math.max(0, ...group.map((g) => g.col)) + 1;\n    group.forEach((g) => (g.cols = n));\n    out.push(...group);\n    group = [];\n  };\n  for (const item of sorted) {\n    if (item.s >= end && group.length) {\n      flush();\n      end = -1;\n    }\n    const used = new Set(group.filter((g) => g.f > item.s).map((g) => g.col));\n    let col = 0;\n    while (used.has(col)) col++;\n    group.push({ ...item, col, cols: 1 });\n    end = Math.max(end, item.f);\n  }\n  flush();\n  return out;\n}\n"},{"path":"ui/lib/cn.ts","type":"registry:ui","target":"components/ui/lib/cn.ts","content":"import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n  extend: { theme: { radius: [\"control\", \"surface\", \"overlay\"], shadow: [\"overlay\"] } },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"},{"path":"ui/lib/slide.ts","type":"registry:ui","target":"components/ui/lib/slide.ts","content":"\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\n/**\n * Slides content in when `key` changes (a new week, month or view): from the side you moved toward, or a plain fade\n * when the move has no direction. The element is animated in place, never remounted, so scroll and focus survive.\n * Call `toward(-1 | 1)` just before the change. Reduced motion swaps at once.\n */\nexport function useSlideOnChange<T extends HTMLElement = HTMLDivElement>(key: string) {\n  const ref = useRef<T>(null);\n  const direction = useRef(0);\n  const shown = useRef(key);\n  useEffect(() => {\n    if (shown.current === key) return;\n    shown.current = key;\n    const from = direction.current;\n    direction.current = 0;\n    if (!ref.current || window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    ref.current.animate([{ opacity: 0.35, transform: `translateX(${from * 14}px)` }, { opacity: 1, transform: \"none\" }], { duration: 260, easing: \"cubic-bezier(0.22, 1, 0.36, 1)\" });\n  }, [key]);\n  return { ref, toward: (step: number) => { direction.current = Math.sign(step); } };\n}\n"},{"path":"ui/popover.tsx","type":"registry:ui","target":"components/ui/popover.tsx","content":"\"use client\";\n\nimport * as Primitive from \"@radix-ui/react-popover\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/popover-content.css\";\nimport \"./popover.css\";\n\nexport const Popover = Primitive.Root;\nexport const PopoverTrigger = Primitive.Trigger;\nexport const PopoverClose = Primitive.Close;\nexport const PopoverAnchor = Primitive.Anchor;\n\nexport function PopoverContent({\n  className,\n  sideOffset = 8,\n  collisionPadding = 16,\n  arrow = false,\n  children,\n  ...props\n}: ComponentProps<typeof Primitive.Content> & {\n  /** Points at the trigger and follows collision shifts. */\n  arrow?: boolean;\n}) {\n  return (\n    <Primitive.Portal>\n      <Primitive.Content\n        data-slot=\"popover-content\"\n        sideOffset={sideOffset}\n        collisionPadding={collisionPadding}\n        className={cn(\n          \"z-50 w-80 max-w-[calc(100vw-2rem)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto rounded-surface border border-border bg-elevated p-3.5 text-sm text-foreground shadow-overlay outline-none\",\n          arrow && \"overflow-visible\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n        {arrow && <Primitive.Arrow data-slot=\"popover-arrow\" width={14} height={7} />}\n      </Primitive.Content>\n    </Primitive.Portal>\n  );\n}\n"},{"path":"ui/rolling-value.tsx","type":"registry:ui","target":"components/ui/rolling-value.tsx","content":"\"use client\";\n\nimport { useState } from \"react\";\nimport \"./rolling-value.css\";\n\nexport function RollingValue({\n  value,\n  direction,\n}: {\n  value: string;\n  direction: \"up\" | \"down\" | \"none\";\n}) {\n  const [frame, setFrame] = useState({ value, prior: value });\n  if (frame.value !== value) setFrame({ value, prior: frame.value });\n  const prior = frame.prior;\n  const glyphs = [...value];\n\n  return (\n    <span className=\"inline-flex items-center font-medium tabular-nums\" aria-hidden=\"true\">\n      {glyphs.map((glyph, index) => {\n        const changed = prior.length !== glyphs.length || prior[index] !== glyph;\n        return (\n          <span key={`${index}-${glyph}`} className=\"inline-block h-[1.2em] overflow-hidden\">\n            <span\n              data-slot=\"number-digit\"\n              data-direction={changed ? direction : \"none\"}\n              className=\"block\"\n            >\n              {glyph === \" \" ? \"\\u00A0\" : glyph}\n            </span>\n          </span>\n        );\n      })}\n    </span>\n  );\n}\n"},{"path":"ui/segmented-control.tsx","type":"registry:ui","target":"components/ui/segmented-control.tsx","content":"\"use client\";\n\nimport {\n  useLayoutEffect,\n  useRef,\n  useState,\n  type KeyboardEvent,\n  type ReactNode,\n} from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/segmented-plate.css\";\n\n/** With an icon, the option shows only the icon and `label` becomes its accessible name and tooltip. */\nexport type SegmentedOption = { value: string; label: string; icon?: ReactNode };\n\nexport function SegmentedControl({\n  label,\n  value,\n  onValueChange,\n  options,\n  className,\n}: {\n  label: string;\n  value: string;\n  onValueChange: (value: string) => void;\n  options: readonly SegmentedOption[];\n  className?: string;\n}) {\n  const group = useRef<HTMLDivElement>(null);\n  const [initialValue] = useState(value);\n  const [indicator, setIndicator] = useState<{\n    left: number;\n    top: number;\n    width: number;\n    height: number;\n  } | null>(null);\n\n  useLayoutEffect(() => {\n    const element = group.current;\n    if (!element) return;\n    const measure = () => {\n      const active = element.querySelector<HTMLElement>('[aria-checked=\"true\"]');\n      setIndicator(\n        active\n          ? {\n              left: active.offsetLeft,\n              top: active.offsetTop,\n              width: active.offsetWidth,\n              height: active.offsetHeight,\n            }\n          : null,\n      );\n    };\n    measure();\n    const resize = new ResizeObserver(measure);\n    resize.observe(element);\n    element\n      .querySelectorAll('[role=\"radio\"]')\n      .forEach((item) => resize.observe(item));\n    return () => resize.disconnect();\n  }, [value, options]);\n\n  function move(event: KeyboardEvent<HTMLDivElement>) {\n    const index = options.findIndex((item) => item.value === value);\n    const next =\n      event.key === \"ArrowRight\" || event.key === \"ArrowDown\"\n        ? (index + 1) % options.length\n        : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\"\n          ? (index - 1 + options.length) % options.length\n          : -1;\n    if (next < 0) return;\n    event.preventDefault();\n    onValueChange(options[next].value);\n    group.current\n      ?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]')\n      [next]?.focus();\n  }\n\n  return (\n    <div\n      ref={group}\n      role=\"radiogroup\"\n      aria-label={label}\n      data-slot=\"segmented\"\n      onKeyDown={move}\n      className={cn(\n        // Too many options for a narrow screen scroll sideways instead of spilling out.\n        \"relative inline-flex max-w-full overflow-x-auto rounded-touch bg-sunken p-[3px] shadow-sunken [scrollbar-width:none]\",\n        className,\n      )}\n    >\n      {indicator && (\n        <span\n          aria-hidden=\"true\"\n          data-slot=\"segmented-indicator\"\n          style={{\n            width: indicator.width,\n            height: indicator.height,\n            transform: `translate(${indicator.left}px, ${indicator.top}px)`,\n          }}\n        >\n          <span\n            key={value}\n            data-slot=\"segmented-plate\"\n            data-moved={value !== initialValue}\n          />\n        </span>\n      )}\n      {options.map((option) => {\n        const selected = option.value === value;\n        return (\n          <button\n            key={option.value}\n            type=\"button\"\n            role=\"radio\"\n            aria-checked={selected}\n            tabIndex={selected ? 0 : -1}\n            aria-label={option.icon ? option.label : undefined}\n            title={option.icon ? option.label : undefined}\n            onClick={() => onValueChange(option.value)}\n            className=\"relative z-10 inline-flex shrink-0 h-[calc(var(--control-height)-6px)] min-w-10 items-center justify-center rounded-[calc(var(--radius-touch)-3px)] px-3 text-[13px] font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-ring aria-checked:text-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0\"\n          >\n            {option.icon ?? option.label}\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n"},{"path":"ui/select-menu.tsx","type":"registry:ui","target":"components/ui/select-menu.tsx","content":"\"use client\";\n\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Check, ChevronsUpDown } from \"lucide-react\";\nimport {\n  useEffect,\n  useId,\n  useRef,\n  useState,\n  type ComponentProps,\n  type KeyboardEvent,\n  type ReactNode,\n  type Ref,\n} from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/select.css\";\nimport \"./shared/input-2.css\";\nimport \"./select-menu.css\";\n\nexport type SelectMenuOption = {\n  value: string;\n  label: string;\n  /** Short identifier shown in mono at the end of the row, e.g. \"eu-central-1\". */\n  code?: string;\n  /** A 16px mark before the label, e.g. a network dot or a person's initials. */\n  icon?: ReactNode;\n  disabled?: boolean;\n};\n\nconst ROW = 36;\nconst PAD = 4;\n// The list is a little wider than its trigger and starts before it, so the chosen row sits over the trigger.\nconst WIDER = 36;\nconst ALIGN = 28;\nconst EDGE = 12;\n\nfunction useCoarsePointer() {\n  const [coarse, setCoarse] = useState(false);\n  useEffect(() => {\n    const query = window.matchMedia(\"(pointer: coarse)\");\n    const update = () => setCoarse(query.matches);\n    update();\n    query.addEventListener(\"change\", update);\n    return () => query.removeEventListener(\"change\", update);\n  }, []);\n  return coarse;\n}\n\n/**\n * A select whose list opens with the chosen option lying exactly over the\n * trigger text, so the eye never jumps. On touch screens it is the platform\n * picker. A hidden input carries the value in native forms.\n */\nexport function SelectMenu({\n  options,\n  value: controlled,\n  defaultValue,\n  onValueChange,\n  placeholder = \"Choose…\",\n  name,\n  disabled,\n  size = \"md\",\n  variant = \"field\",\n  className,\n  ref,\n  ...aria\n}: {\n  options: readonly SelectMenuOption[];\n  value?: string;\n  defaultValue?: string;\n  onValueChange?: (value: string) => void;\n  placeholder?: string;\n  /** Submitted with the form. */\n  name?: string;\n  disabled?: boolean;\n  /** sm is 32px for toolbars, filters and table rows; md follows the control height. */\n  size?: \"sm\" | \"md\";\n  /** ghost drops the field ring, for a select inside a composed control (a currency in a money field). */\n  variant?: \"field\" | \"ghost\";\n  className?: string;\n  /** The trigger (or, on touch screens, the native select), e.g. for a dialog's first focus. */\n  ref?: Ref<HTMLButtonElement | HTMLSelectElement>;\n} & Pick<ComponentProps<\"button\">, \"id\" | \"aria-label\" | \"aria-labelledby\" | \"aria-describedby\" | \"aria-invalid\" | \"aria-required\">) {\n  const listId = useId();\n  const coarse = useCoarsePointer();\n  const [inner, setInner] = useState(defaultValue);\n  const value = controlled ?? inner;\n  const [open, setOpen] = useState(false);\n  const [active, setActive] = useState(0);\n  const [offset, setOffset] = useState(0);\n  // Keeps the list inside the dialog or card it opens in, when laying it over the trigger would cross the edge.\n  const [shift, setShift] = useState(0);\n  const [room, setRoom] = useState<number | undefined>(undefined);\n  const trigger = useRef<HTMLButtonElement>(null);\n  const list = useRef<HTMLDivElement>(null);\n  const selectedIndex = Math.max(0, options.findIndex((option) => option.value === value));\n  const selected = options.find((option) => option.value === value);\n\n  // If the change handler moves focus on (e.g. into a reply box), leave it there when the list closes.\n  const keepFocus = useRef(false);\n  // A form may disable the trigger while it saves the choice. Focus cannot return to a disabled button,\n  // so it returns as soon as the trigger is enabled again, unless the reader has moved on by then.\n  const refocus = useRef(false);\n  useEffect(() => {\n    if (disabled || !refocus.current) return;\n    refocus.current = false;\n    const now = document.activeElement;\n    if (!now || now === document.body) trigger.current?.focus();\n  }, [disabled]);\n  function choose(next: string) {\n    if (controlled === undefined) setInner(next);\n    onValueChange?.(next);\n    const now = document.activeElement;\n    keepFocus.current = !!now && now !== document.body && now !== trigger.current && !list.current?.contains(now);\n  }\n\n  function openList(nextOpen: boolean) {\n    if (nextOpen && trigger.current) {\n      // Lay the selected row over the trigger, unless that would leave the viewport.\n      const rect = trigger.current.getBoundingClientRect();\n      const above = PAD + selectedIndex * ROW;\n      const fits = rect.top - above > 8 && rect.top - above + options.length * ROW + PAD * 2 < window.innerHeight - 8;\n      setOffset(fits ? -(rect.height + above) - (ROW - rect.height) / 2 : 6);\n      const card = trigger.current.closest<HTMLElement>('[role=\"dialog\"]')?.getBoundingClientRect();\n      const left = rect.left - ALIGN;\n      const right = left + rect.width + WIDER;\n      setShift(!card ? 0 : left < card.left + EDGE ? card.left + EDGE - left : right > card.right - EDGE ? card.right - EDGE - right : 0);\n      setRoom(card ? card.width - EDGE * 2 : undefined);\n      setActive(selectedIndex);\n    }\n    setOpen(nextOpen);\n  }\n\n  function move(delta: number) {\n    let next = active;\n    for (let step = 0; step < options.length; step += 1) {\n      next = Math.min(options.length - 1, Math.max(0, next + delta));\n      if (!options[next].disabled) break;\n    }\n    setActive(next);\n  }\n\n  function onListKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n    if (event.key === \"ArrowDown\") move(1);\n    else if (event.key === \"ArrowUp\") move(-1);\n    else if (event.key === \"Home\") setActive(options.findIndex((option) => !option.disabled));\n    else if (event.key === \"End\") setActive(options.length - 1 - [...options].reverse().findIndex((option) => !option.disabled));\n    else if (event.key === \"Enter\" || event.key === \" \") {\n      const option = options[active];\n      if (option && !option.disabled) {\n        choose(option.value);\n        setOpen(false);\n      }\n    } else if (event.key === \"Tab\") setOpen(false);\n    else if (/^\\S$/.test(event.key)) {\n      const start = (active + 1) % options.length;\n      const order = [...options.slice(start), ...options.slice(0, start)];\n      const hit = order.find((option) => !option.disabled && option.label.toLowerCase().startsWith(event.key.toLowerCase()));\n      if (hit) setActive(options.indexOf(hit));\n    } else return;\n    event.preventDefault();\n  }\n\n  useEffect(() => {\n    if (!open) return;\n    list.current?.querySelector<HTMLElement>(`[data-index=\"${active}\"]`)?.scrollIntoView({ block: \"nearest\" });\n  }, [active, open]);\n\n  if (coarse) {\n    return (\n      <span data-slot=\"select-menu-native\" data-size={size} data-variant={variant} className={cn(\"relative block\", className)}>\n        <select\n          ref={ref as Ref<HTMLSelectElement>}\n          data-slot=\"select\"\n          {...aria}\n          name={name}\n          disabled={disabled}\n          value={value ?? \"\"}\n          onChange={(event) => choose(event.target.value)}\n          className={cn(\n            \"block w-full min-w-0 appearance-none text-base text-foreground outline-none\",\n            size === \"sm\" ? \"h-8 rounded-control pr-8 pl-2.5\" : \"h-[var(--control-height)] rounded-button pr-9 pl-3\",\n          )}\n        >\n          {!selected && <option value=\"\" disabled>{placeholder}</option>}\n          {options.map((option) => (\n            <option key={option.value} value={option.value} disabled={option.disabled}>\n              {option.label}\n              {option.code ? ` · ${option.code}` : \"\"}\n            </option>\n          ))}\n        </select>\n        <ChevronsUpDown aria-hidden=\"true\" className={cn(\"pointer-events-none absolute top-1/2 size-4 -translate-y-1/2 text-muted-foreground\", size === \"sm\" ? \"right-2.5\" : \"right-3\")} />\n      </span>\n    );\n  }\n\n  return (\n    <Popover.Root open={open} onOpenChange={openList}>\n      <Popover.Trigger asChild>\n        <button\n          ref={(node) => {\n            trigger.current = node;\n            if (typeof ref === \"function\") ref(node);\n            else if (ref) (ref as { current: HTMLButtonElement | HTMLSelectElement | null }).current = node;\n          }}\n          type=\"button\"\n          data-slot=\"select-menu\"\n          data-size={size}\n          data-variant={variant}\n          role=\"combobox\"\n          aria-haspopup=\"listbox\"\n          aria-expanded={open}\n          aria-controls={open ? listId : undefined}\n          disabled={disabled}\n          {...aria}\n          onKeyDown={(event) => {\n            if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n              event.preventDefault();\n              openList(true);\n            }\n          }}\n          className={cn(\n            \"flex w-full min-w-0 items-center justify-between gap-2 text-left text-foreground outline-none disabled:cursor-not-allowed\",\n            size === \"sm\" ? \"h-8 rounded-control px-2.5 text-[13px]\" : \"h-[var(--control-height)] rounded-button px-3 text-base md:text-sm\",\n            className,\n          )}\n        >\n          <span className={cn(\"flex min-w-0 items-center gap-2\", !selected && \"text-muted-foreground\")}>\n            {selected?.icon && <span data-slot=\"select-menu-icon\" aria-hidden=\"true\">{selected.icon}</span>}\n            <span className=\"truncate\">{selected ? selected.label : placeholder}</span>\n            {selected?.code && <span data-slot=\"select-menu-code\" className=\"shrink-0\">{selected.code}</span>}\n          </span>\n          <ChevronsUpDown aria-hidden=\"true\" className=\"size-4 shrink-0 text-muted-foreground\" />\n        </button>\n      </Popover.Trigger>\n      {name && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n      <Popover.Portal>\n        <Popover.Content\n          side=\"bottom\"\n          align=\"start\"\n          sideOffset={offset}\n          alignOffset={shift - ALIGN}\n          avoidCollisions={offset > 0}\n          onOpenAutoFocus={(event) => {\n            event.preventDefault();\n            keepFocus.current = false;\n            list.current?.focus();\n          }}\n          onCloseAutoFocus={(event) => {\n            if (keepFocus.current) event.preventDefault();\n            else if (trigger.current?.disabled) {\n              event.preventDefault();\n              refocus.current = true;\n            }\n          }}\n          data-slot=\"select-menu-content\"\n          style={{ width: `calc(var(--radix-popover-trigger-width) + ${WIDER}px)`, maxWidth: room, transformOrigin: `50% ${PAD + selectedIndex * ROW + ROW / 2}px` }}\n        >\n          <div\n            ref={list}\n            id={listId}\n            role=\"listbox\"\n            tabIndex={-1}\n            aria-labelledby={aria[\"aria-labelledby\"]}\n            aria-label={aria[\"aria-label\"]}\n            aria-activedescendant={`${listId}-${active}`}\n            onKeyDown={onListKeyDown}\n            className=\"max-h-[calc(8*36px+8px)] overflow-y-auto p-1 outline-none\"\n          >\n            {options.map((option, index) => (\n              <div\n                key={option.value}\n                id={`${listId}-${index}`}\n                role=\"option\"\n                data-index={index}\n                aria-selected={option.value === value}\n                aria-disabled={option.disabled || undefined}\n                data-active={index === active}\n                data-slot=\"select-menu-option\"\n                onPointerMove={() => !option.disabled && setActive(index)}\n                onClick={() => {\n                  if (option.disabled) return;\n                  choose(option.value);\n                  setOpen(false);\n                }}\n              >\n                <span className=\"grid size-4 place-items-center\">{option.value === value && <Check aria-hidden=\"true\" className=\"size-4\" />}</span>\n                {option.icon && <span data-slot=\"select-menu-icon\" aria-hidden=\"true\">{option.icon}</span>}\n                <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n                {option.code && <span data-slot=\"select-menu-code\">{option.code}</span>}\n              </div>\n            ))}\n          </div>\n        </Popover.Content>\n      </Popover.Portal>\n    </Popover.Root>\n  );\n}\n"},{"path":"ui/switch.tsx","type":"registry:ui","target":"components/ui/switch.tsx","content":"import type { ComponentProps } from \"react\";\nimport \"./switch.css\";\n\nexport type SwitchProps = Omit<ComponentProps<\"input\">, \"type\" | \"role\">;\n\nexport function Switch(props: SwitchProps) {\n  return (\n    <span data-slot=\"switch-root\">\n      <input data-slot=\"switch\" {...props} type=\"checkbox\" role=\"switch\" />\n      <span data-slot=\"switch-track\" aria-hidden=\"true\">\n        <span data-slot=\"switch-thumb\" />\n      </span>\n    </span>\n  );\n}\n"},{"path":"ui/textarea.tsx","type":"registry:ui","target":"components/ui/textarea.tsx","content":"import type { ComponentProps } from \"react\";\nimport { cn } from \"./lib/cn\";\nimport \"./shared/input-2.css\";\nimport \"./textarea.css\";\n\n/** A recessed multi-line field that grows with the draft from 3 to 8 lines, then scrolls. */\nexport function Textarea({ className, ...props }: ComponentProps<\"textarea\">) {\n  return (\n    <textarea\n      data-slot=\"textarea\"\n      className={cn(\n        \"block min-h-[88px] max-h-[200px] w-full min-w-0 resize-none rounded-button px-3 py-[9px] text-base leading-[22px] text-foreground outline-none [field-sizing:content] placeholder:text-muted-foreground disabled:cursor-not-allowed md:text-sm md:leading-[22px]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n"},{"path":"ui/shared/loading-indicator.css","type":"registry:file","target":"components/ui/shared/loading-indicator.css","content":"/* Shared by button.tsx, confirm-morph.tsx, expanding-button-group.tsx, field.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"loading-indicator\"] {\n    animation: caliper-spin var(--duration-loading) var(--ease-linear) infinite;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"loading-indicator\"] {\n      animation: none;\n    }\n  }\n}\n"},{"path":"ui/button.css","type":"registry:file","target":"components/ui/button.css","content":"/* button.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"button\"] {\n    transition-property: background-color, color, border-color;\n    transition-duration: var(--duration-fast);\n    transition-timing-function: var(--ease-out);\n  }\n\n  /* Button material. Raised to press: a lit top edge and a small lift; the\n     press travels 1px down and swaps the lift for an inner shade. Only\n     translate animates (release on the settle curve); shadows swap. */\n  [data-slot=\"button\"] {\n    --b-bg: var(--raised);\n    --b-bg-hover: var(--raised-hover);\n    --b-bg-press: var(--raised-press);\n    --b-fg: var(--foreground);\n    --b-shadow: var(--shadow-raised);\n    --b-shadow-press: var(--shadow-raised-press);\n    background-color: var(--b-bg);\n    color: var(--b-fg);\n    box-shadow: var(--b-shadow);\n    transition-property: background-color, color, border-color, translate, scale;\n    transition-duration:\n      var(--duration-fast), var(--duration-fast), var(--duration-fast),\n      var(--duration-normal), var(--duration-normal);\n    transition-timing-function:\n      var(--ease-out), var(--ease-out), var(--ease-out), var(--ease-settle),\n      var(--ease-settle);\n  }\n  [data-slot=\"button\"][data-variant=\"default\"] {\n    --b-bg: var(--primary);\n    --b-bg-hover: var(--primary-hover);\n    --b-bg-press: var(--primary-press);\n    --b-fg: var(--primary-foreground);\n    --b-shadow: var(--shadow-accent);\n    --b-shadow-press: var(--shadow-accent-press);\n  }\n  [data-slot=\"button\"][data-variant=\"destructive\"] {\n    --b-bg: var(--danger-fill);\n    --b-bg-hover: var(--danger-fill-hover);\n    --b-bg-press: var(--danger-fill-press);\n    --b-fg: var(--danger-fill-foreground);\n    --b-shadow: var(--shadow-danger);\n    --b-shadow-press: var(--shadow-danger-press);\n  }\n  [data-slot=\"button\"][data-variant=\"ghost\"] {\n    --b-bg: transparent;\n    --b-bg-hover: var(--muted);\n    --b-bg-press: var(--muted);\n    --b-fg: var(--muted-foreground);\n    --b-shadow: none;\n    --b-shadow-press: none;\n  }\n  @media (hover: hover) {\n    [data-slot=\"button\"]:hover {\n      background-color: var(--b-bg-hover);\n    }\n    [data-slot=\"button\"][data-variant=\"ghost\"]:hover {\n      color: var(--foreground);\n    }\n  }\n  [data-slot=\"button\"]:active:not(:disabled):not([aria-disabled=\"true\"]):not(\n      [aria-busy=\"true\"]\n    ) {\n    translate: 0 var(--motion-press-travel);\n    scale: var(--motion-press-scale);\n    background-color: var(--b-bg-press);\n    box-shadow: var(--b-shadow-press);\n    transition-duration:\n      var(--duration-fast), var(--duration-fast), var(--duration-fast), 90ms,\n      90ms;\n    transition-timing-function: var(--ease-out);\n  }\n  [data-slot=\"button\"]:is(:disabled, [aria-disabled=\"true\"]):not([aria-busy=\"true\"]) {\n    background-color: var(--sunken);\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"button\"][data-variant=\"ghost\"]:is(:disabled, [aria-disabled=\"true\"]):not(\n      [aria-busy=\"true\"]\n    ) {\n    background-color: transparent;\n    box-shadow: none;\n  }\n  /* Loading keeps the exact width: the label stays in flow but invisible. */\n  [data-slot=\"button-label\"] {\n    display: inline-flex;\n    align-items: center;\n    gap: inherit;\n  }\n  /* Opacity, not visibility, so the label still names the button. */\n  [data-slot=\"button-label\"][data-hidden=\"true\"] {\n    opacity: 0;\n  }\n  [data-slot=\"button-busy\"] {\n    position: absolute;\n    inset: 0;\n    display: grid;\n    place-items: center;\n  }\n  [data-slot=\"button-feedback\"] {\n    display: inline-flex;\n    align-items: center;\n    gap: inherit;\n    overflow: clip;\n    transition: width var(--duration-normal) var(--ease-out);\n  }\n  [data-slot=\"button-feedback-label\"] {\n    display: inline-flex;\n    flex-shrink: 0;\n    align-items: center;\n    gap: inherit;\n    width: max-content;\n  }\n  [data-slot=\"button-feedback-label\"][data-enter=\"true\"] {\n    animation: caliper-feedback-enter var(--duration-normal) var(--ease-out);\n  }\n\n  [data-slot=\"button\"][aria-busy=\"true\"] {\n    pointer-events: none;\n  }\n  [data-slot=\"button\"][data-action-phase=\"error\"] {\n    color: var(--danger);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"button\"],\n    [data-slot=\"button-feedback\"] {\n      transition: none;\n    }\n    [data-slot=\"button\"]:active:not(:disabled):not([aria-disabled=\"true\"]):not(\n        [aria-busy=\"true\"]\n      ) {\n      translate: none;\n    }\n    [data-slot=\"button-feedback-label\"],\n    [data-slot=\"button-feedback-label\"][data-enter=\"true\"] {\n      animation: none;\n    }\n  }\n\n  /* Toggle: pressed is recessed, as a toggled tool in a button group is. */\n  /* Four attributes, so it wins over the group and toolbar pressed rules in any stylesheet order. */\n  [data-slot=\"button\"][data-variant=\"ghost\"][data-toggle][aria-pressed=\"true\"] {\n    --b-bg: var(--raised-press);\n    --b-bg-hover: var(--raised-press);\n    --b-bg-press: var(--raised-press);\n    --b-fg: var(--foreground);\n    --b-shadow: var(--shadow-sunken);\n    --b-shadow-press: var(--shadow-sunken);\n  }\n}\n"},{"path":"ui/shared/calendar-day.css","type":"registry:file","target":"components/ui/shared/calendar-day.css","content":"/* Shared by calendar.tsx, returns-calendar.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* Calendar: today gets an ember dot, data marks a quiet bar, unavailable days are struck through. */\n  [data-slot=\"calendar-day\"][aria-current=\"date\"] {\n    font-weight: 600;\n  }\n  [data-slot=\"calendar-day\"][aria-current=\"date\"]::before {\n    content: \"\";\n    position: absolute;\n    top: 5px;\n    left: 50%;\n    width: 4px;\n    height: 4px;\n    margin-left: -2px;\n    border-radius: 50%;\n    background: var(--ring);\n  }\n  [data-slot=\"calendar-day\"][data-mark]::after {\n    content: \"\";\n    position: absolute;\n    bottom: 5px;\n    left: 50%;\n    width: 12px;\n    height: 2px;\n    margin-left: -6px;\n    border-radius: 1px;\n    background: var(--border-strong);\n  }\n  [data-slot=\"calendar-day\"][data-selected=\"true\"]::after,\n  [data-slot=\"calendar-day\"][data-selected=\"true\"]::before {\n    background: var(--accent-foreground);\n  }\n  [data-slot=\"calendar-day\"][aria-disabled=\"true\"] {\n    text-decoration: line-through;\n  }\n  [data-slot=\"calendar-day\"] {\n    transition:\n      background-color var(--duration-travel) var(--ease-showcase),\n      color var(--duration-fast) var(--ease-out);\n  }\n  [data-slot=\"calendar-day\"][data-selected=\"true\"] {\n    color: var(--background);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"calendar-day\"] {\n      transition:\n        background-color 400ms var(--ease-showcase),\n        color 120ms var(--ease-out);\n    }\n    [data-slot=\"calendar-day\"][data-selected=\"true\"] {\n      animation: caliper-day-select 400ms var(--ease-showcase);\n    }\n  }\n  [data-slot=\"calendar-day\"] {\n    font-size: 0.75rem;\n    color: var(--muted-foreground);\n  }\n}\n"},{"path":"ui/shared/chip-option.css","type":"registry:file","target":"components/ui/shared/chip-option.css","content":"/* Shared by calendar.tsx, chart-parts.tsx, chip-group.tsx, data-table.tsx, number-field.tsx, password-field.tsx, stepper.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* Depth sets 2 and 3 end */\n\n  /* Press feedback (2026-10-20, motion audit): every pressable control answers a press. Compact controls take the\n     system press scale, as Button does; wide rows deepen their fill instead, since scaling a full-width row reads as a\n     jump. Disabled controls stay still. */\n  :is([data-slot=\"chip-option\"], [data-slot=\"number-field\"] button, [data-slot=\"password-toggle\"], [data-slot=\"calendar\"] button, [data-slot=\"chart-legend-item\"], [data-slot=\"sort-button\"], [data-slot=\"stepper\"] button):active:not(:disabled):not([aria-disabled=\"true\"]) {\n    scale: var(--motion-press-scale);\n  }\n}\n"},{"path":"ui/calendar.css","type":"registry:file","target":"components/ui/calendar.css","content":"/* calendar.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"calendar-grid\"][data-motion=\"next\"] {\n    animation: caliper-calendar-next var(--duration-travel) var(--ease-showcase);\n  }\n  [data-slot=\"calendar-grid\"][data-motion=\"prev\"] {\n    animation: caliper-calendar-prev var(--duration-travel) var(--ease-showcase);\n  }\n  [data-slot=\"calendar-range\"] {\n    position: absolute;\n    z-index: 0;\n    height: 2.25rem;\n    border-radius: 999px;\n    background: var(--muted);\n    transition:\n      left var(--duration-travel) var(--ease-showcase),\n      width var(--duration-travel) var(--ease-showcase);\n  }\n  [data-slot=\"calendar-selection\"] {\n    position: absolute;\n    z-index: 1;\n    border-radius: var(--radius-control);\n    background: var(--accent);\n    pointer-events: none;\n    transition:\n      transform var(--duration-travel) var(--ease-showcase),\n      width var(--duration-travel) var(--ease-showcase),\n      height var(--duration-travel) var(--ease-showcase);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"calendar-grid\"][data-motion=\"next\"] {\n      animation: caliper-calendar-next 400ms var(--ease-showcase);\n    }\n    [data-slot=\"calendar-grid\"][data-motion=\"prev\"] {\n      animation: caliper-calendar-prev 400ms var(--ease-showcase);\n    }\n  }\n}\n"},{"path":"ui/shared/styles-4.css","type":"registry:file","target":"components/ui/shared/styles-4.css","content":"/* Shared by calendar-app.tsx, week-calendar.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-day] { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% var(--hour); cursor: cell; }\n}\n"},{"path":"ui/calendar-app.css","type":"registry:file","target":"components/ui/calendar-app.css","content":"/* calendar-app.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"cal-toolbar\"] { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }\n  [data-slot=\"cal-body\"] { display: grid; gap: 20px; }\n  [data-slot=\"cal-side\"] { display: none; }\n  @container (min-width: 1040px) {\n    [data-slot=\"cal-body\"] { grid-template-columns: 272px minmax(0, 1fr); }\n    [data-slot=\"cal-side\"] { display: grid; align-content: start; gap: 20px; }\n    [data-slot=\"cal-filter-button\"] { display: none; }\n  }\n  [data-slot=\"cal-sources\"] { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }\n  [data-slot=\"cal-sources\"] legend { margin-bottom: 6px; padding: 0; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }\n  [data-slot=\"cal-sources\"] label { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; }\n  [data-slot=\"cal-swatch\"] { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--tone, var(--chart-1)); }\n  [data-slot=\"cal-frame\"] { --cal-gutter: 52px; display: grid; min-width: 0; border-radius: var(--radius-surface); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }\n  [data-slot=\"cal-head\"], [data-slot=\"cal-allday\"] { display: grid; grid-template-columns: var(--cal-gutter) repeat(var(--cal-days), minmax(0, 1fr)); border-bottom: 1px solid var(--border); }\n  [data-slot=\"cal-head\"] button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font-size: 12px; color: var(--muted-foreground); border-radius: 0; }\n  [data-slot=\"cal-head\"] button:hover { background: var(--muted); }\n  [data-slot=\"cal-head\"] button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }\n  [data-slot=\"cal-head\"] b { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; }\n  [data-slot=\"cal-head\"] button[data-today] b { background: var(--brand); color: var(--brand-foreground); }\n  [data-slot=\"cal-allday\"] > span { align-self: center; padding-right: 6px; font-size: 12px; text-align: right; color: var(--muted-foreground); }\n  [data-slot=\"cal-allday\"] > div { display: grid; align-content: start; gap: 2px; min-height: 30px; padding: 3px 2px; border-left: 1px solid var(--border); }\n  [data-slot=\"cal-chip\"] { display: block; overflow: hidden; padding: 2px 6px; border-radius: 8px; text-align: left; font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); background: color-mix(in srgb, var(--tone) 18%, var(--background)); box-shadow: inset 2px 0 0 var(--tone); }\n  [data-slot=\"cal-chip\"][data-timed] { background: transparent; box-shadow: none; }\n  [data-slot=\"cal-chip\"][data-timed]::before { content: \"\"; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 999px; background: var(--tone); vertical-align: 1px; }\n  [data-slot=\"cal-chip\"]:hover { filter: brightness(0.97); }\n  [data-slot=\"cal-chip\"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n  [data-slot=\"cal-grid\"] { position: relative; display: grid; grid-template-columns: var(--cal-gutter) repeat(var(--cal-days), minmax(0, 1fr)); height: min(620px, 70vh); overflow-y: auto; overscroll-behavior: contain; }\n  [data-slot=\"cal-hours\"] { display: grid; grid-template-rows: repeat(24, 48px); }\n  [data-slot=\"cal-hours\"] span { position: relative; top: -7px; padding-right: 8px; font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; color: var(--muted-foreground); }\n  [data-slot=\"cal-grid\"] [data-day] {\n    position: relative; height: calc(24 * 48px); border-left: 1px solid var(--border); touch-action: pan-y;\n    background: repeating-linear-gradient(to bottom, transparent 0 47px, var(--border) 47px 48px);\n  }\n  [data-slot=\"cal-event\"] {\n    position: absolute; z-index: 1; display: grid; align-content: start; gap: 1px; overflow: hidden; padding: 3px 6px 6px; border-radius: 8px; font-size: 12px; line-height: 15px; cursor: grab; touch-action: none; user-select: none;\n    background: color-mix(in srgb, var(--tone) 20%, var(--background)); box-shadow: inset 3px 0 0 var(--tone), 0 0 0 1px var(--background);\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n  [data-slot=\"cal-event\"] b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n  [data-slot=\"cal-event\"] span { overflow: hidden; font-size: 12px; color: color-mix(in srgb, var(--foreground) 72%, transparent); text-overflow: ellipsis; white-space: nowrap; }\n  [data-slot=\"cal-event\"][data-short] { grid-auto-flow: column; justify-content: start; gap: 6px; }\n  [data-slot=\"cal-event\"]:hover { box-shadow: inset 3px 0 0 var(--tone), 0 0 0 1px var(--background), 0 2px 8px color-mix(in srgb, var(--foreground) 14%, transparent); }\n  [data-slot=\"cal-event\"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; z-index: 3; }\n  [data-slot=\"cal-event\"][data-dragging] { z-index: 4; cursor: grabbing; box-shadow: inset 3px 0 0 var(--tone), var(--shadow-overlay); opacity: 0.94; }\n  [data-slot=\"cal-event\"][data-ghost] { z-index: 2; background: color-mix(in srgb, var(--brand) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--brand); cursor: ns-resize; }\n  [data-slot=\"cal-grip\"] { position: absolute; inset-inline: 0; bottom: 0; height: 7px; cursor: ns-resize; }\n  [data-slot=\"cal-now\"] { position: absolute; inset-inline: 0; z-index: 2; height: 2px; background: var(--brand); pointer-events: none; }\n  [data-slot=\"cal-now\"]::before { content: \"\"; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 999px; background: var(--brand); }\n  [data-slot=\"cal-month\"] { display: grid; overflow: hidden; border-radius: var(--radius-surface); box-shadow: inset 0 0 0 1px var(--border); }\n  [data-slot=\"cal-month-head\"], [data-slot=\"cal-month-row\"] { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }\n  [data-slot=\"cal-month-head\"] span { padding: 8px; font-size: 12px; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }\n  [data-slot=\"cal-month-row\"] > div { display: grid; align-content: start; gap: 2px; min-width: 0; min-height: 104px; padding: 4px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }\n  [data-slot=\"cal-month-row\"] > div:first-child { border-left: 0; }\n  [data-slot=\"cal-month-row\"]:last-child > div { border-bottom: 0; }\n  [data-slot=\"cal-month-row\"] > div[data-outside] { background: var(--surface); }\n  [data-slot=\"cal-month-row\"] > div[data-outside] [data-slot=\"cal-month-day\"] { color: var(--muted-foreground); }\n  [data-slot=\"cal-month-day\"] { justify-self: start; display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }\n  [data-slot=\"cal-month-day\"]:hover { background: var(--muted); }\n  [data-slot=\"cal-month-day\"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n  [data-slot=\"cal-month-row\"] > div[data-today] [data-slot=\"cal-month-day\"] { background: var(--brand); color: var(--brand-foreground); }\n  [data-slot=\"cal-more\"] { justify-self: start; padding: 0 6px; font-size: 12px; color: var(--muted-foreground); border-radius: 4px; }\n  [data-slot=\"cal-more\"]:hover { color: var(--foreground); text-decoration: underline; }\n  @container (max-width: 640px) {\n    [data-slot=\"cal-month-row\"] > div { min-height: 64px; }\n    [data-slot=\"cal-month-row\"] [data-slot=\"cal-chip\"] { font-size: 0; height: 6px; padding: 0; background: var(--tone); box-shadow: none; }\n    [data-slot=\"cal-month-row\"] [data-slot=\"cal-chip\"][data-timed]::before { display: none; }\n    [data-slot=\"cal-more\"] { font-size: 12px; }\n  }\n  [data-slot=\"cal-agenda\"] { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }\n  [data-slot=\"cal-agenda\"] h3 { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }\n  [data-slot=\"cal-agenda\"] ul { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }\n  [data-slot=\"cal-agenda\"] ul li { border-bottom: 1px solid var(--border); }\n  [data-slot=\"cal-agenda\"] button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 8px; text-align: left; border-radius: 0; }\n  [data-slot=\"cal-agenda\"] button > span:first-child { width: 88px; flex: none; }\n  [data-slot=\"cal-agenda\"] button:hover { background: var(--muted); }\n  [data-slot=\"cal-agenda\"] button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }\n}\n"},{"path":"ui/checkbox.css","type":"registry:file","target":"components/ui/checkbox.css","content":"/* checkbox.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* The native input fills the target; the smaller indicator is decorative. */\n  [data-slot=\"checkbox-root\"] {\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    width: var(--control-height);\n    height: var(--control-height);\n    vertical-align: middle;\n  }\n\n  [data-slot=\"checkbox\"] {\n    position: absolute;\n    inset: 0;\n    width: 100%;\n    height: 100%;\n    margin: 0;\n    appearance: none;\n    border: 0;\n    background: transparent;\n    outline: none;\n    cursor: pointer;\n    touch-action: manipulation;\n  }\n\n  /* Choice marks: one 18px recessed mark for checkbox and radio. Checked\n     marks fill with ink; the check stroke draws itself and the radio dot\n     settles in. The switch thumb stretches while pressed, then settles. */\n  [data-slot=\"checkbox-indicator\"] {\n    box-sizing: border-box;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    pointer-events: none;\n    background: var(--field);\n    box-shadow: var(--shadow-field);\n    transition:\n      background-color var(--duration-fast) var(--ease-out),\n      box-shadow var(--duration-fast) var(--ease-out);\n  }\n\n  [data-slot=\"checkbox-indicator\"] {\n    width: 18px;\n    height: 18px;\n  }\n\n  [data-slot=\"checkbox-indicator\"] {\n    border-radius: var(--radius-mark);\n    color: var(--accent-foreground);\n  }\n  [data-slot=\"checkbox-indicator\"] svg {\n    width: 12px;\n    height: 12px;\n    stroke: currentColor;\n    stroke-width: 2;\n    stroke-linecap: round;\n    stroke-linejoin: round;\n  }\n  [data-slot=\"checkbox-indicator\"] path {\n    stroke-dasharray: 20;\n    stroke-dashoffset: 20;\n    transition: stroke-dashoffset 200ms var(--ease-out);\n  }\n  [data-slot=\"checkbox\"]:checked:not(:indeterminate) + [data-slot=\"checkbox-indicator\"] [data-mark=\"check\"],\n  [data-slot=\"checkbox\"]:indeterminate + [data-slot=\"checkbox-indicator\"] [data-mark=\"mixed\"] {\n    stroke-dashoffset: 0;\n  }\n\n  [data-slot=\"checkbox\"]:checked + [data-slot=\"checkbox-indicator\"],\n  [data-slot=\"checkbox\"]:indeterminate + [data-slot=\"checkbox-indicator\"] {\n    background: var(--accent);\n    box-shadow: 0 0 0 1px var(--accent), inset 0 1px 0 rgb(255 255 255 / 14%);\n  }\n\n  @media (hover: hover) {\n    [data-slot=\"checkbox\"]:hover:not(:disabled):not(:checked)\n      + [data-slot=\"checkbox-indicator\"] {\n      box-shadow: var(--shadow-field-hover);\n    }\n  }\n\n  [data-slot=\"checkbox\"]:focus-visible + [data-slot=\"checkbox-indicator\"] {\n    outline: 2px solid var(--ring);\n    outline-offset: 2px;\n  }\n\n  [data-slot=\"checkbox\"][aria-invalid=\"true\"]\n    + [data-slot=\"checkbox-indicator\"] {\n    box-shadow: var(--shadow-field-invalid);\n    outline-color: var(--destructive);\n  }\n\n  [data-slot=\"checkbox\"]:disabled {\n    cursor: not-allowed;\n  }\n  [data-slot=\"checkbox\"]:disabled + [data-slot=\"checkbox-indicator\"] {\n    background: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"checkbox\"]:disabled:is(:checked, :indeterminate) + [data-slot=\"checkbox-indicator\"] {\n    background: var(--border);\n    box-shadow: none;\n  }\n\n  @media (forced-colors: active) {\n    [data-slot=\"checkbox-indicator\"] {\n      forced-color-adjust: none;\n      background: Canvas;\n      border-color: CanvasText;\n    }\n    [data-slot=\"checkbox\"]:checked + [data-slot=\"checkbox-indicator\"],\n    [data-slot=\"checkbox\"]:indeterminate + [data-slot=\"checkbox-indicator\"] {\n      background: Highlight;\n      border-color: Highlight;\n    }\n    [data-slot=\"checkbox\"]:is(:checked, :indeterminate) + [data-slot=\"checkbox-indicator\"] {\n      color: HighlightText;\n    }\n    [data-slot=\"checkbox-indicator\"] {\n      border: 1px solid CanvasText;\n      box-shadow: none;\n    }\n    [data-slot=\"checkbox\"]:hover:not(:disabled)\n      + [data-slot=\"checkbox-indicator\"] {\n      border-color: CanvasText;\n    }\n    [data-slot=\"checkbox\"]:focus-visible + [data-slot=\"checkbox-indicator\"] {\n      outline-color: Highlight;\n    }\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"checkbox-indicator\"],\n    [data-slot=\"checkbox-indicator\"] path {\n      transition: none;\n    }\n  }\n}\n"},{"path":"ui/shared/date-menu.css","type":"registry:file","target":"components/ui/shared/date-menu.css","content":"/* Shared by date-picker.tsx, date-range-picker.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"date-menu\"] {\n    border: 1px solid var(--border);\n    border-radius: var(--radius-overlay);\n    transform-origin: top center;\n    animation: caliper-menu-enter var(--duration-travel) var(--ease-showcase);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"date-menu\"] {\n      animation: caliper-menu-enter 400ms var(--ease-showcase);\n    }\n  }\n}\n\n[data-slot=\"date-menu\"] {\n  background-color: var(--elevated-glass);\n  border-color: color-mix(in srgb, var(--edge-light) 45%, var(--border));\n  backdrop-filter: blur(var(--blur-overlay));\n  box-shadow:\n    var(--shadow-overlay),\n    0 0 40px var(--edge-glow),\n    inset 0 1px 0 var(--edge-light);\n}\n"},{"path":"ui/shared/dialog-overlay.css","type":"registry:file","target":"components/ui/shared/dialog-overlay.css","content":"/* Shared by bottom-sheet.tsx, dialog.tsx, morphing-modal.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"dialog-overlay\"][data-state=\"open\"] {\n    animation: caliper-fade-in var(--duration-normal) var(--ease-out);\n  }\n\n  [data-slot=\"dialog-overlay\"][data-state=\"closed\"] {\n    animation: caliper-fade-out var(--duration-fast) var(--ease-in) forwards;\n    pointer-events: none;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"dialog-overlay\"] {\n      animation: none;\n    }\n    /* Preserve the exit name for Radix Presence's completion matcher, including\n       a preference changed during exit. No visual motion or unmount timer. */\n    [data-slot=\"dialog-overlay\"][data-state=\"closed\"] {\n      animation: caliper-fade-out var(--duration-instant) var(--ease-in) forwards !important;\n    }\n  }\n}\n\n/* Outside the component layer so this wins over bg-elevated utilities. */\n[data-slot=\"dialog-overlay\"] {\n  backdrop-filter: blur(2px);\n}\n"},{"path":"ui/dialog.css","type":"registry:file","target":"components/ui/dialog.css","content":"/* dialog.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"dialog-content\"][data-motion=\"sheet\"][data-state=\"open\"] {\n    animation: caliper-fade-in var(--duration-normal) var(--ease-out);\n  }\n\n  [data-slot=\"dialog-content\"]:not([data-motion=\"sheet\"])[data-state=\"open\"] {\n    animation: caliper-dialog-enter var(--duration-normal) var(--ease-settle);\n  }\n\n  [data-slot=\"dialog-content\"][data-state=\"closed\"] {\n    animation: caliper-fade-out var(--duration-fast) var(--ease-in) forwards;\n    pointer-events: none;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"dialog-content\"],\n    [data-slot=\"dialog-content\"]:not([data-motion=\"sheet\"])[data-state=\"open\"] {\n      animation: none;\n    }\n    /* Preserve the exit name for Radix Presence's completion matcher, including\n       a preference changed during exit. No visual motion or unmount timer. */\n    [data-slot=\"dialog-content\"][data-state=\"closed\"] {\n      animation: caliper-fade-out var(--duration-instant) var(--ease-in) forwards !important;\n    }\n  }\n}\n\n[data-slot=\"dialog-content\"] {\n  background-color: var(--elevated-glass);\n  border-color: color-mix(in srgb, var(--edge-light) 45%, var(--border));\n  backdrop-filter: blur(var(--blur-overlay));\n  box-shadow:\n    var(--shadow-overlay),\n    0 0 40px var(--edge-glow),\n    inset 0 1px 0 var(--edge-light);\n}\n"},{"path":"ui/shared/field-message.css","type":"registry:file","target":"components/ui/shared/field-message.css","content":"/* Shared by date-input.tsx, field.tsx, scrub-field.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"field-message\"] {\n    display: flex;\n    align-items: flex-start;\n    gap: 6px;\n    min-height: 18px;\n    margin: 0;\n    font-size: 12px;\n    line-height: 18px;\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"field-message\"] svg {\n    flex: none;\n    width: 14px;\n    height: 14px;\n    margin-top: 2px;\n  }\n  [data-slot=\"field-message\"][data-tone=\"error\"] {\n    color: var(--danger);\n  }\n  [data-slot=\"field-message\"][data-tone=\"success\"] {\n    color: var(--success);\n  }\n}\n"},{"path":"ui/field.css","type":"registry:file","target":"components/ui/field.css","content":"/* field.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"field-count\"] {\n    margin-left: auto;\n    color: var(--muted-foreground);\n    font-variant-numeric: tabular-nums;\n    font-size: 12px;\n    font-variant-numeric: tabular-nums;\n  }\n}\n"},{"path":"ui/shared/input.css","type":"registry:file","target":"components/ui/shared/input.css","content":"/* Shared by combobox.tsx, input.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"input\"] {\n    transition-property: background-color, color, border-color;\n    transition-duration: var(--duration-fast);\n    transition-timing-function: var(--ease-out);\n  }\n\n  /* Recessed to fill. One ring for every field: 3:1 at rest, darker on\n     hover, a 2px ember ring with a soft halo on focus, danger when invalid.\n     Disabled and read-only drop into the sunken fill and stay legible. */\n  [data-slot=\"input\"] {\n    border: 0;\n    background-color: var(--field);\n    box-shadow: var(--shadow-field);\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"input\"] {\n      transition: none;\n    }\n  }\n}\n"},{"path":"ui/shared/input-2.css","type":"registry:file","target":"components/ui/shared/input-2.css","content":"/* Shared by combobox.tsx, input.tsx, select-menu.tsx, select.tsx, textarea.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  @media (hover: hover) {\n    :is([data-slot=\"input\"], [data-slot=\"textarea\"], [data-slot=\"select\"]):hover:enabled:not(:focus-visible):not([aria-invalid=\"true\"]) {\n      box-shadow: var(--shadow-field-hover);\n    }\n  }\n  :is([data-slot=\"input\"], [data-slot=\"textarea\"], [data-slot=\"select\"]):focus-visible {\n    outline: none;\n    box-shadow: var(--shadow-field-focus);\n    transition: none;\n  }\n  :is([data-slot=\"input\"], [data-slot=\"textarea\"], [data-slot=\"select\"])[aria-invalid=\"true\"] {\n    box-shadow: var(--shadow-field-invalid);\n  }\n  :is([data-slot=\"input\"], [data-slot=\"textarea\"], [data-slot=\"select\"])[aria-invalid=\"true\"]:focus-visible {\n    box-shadow:\n      var(--shadow-field-invalid),\n      0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);\n  }\n  :is([data-slot=\"input\"], [data-slot=\"textarea\"], [data-slot=\"select\"]):disabled {\n    background-color: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n    color: var(--muted-foreground);\n  }\n  :is([data-slot=\"input\"], [data-slot=\"textarea\"])[readonly] {\n    background-color: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n  }\n}\n"},{"path":"ui/shared/input-group.css","type":"registry:file","target":"components/ui/shared/input-group.css","content":"/* Shared by input.tsx, money-field.tsx, phone-field.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  @media (hover: hover) {\n    :is([data-slot=\"input-group\"], [data-slot=\"money-field\"], [data-slot=\"phone-field-control\"]):not([data-disabled]):not([data-invalid]):hover:not(:focus-within) {\n      box-shadow: var(--shadow-field-hover);\n    }\n  }\n  :is([data-slot=\"input-group\"], [data-slot=\"money-field\"], [data-slot=\"phone-field-control\"]):focus-within {\n    outline: none;\n    box-shadow: var(--shadow-field-focus);\n    transition: none;\n  }\n}\n"},{"path":"ui/input.css","type":"registry:file","target":"components/ui/input.css","content":"/* input.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* Recessed to fill. One ring for every field: 3:1 at rest, darker on\n     hover, a 2px ember ring with a soft halo on focus, danger when invalid.\n     Disabled and read-only drop into the sunken fill and stay legible. */\n  [data-slot=\"input-group\"] {\n    border: 0;\n    background-color: var(--field);\n    box-shadow: var(--shadow-field);\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n  [data-slot=\"input-group\"][data-invalid] {\n    box-shadow: var(--shadow-field-invalid);\n  }\n  [data-slot=\"input-group\"][data-invalid]:focus-within {\n    box-shadow:\n      var(--shadow-field-invalid),\n      0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);\n  }\n  [data-slot=\"input-group\"][data-disabled] {\n    background-color: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"input-group\"][data-readonly] {\n    background-color: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n  }\n  [data-slot=\"input-bare\"] {\n    border: 0;\n    box-shadow: none;\n    outline: none;\n  }\n  [data-slot=\"input-affix\"] {\n    display: inline-flex;\n    align-items: center;\n    height: 20px;\n    padding-inline-end: 10px;\n    margin-inline-end: 2px;\n    color: var(--muted-foreground);\n    box-shadow: 1px 0 0 var(--border);\n    white-space: nowrap;\n  }\n  [data-slot=\"input-affix\"]:dir(rtl) {\n    box-shadow: -1px 0 0 var(--border);\n  }\n  [data-slot=\"input-affix\"]:has(> svg:only-child) {\n    padding-inline-end: 0;\n    box-shadow: none;\n  }\n  [data-slot=\"input-trailing\"] {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    color: var(--muted-foreground);\n    white-space: nowrap;\n    font-size: 12px;\n  }\n  :is([data-slot=\"input-affix\"], [data-slot=\"input-trailing\"]) svg {\n    width: 16px;\n    height: 16px;\n  }\n  [data-slot=\"docs-toolbar\"] [data-slot=\"input-group\"] { max-width: 24rem; }\n}\n"},{"path":"ui/shared/popover-content.css","type":"registry:file","target":"components/ui/shared/popover-content.css","content":"/* Shared by date-input.tsx, popover.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"popover-content\"] {\n    transform-origin: var(--radix-popover-content-transform-origin);\n  }\n  [data-slot=\"popover-content\"][data-state=\"open\"] {\n    animation: caliper-dialog-enter var(--duration-normal) var(--ease-settle);\n  }\n  [data-slot=\"popover-content\"][data-state=\"closed\"] {\n    animation: caliper-fade-out var(--duration-fast) var(--ease-in) forwards;\n    pointer-events: none;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"popover-content\"] {\n      animation: none;\n    }\n    /* Preserve the exit name for Radix Presence's completion matcher, including\n       a preference changed during exit. No visual motion or unmount timer. */\n    [data-slot=\"popover-content\"][data-state=\"closed\"] {\n      animation: caliper-fade-out var(--duration-instant) var(--ease-in) forwards !important;\n    }\n  }\n}\n\n[data-slot=\"popover-content\"] {\n  background-color: var(--elevated-glass);\n  border-color: color-mix(in srgb, var(--edge-light) 45%, var(--border));\n  backdrop-filter: blur(var(--blur-overlay));\n  box-shadow:\n    var(--shadow-overlay),\n    0 0 40px var(--edge-glow),\n    inset 0 1px 0 var(--edge-light);\n}\n"},{"path":"ui/popover.css","type":"registry:file","target":"components/ui/popover.css","content":"/* popover.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"popover-arrow\"] {\n    fill: var(--elevated);\n  }\n}\n"},{"path":"ui/rolling-value.css","type":"registry:file","target":"components/ui/rolling-value.css","content":"/* rolling-value.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"number-digit\"][data-direction=\"up\"] {\n    animation: caliper-digit-in var(--duration-travel) var(--ease-showcase);\n  }\n  [data-slot=\"number-digit\"][data-direction=\"down\"] {\n    animation: caliper-digit-down var(--duration-travel) var(--ease-showcase);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"number-digit\"][data-direction=\"up\"] {\n      animation: caliper-digit-in 400ms var(--ease-showcase);\n    }\n    [data-slot=\"number-digit\"][data-direction=\"down\"] {\n      animation: caliper-digit-down 400ms var(--ease-showcase);\n    }\n  }\n}\n\n@keyframes caliper-digit-down {\n  from {\n    transform: translateY(70%);\n  }\n  to {\n    transform: translateY(0);\n  }\n}\n"},{"path":"ui/shared/segmented-plate.css","type":"registry:file","target":"components/ui/shared/segmented-plate.css","content":"/* Shared by billing-toggle.tsx, segmented-control.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* Segmented control: one raised plate travels to the choice on the settle\n     curve and stretches 7% toward it mid-flight, so selection reads as one\n     object moving. Labels and the value change at once. */\n  [data-slot=\"segmented-indicator\"] {\n    position: absolute;\n    top: 0;\n    left: 0;\n    z-index: 0;\n    pointer-events: none;\n    transition:\n      transform 320ms var(--ease-settle),\n      width 320ms var(--ease-settle);\n  }\n  [data-slot=\"segmented-plate\"] {\n    display: block;\n    width: 100%;\n    height: 100%;\n    /* Concentric with the track: its radius less the 3px inset. */\n    border-radius: calc(var(--radius-touch) - 3px);\n    background: var(--accent);\n    box-shadow: var(--shadow-plate);\n  }\n  [data-slot=\"segmented-plate\"][data-moved=\"true\"] {\n    animation: caliper-plate-stretch 320ms var(--ease-out);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"segmented-indicator\"],\n    [data-slot=\"segmented-plate\"] {\n      transition: none;\n    }\n    [data-slot=\"segmented-plate\"][data-moved=\"true\"] {\n      animation: none;\n    }\n  }\n}\n"},{"path":"ui/shared/select.css","type":"registry:file","target":"components/ui/shared/select.css","content":"/* Shared by select-menu.tsx, select.tsx; each imports it. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"select\"] {\n    transition-property: background-color, color, border-color;\n    transition-duration: var(--duration-fast);\n    transition-timing-function: var(--ease-out);\n  }\n\n  [data-slot=\"select\"] {\n    cursor: pointer;\n    touch-action: manipulation;\n  }\n  /* The native select wears the select-menu trigger: no platform arrow, the\n     same up/down mark on the right. Lists (multiple or size > 1) keep theirs. */\n  [data-slot=\"select\"]:not([multiple]):not([size]) {\n    appearance: none;\n    padding-right: 36px;\n    background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d5d66' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E\");\n    background-repeat: no-repeat;\n    background-position: right 10px center;\n    background-size: 16px 16px;\n  }\n  [data-theme=\"dark\"] [data-slot=\"select\"]:not([multiple]):not([size]),\n  [data-slot=\"select\"][data-theme=\"dark\"]:not([multiple]):not([size]) {\n    background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ababb4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E\");\n  }\n\n  /* Recessed to fill. One ring for every field: 3:1 at rest, darker on\n     hover, a 2px ember ring with a soft halo on focus, danger when invalid.\n     Disabled and read-only drop into the sunken fill and stay legible. */\n  [data-slot=\"select\"] {\n    border: 0;\n    background-color: var(--field);\n    box-shadow: var(--shadow-field);\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n\n  [data-slot=\"select\"]:disabled {\n    cursor: not-allowed;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"select\"] {\n      transition: none;\n    }\n  }\n}\n"},{"path":"ui/select-menu.css","type":"registry:file","target":"components/ui/select-menu.css","content":"/* select-menu.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"select-menu-native\"] [data-slot=\"select\"] {\n    background-image: none;\n  }\n  /* Select menu: the field trigger, and a frosted list that opens with the\n     chosen row over the trigger and grows around it. */\n  [data-slot=\"select-menu\"] {\n    border: 0;\n    background-color: var(--field);\n    box-shadow: var(--shadow-field);\n    cursor: pointer;\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n  @media (hover: hover) {\n    [data-slot=\"select-menu\"]:hover:enabled:not(:focus-visible):not([aria-expanded=\"true\"]):not([aria-invalid=\"true\"]) {\n      box-shadow: var(--shadow-field-hover);\n    }\n  }\n  [data-slot=\"select-menu\"]:focus-visible,\n  [data-slot=\"select-menu\"][aria-expanded=\"true\"] {\n    box-shadow: var(--shadow-field-focus);\n  }\n  [data-slot=\"select-menu\"][aria-invalid=\"true\"] {\n    box-shadow: var(--shadow-field-invalid);\n  }\n  [data-slot=\"select-menu\"]:disabled {\n    background-color: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"select-menu-code\"] {\n    margin-left: auto;\n    font-family: var(--font-mono);\n    font-size: 12px;\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"select-menu-content\"] {\n    z-index: 50;\n    border-radius: var(--radius-surface);\n    background: var(--elevated-glass);\n    -webkit-backdrop-filter: blur(var(--blur-overlay));\n    backdrop-filter: blur(var(--blur-overlay));\n    box-shadow: var(--shadow-overlay), 0 0 0 1px var(--edge-glow), inset 0 1px 0 var(--edge-light);\n    color: var(--foreground);\n    animation: caliper-select-in var(--duration-normal) var(--ease-out);\n  }\n  [data-slot=\"select-menu-option\"] {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    height: 36px;\n    padding: 0 10px;\n    border-radius: var(--radius-control);\n    font-size: 14px;\n    cursor: default;\n    transition: background-color var(--duration-fast) var(--ease-out);\n  }\n  [data-slot=\"select-menu-option\"][data-active=\"true\"] {\n    background: var(--selected);\n  }\n  [data-slot=\"select-menu-option\"][aria-disabled=\"true\"] {\n    color: var(--muted-foreground);\n    opacity: 0.7;\n  }\n  [data-slot=\"select-menu-native\"] [data-slot=\"select\"] {\n    appearance: none;\n  }\n  [data-slot=\"select-menu-icon\"] {\n    display: inline-grid;\n    flex: none;\n    place-items: center;\n    width: 16px;\n    height: 16px;\n  }\n  [data-slot=\"select-menu-icon\"] svg { width: 16px; height: 16px; }\n  /* Ghost: no field ring, for a select inside a composed control. */\n  [data-slot=\"select-menu\"][data-variant=\"ghost\"],\n  [data-slot=\"select-menu-native\"][data-variant=\"ghost\"] [data-slot=\"select\"] {\n    background-color: transparent;\n    box-shadow: none;\n  }\n  @media (hover: hover) {\n    [data-slot=\"select-menu\"][data-variant=\"ghost\"]:hover:enabled:not([aria-expanded=\"true\"]) {\n      background-color: var(--raised-hover);\n      box-shadow: none;\n    }\n  }\n  [data-slot=\"select-menu\"][data-variant=\"ghost\"]:focus-visible,\n  [data-slot=\"select-menu\"][data-variant=\"ghost\"][aria-expanded=\"true\"] {\n    background-color: var(--raised-hover);\n    box-shadow: 0 0 0 2px var(--ring);\n  }\n  [data-slot=\"select-menu\"][data-variant=\"ghost\"]:disabled {\n    background-color: transparent;\n    box-shadow: none;\n  }\n  [data-slot=\"select-menu\"][data-size=\"sm\"] [data-slot=\"select-menu-code\"] { font-size: 12px; }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"select-menu-content\"] {\n      animation: none;\n    }\n  }\n  [data-slot=\"toolbar\"] [data-toolbar-generic] [data-slot=\"select-menu\"] { height: calc(var(--control-height) - 6px); }\n}\n"},{"path":"ui/switch.css","type":"registry:file","target":"components/ui/switch.css","content":"/* switch.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  /* The native input fills the target; the smaller indicator is decorative. */\n  [data-slot=\"switch-root\"] {\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    width: var(--control-height);\n    height: var(--control-height);\n    vertical-align: middle;\n  }\n\n  [data-slot=\"switch-root\"] {\n    width: 44px;\n  }\n\n  [data-slot=\"switch\"] {\n    position: absolute;\n    inset: 0;\n    width: 100%;\n    height: 100%;\n    margin: 0;\n    appearance: none;\n    border: 0;\n    background: transparent;\n    outline: none;\n    cursor: pointer;\n    touch-action: manipulation;\n  }\n\n  /* Choice marks: one 18px recessed mark for checkbox and radio. Checked\n     marks fill with ink; the check stroke draws itself and the radio dot\n     settles in. The switch thumb stretches while pressed, then settles. */\n  [data-slot=\"switch-track\"] {\n    box-sizing: border-box;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    pointer-events: none;\n    background: var(--field);\n    box-shadow: var(--shadow-field);\n    transition:\n      background-color var(--duration-fast) var(--ease-out),\n      box-shadow var(--duration-fast) var(--ease-out);\n  }\n\n  [data-slot=\"switch\"]:checked + [data-slot=\"switch-track\"] {\n    background: var(--accent);\n    box-shadow: 0 0 0 1px var(--accent), inset 0 1px 0 rgb(255 255 255 / 14%);\n  }\n\n  [data-slot=\"switch-track\"] {\n    justify-content: flex-start;\n    width: 36px;\n    height: 22px;\n    padding: 2px;\n    border-radius: 999px;\n    background: color-mix(in srgb, var(--border-strong) 45%, var(--sunken));\n    box-shadow: inset 0 1px 2px rgb(20 20 28 / 18%);\n  }\n\n  [data-slot=\"switch-thumb\"] {\n    width: 18px;\n    height: 18px;\n    flex-shrink: 0;\n    border-radius: 8px;\n    background: #ffffff;\n    box-shadow: 0 1px 2px rgb(18 18 22 / 30%), 0 0 0 0.5px rgb(18 18 22 / 10%);\n    transform-origin: 9px 50%;\n    transition:\n      transform 260ms var(--ease-settle),\n      background-color var(--duration-fast) var(--ease-out);\n  }\n\n  [data-slot=\"switch\"]:checked\n    + [data-slot=\"switch-track\"]\n    [data-slot=\"switch-thumb\"] {\n    transform: translateX(14px);\n    background: var(--accent-foreground);\n  }\n  [data-slot=\"switch\"]:active:not(:disabled)\n    + [data-slot=\"switch-track\"]\n    [data-slot=\"switch-thumb\"] {\n    transform: scaleX(1.22);\n    transition-duration: 160ms;\n  }\n  [data-slot=\"switch\"]:checked:active:not(:disabled)\n    + [data-slot=\"switch-track\"]\n    [data-slot=\"switch-thumb\"] {\n    transform: translateX(10px) scaleX(1.22);\n  }\n\n  [data-slot=\"switch\"]:dir(ltr) + [data-slot=\"switch-track\"] {\n    direction: ltr;\n  }\n  [data-slot=\"switch\"]:dir(rtl) + [data-slot=\"switch-track\"] {\n    direction: rtl;\n  }\n  [data-slot=\"switch\"]:dir(rtl):checked\n    + [data-slot=\"switch-track\"]\n    [data-slot=\"switch-thumb\"] {\n    transform: translateX(-14px);\n  }\n\n  [data-slot=\"switch\"]:focus-visible + [data-slot=\"switch-track\"] {\n    outline: 2px solid var(--ring);\n    outline-offset: 2px;\n  }\n\n  [data-slot=\"switch\"][aria-invalid=\"true\"] + [data-slot=\"switch-track\"] {\n    box-shadow: var(--shadow-field-invalid);\n    outline-color: var(--destructive);\n  }\n\n  [data-slot=\"switch\"]:disabled {\n    cursor: not-allowed;\n  }\n  [data-slot=\"switch\"]:disabled + [data-slot=\"switch-track\"] {\n    background: var(--sunken);\n    box-shadow: var(--shadow-field-quiet);\n    color: var(--muted-foreground);\n  }\n  [data-slot=\"switch\"]:disabled:checked + [data-slot=\"switch-track\"] {\n    background: var(--border);\n    box-shadow: none;\n  }\n  [data-slot=\"switch\"]:disabled + [data-slot=\"switch-track\"] [data-slot=\"switch-thumb\"] {\n    background: var(--border);\n    box-shadow: none;\n  }\n\n  @media (forced-colors: active) {\n    [data-slot=\"switch-track\"] {\n      forced-color-adjust: none;\n      background: Canvas;\n      border-color: CanvasText;\n    }\n    [data-slot=\"switch\"]:checked + [data-slot=\"switch-track\"] {\n      background: Highlight;\n      border-color: Highlight;\n    }\n    [data-slot=\"switch-track\"] {\n      border: 1px solid CanvasText;\n      box-shadow: none;\n    }\n    [data-slot=\"switch-thumb\"] {\n      background: CanvasText;\n    }\n    [data-slot=\"switch\"]:checked\n      + [data-slot=\"switch-track\"]\n      [data-slot=\"switch-thumb\"] {\n      background: HighlightText;\n    }\n    [data-slot=\"switch\"]:hover:not(:disabled) + [data-slot=\"switch-track\"] {\n      border-color: CanvasText;\n    }\n    [data-slot=\"switch\"]:focus-visible + [data-slot=\"switch-track\"] {\n      outline-color: Highlight;\n    }\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"switch-track\"],\n    [data-slot=\"switch-thumb\"] {\n      transition: none;\n    }\n  }\n}\n"},{"path":"ui/textarea.css","type":"registry:file","target":"components/ui/textarea.css","content":"/* textarea.tsx's styles; it imports this file. Edit freely. */\n@layer theme, base, components, utilities;\n\n@layer components {\n  [data-slot=\"textarea\"] {\n    transition-property: background-color, color, border-color;\n    transition-duration: var(--duration-fast);\n    transition-timing-function: var(--ease-out);\n  }\n\n  /* Recessed to fill. One ring for every field: 3:1 at rest, darker on\n     hover, a 2px ember ring with a soft halo on focus, danger when invalid.\n     Disabled and read-only drop into the sunken fill and stay legible. */\n  [data-slot=\"textarea\"] {\n    border: 0;\n    background-color: var(--field);\n    box-shadow: var(--shadow-field);\n    transition: box-shadow var(--duration-fast) var(--ease-out);\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    [data-slot=\"textarea\"] {\n      transition: none;\n    }\n  }\n}\n"}],"categories":["free-pro-screens"],"meta":{"tier":"free","license":"MIT","family":"calendar-media","docs":"/docs/components/calendar-app"}}