/* ============================================================================
 * ChatTutor — ui/primitives, compiled to plain CSS
 * ----------------------------------------------------------------------------
 * Each rule is a direct transcription of the `cva()` string or `cn()` literal
 * in the matching folder under fe/src/components/ui/primitives/.
 * The source path is noted above each block. Keep them in the same order as
 * the repo so a sync is a straight folder-by-folder diff.
 *
 * Tailwind → CSS conversions used throughout:
 *   text-2xs .6875/1  · text-xs .75/1  · text-sm .875/1.25  · text-base 1/1.5
 *   font-normal 300 (per --font-weight-normal) · font-medium 500 · font-semibold 600
 *   rounded-sm/md/lg/xl → var(--radius-sm/md/lg/xl) · rounded-full 9999px
 *   ring-[3px] → box-shadow 0 0 0 3px · /NN opacity → color-mix(in oklab, …)
 * ========================================================================== */

/* --- shared icon sizing: [&_svg:not([class*='size-'])]:size-4 ------------- */
.ct-btn > svg, .ct-toggle > svg, .ct-item-media > svg, .ct-select-trigger svg,
.ct-dm-item > svg, .ct-input-group-addon > svg, .ct-btn-group-text > svg {
  width: 1rem; height: 1rem; flex-shrink: 0; pointer-events: none;
}

/* ==========================================================================
 * primitives/button — buttonVariants
 * ======================================================================== */

.ct-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; white-space: nowrap; flex-shrink: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm); line-height: var(--text-sm--line-height);
  font-weight: 500;
  transition: all .15s ease;
  border: 1px solid transparent; background: transparent; color: inherit;
  cursor: pointer; outline: none;
}
.ct-btn:disabled { pointer-events: none; opacity: .5; }
.ct-btn:focus-visible {
  border-color: var(--ring);
  box-shadow: inset 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

/* variant */
.ct-btn--brand       { background: var(--color-indigo-600); color: var(--background); }
.dark .ct-btn--brand { color: var(--foreground); }
.ct-btn--brand:hover { background: var(--color-indigo-700); }

.ct-btn--default       { background: var(--primary); color: var(--primary-foreground); }
.ct-btn--default:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }

.ct-btn--destructive       { background: var(--destructive); color: #fff; }
.ct-btn--destructive:hover { background: color-mix(in oklab, var(--destructive) 90%, transparent); }
.dark .ct-btn--destructive { background: color-mix(in oklab, var(--destructive) 60%, transparent); }

.ct-btn--outline       { border-color: var(--border); background: var(--background); box-shadow: var(--shadow-xs); }
.ct-btn--outline:hover { background: var(--accent); color: var(--accent-foreground); }
.dark .ct-btn--outline       { background: color-mix(in oklab, var(--input) 30%, transparent); border-color: var(--input); }
.dark .ct-btn--outline:hover { background: color-mix(in oklab, var(--input) 50%, transparent); }

.ct-btn--secondary       { background: var(--secondary); color: var(--secondary-foreground); }
.ct-btn--secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }

.ct-btn--ghost:hover       { background: var(--accent); color: var(--accent-foreground); }
.dark .ct-btn--ghost:hover { background: color-mix(in oklab, var(--accent) 50%, transparent); }

.ct-btn--link { color: var(--primary); text-underline-offset: 4px; }
.ct-btn--link:hover { text-decoration: underline; }

/* size */
.ct-btn--size-default { height: 2.25rem; padding: .5rem 1rem; }
.ct-btn--size-default:has(> svg) { padding-inline: .75rem; }
.ct-btn--size-xs { height: 1.5rem; padding-inline: .5rem; font-size: var(--text-xs); gap: .25rem; }
.ct-btn--size-xs:has(> svg) { padding-inline: .375rem; }
.ct-btn--size-sm { height: 2rem; gap: .375rem; padding-inline: .75rem; }
.ct-btn--size-sm:has(> svg) { padding-inline: .625rem; }
.ct-btn--size-lg { height: 2.5rem; padding-inline: 1.5rem; }
.ct-btn--size-lg:has(> svg) { padding-inline: 1rem; }
.ct-btn--size-icon    { width: 2.25rem; height: 2.25rem; padding: 0; }
.ct-btn--size-icon-sm { width: 2rem; height: 2rem; padding: 0; }
.ct-btn--size-icon-xs { width: 1.5rem; height: 1.5rem; padding: 0; border-radius: var(--radius-sm); }
.ct-btn--size-icon-lg { width: 2.5rem; height: 2.5rem; padding: 0; }

/* ==========================================================================
 * primitives/badge — badgeVariants
 * ======================================================================== */

.ct-badge {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; border: 1px solid transparent;
  font-weight: 500; width: fit-content; white-space: nowrap; flex-shrink: 0;
  overflow: hidden; transition: color .15s, box-shadow .15s;
}
.ct-badge > svg { width: .75rem; height: .75rem; pointer-events: none; }

.ct-badge--default     { background: var(--primary); color: var(--primary-foreground); }
.ct-badge--brand       { background: var(--color-indigo-600); color: var(--background); }
.dark .ct-badge--brand { color: var(--foreground); }
.ct-badge--secondary   { background: var(--secondary); color: var(--secondary-foreground); }
.ct-badge--destructive { background: var(--destructive); color: #fff; }
.dark .ct-badge--destructive { background: color-mix(in oklab, var(--destructive) 60%, transparent); }
.ct-badge--outline     { color: var(--foreground); border-color: var(--border); background: transparent; }

.ct-badge--size-default { padding: .125rem .5rem; font-size: var(--text-xs); line-height: 1rem; gap: .25rem; }
.ct-badge--size-sm      { padding: 0 .5rem; font-size: var(--text-xs); line-height: 1rem; gap: .125rem; }
.ct-badge--size-sm > svg { width: .625rem; height: .625rem; }

/* ==========================================================================
 * primitives/alert — alertVariants
 * ======================================================================== */

.ct-alert {
  position: relative; width: 100%;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: .5rem; font-size: var(--text-sm); line-height: var(--text-sm--line-height);
  display: grid; grid-template-columns: 0 1fr;
  row-gap: .125rem; align-items: start;
}
.ct-alert:has(> svg) { grid-template-columns: calc(var(--spacing) * 4) 1fr; column-gap: .75rem; }
.ct-alert > svg { width: 1rem; height: 1rem; transform: translateY(.125rem); color: currentColor; }

.ct-alert--default     { background: var(--card); color: var(--card-foreground); }
.ct-alert--destructive { background: var(--card); color: var(--destructive); }
.ct-alert--destructive .ct-alert-description { color: color-mix(in oklab, var(--destructive) 90%, transparent); }
.ct-alert--warning     { color: var(--yellow-800); background: var(--yellow-50); border-color: var(--yellow-200); }
.dark .ct-alert--warning { color: var(--yellow-300); background: color-mix(in oklab, var(--yellow-300) 10%, transparent); border-color: color-mix(in oklab, #fff 10%, transparent); }

.ct-alert-title       { grid-column-start: 2; min-height: 1rem; font-weight: 500; letter-spacing: -.01em;
                        display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ct-alert-description { grid-column-start: 2; color: var(--muted-foreground);
                        display: grid; justify-items: start; gap: .25rem;
                        font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.ct-alert-action      { grid-column-start: 2; }

/* ==========================================================================
 * primitives/card
 * ======================================================================== */

.ct-card { border-radius: var(--radius-xl); border: 1px solid var(--border);
           background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-sm); }
.ct-card-header  { display: flex; flex-direction: column; row-gap: .375rem; padding: 1.5rem; }
.ct-card-title   { font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.ct-card-description { font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--muted-foreground); }
.ct-card-content { padding: 1.5rem; }
.ct-card-footer  { display: flex; align-items: center; padding: 1.5rem; padding-top: 0; }

/* ==========================================================================
 * primitives/input · primitives/textarea
 * ======================================================================== */

.ct-input {
  height: 2.25rem; width: 100%; min-width: 0;
  border-radius: var(--radius-md); border: 1px solid var(--input);
  background: transparent; padding: .25rem .75rem;
  font-family: var(--font-sans); font-size: var(--text-sm);
  color: var(--foreground); box-shadow: var(--shadow-xs);
  transition: color .15s, box-shadow .15s; outline: none;
}
.dark .ct-input { background: color-mix(in oklab, var(--input) 30%, transparent); }
.ct-input::placeholder { color: var(--muted-foreground); }
.ct-input:focus-visible { border-color: var(--border-focus); }
.ct-input:disabled { pointer-events: none; cursor: not-allowed; opacity: .5; }
.ct-input[aria-invalid="true"] { border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent); }

.ct-textarea {
  display: flex; min-height: 4rem; width: 100%;
  border-radius: var(--radius-md); border: 1px solid var(--input);
  background: transparent; padding: .5rem .75rem;
  font-family: var(--font-sans); font-size: var(--text-sm);
  color: var(--foreground); box-shadow: var(--shadow-xs);
  transition: color .15s, box-shadow .15s; outline: none; resize: vertical;
}
.dark .ct-textarea { background: color-mix(in oklab, var(--input) 30%, transparent); }
.ct-textarea::placeholder { color: var(--muted-foreground); }
.ct-textarea:focus-visible { border-color: var(--border-focus); }
.ct-textarea:disabled { cursor: not-allowed; opacity: .5; }

/* ==========================================================================
 * primitives/input-group — inputGroupAddonVariants / inputGroupButtonVariants
 * ======================================================================== */

.ct-input-group {
  display: flex; align-items: center; width: 100%;
  border-radius: var(--radius-md); border: 1px solid var(--input);
  background: transparent; box-shadow: var(--shadow-xs);
  transition: color .15s, box-shadow .15s;
}
.ct-input-group:focus-within { border-color: var(--border-focus); }
.ct-input-group > .ct-input,
.ct-input-group > .ct-textarea { border: 0; box-shadow: none; background: transparent; flex: 1; }
.ct-input-group > .ct-input:focus-visible { border: 0; }

.ct-input-group-addon {
  color: var(--muted-foreground); display: flex; height: auto; cursor: text;
  align-items: center; justify-content: center; gap: .5rem; padding-block: .375rem;
  font-size: var(--text-sm); font-weight: 500; user-select: none;
}
.ct-input-group-addon--inline-start { order: -1; padding-left: .75rem; }
.ct-input-group-addon--inline-end   { order: 99; padding-right: .75rem; }
.ct-input-group-addon--block-start  { order: -1; width: 100%; justify-content: flex-start; padding: .75rem .75rem 0; }
.ct-input-group-addon--block-end    { order: 99; width: 100%; justify-content: flex-start; padding: 0 .75rem .75rem; }

.ct-input-group-text { color: var(--muted-foreground); font-size: var(--text-sm); }

.ct-input-group-btn { font-size: var(--text-sm); box-shadow: none; display: flex; gap: .5rem; align-items: center; }
.ct-input-group-btn--xs      { height: 1.5rem; gap: .25rem; padding-inline: .5rem; border-radius: calc(var(--radius) - 5px); }
.ct-input-group-btn--xs > svg { width: .875rem; height: .875rem; }
.ct-input-group-btn--sm      { height: 2rem; padding-inline: .625rem; gap: .375rem; border-radius: var(--radius-md); }
.ct-input-group-btn--icon-xs { width: 1.5rem; height: 1.5rem; padding: 0; border-radius: calc(var(--radius) - 5px); }
.ct-input-group-btn--icon-sm { width: 2rem; height: 2rem; padding: 0; }

/* ==========================================================================
 * primitives/toggle — toggleVariants
 * ======================================================================== */

.ct-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 500;
  white-space: nowrap; border: 1px solid transparent; background: transparent;
  color: inherit; cursor: pointer; outline: none;
  transition: color .15s, box-shadow .15s, background-color .15s;
}
.ct-toggle:hover { background: var(--muted); color: var(--muted-foreground); }
.ct-toggle:disabled { pointer-events: none; opacity: .5; }
.ct-toggle[data-state="on"] { background: var(--accent); color: var(--accent-foreground); }
.ct-toggle:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ct-toggle--outline { border-color: var(--input); box-shadow: var(--shadow-xs); }
.ct-toggle--outline:hover { background: var(--accent); color: var(--accent-foreground); }
.ct-toggle--size-default { height: 2.25rem; padding-inline: .5rem; min-width: 2.25rem; }
.ct-toggle--size-xs { height: 1.5rem; padding-inline: .375rem; min-width: 1.5rem; font-size: var(--text-xs); }
.ct-toggle--size-sm { height: 2rem; padding-inline: .375rem; min-width: 2rem; }
.ct-toggle--size-lg { height: 2.5rem; padding-inline: .625rem; min-width: 2.5rem; }

/* ==========================================================================
 * primitives/button-group — buttonGroupVariants
 * ======================================================================== */

.ct-btn-group { display: flex; width: fit-content; align-items: stretch; }
.ct-btn-group--horizontal > *:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; }
.ct-btn-group--horizontal > *:not(:last-child)  { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ct-btn-group--vertical { flex-direction: column; }
.ct-btn-group--vertical > *:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; border-top-width: 0; }
.ct-btn-group--vertical > *:not(:last-child)  { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ct-btn-group-text { background: var(--muted); display: flex; align-items: center; gap: .5rem;
                     border-radius: var(--radius-md); border: 1px solid var(--border);
                     padding-inline: 1rem; font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-xs); }
.ct-btn-group-separator { background: var(--border); width: 1px; align-self: stretch; }

/* ==========================================================================
 * primitives/select — selectTriggerVariants
 * ======================================================================== */

.ct-select-trigger {
  display: flex; width: fit-content; align-items: center; justify-content: space-between;
  gap: .5rem; border-radius: var(--radius-md); border: 1px solid var(--input);
  background: transparent; padding: .5rem .75rem;
  font-size: var(--text-sm); white-space: nowrap; box-shadow: var(--shadow-xs);
  transition: color .15s, box-shadow .15s, background-color .15s;
  outline: none; cursor: pointer; color: var(--foreground);
}
.ct-select-trigger:hover { background: var(--accent); }
.dark .ct-select-trigger { background: color-mix(in oklab, var(--input) 30%, transparent); }
.dark .ct-select-trigger:hover { background: color-mix(in oklab, var(--input) 50%, transparent); }
.ct-select-trigger:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ct-select-trigger:disabled { cursor: not-allowed; opacity: .5; }
.ct-select-trigger[data-placeholder] { color: var(--muted-foreground); }
.ct-select-trigger svg:not([class*="text-"]) { color: var(--muted-foreground); }
.ct-select-trigger--default { height: 2.25rem; }
.ct-select-trigger--sm { height: 2rem; }
.ct-select-trigger--xs { height: 1.5rem; padding-inline: .375rem; font-size: var(--text-xs); gap: .375rem; }

.ct-select-content { background: var(--popover); color: var(--popover-foreground);
                     z-index: 50; min-width: 8rem; overflow: hidden;
                     border-radius: var(--radius-md); border: 1px solid var(--border);
                     padding: .25rem; box-shadow: var(--shadow-md); }
.ct-select-item { position: relative; display: flex; width: 100%; cursor: default;
                  align-items: center; gap: .5rem; border-radius: var(--radius-sm);
                  padding: .375rem .5rem; font-size: var(--text-sm); outline: none; user-select: none; }
.ct-select-item:hover, .ct-select-item[data-highlighted] { background: var(--accent); color: var(--accent-foreground); }
.ct-select-label { color: var(--muted-foreground); padding: .375rem .5rem; font-size: var(--text-xs); }
.ct-select-separator { background: var(--border); pointer-events: none; margin: .25rem -.25rem; height: 1px; }

/* ==========================================================================
 * primitives/checkbox · primitives/switch
 * ======================================================================== */

.ct-checkbox {
  width: 1rem; height: 1rem; flex-shrink: 0;
  border-radius: 4px; border: 1px solid var(--input);
  background: transparent; box-shadow: var(--shadow-xs);
  transition: box-shadow .15s; outline: none; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--primary-foreground);
}
.ct-checkbox[data-state="checked"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.ct-checkbox:focus-visible { border-color: var(--ring); box-shadow: inset 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ct-checkbox:disabled { cursor: not-allowed; opacity: .5; }
.ct-checkbox > svg { width: .75rem; height: .75rem; }

.ct-switch { display: inline-flex; align-items: center; width: 2rem; height: 1.15rem;
             flex-shrink: 0; border-radius: 9999px; border: 1px solid transparent;
             background: var(--input); transition: background-color .15s; cursor: pointer; outline: none; padding: 0; }
.ct-switch[data-state="checked"] { background: var(--primary); }
.ct-switch:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ct-switch__thumb { display: block; width: 1rem; height: 1rem; border-radius: 9999px;
                    background: var(--background); box-shadow: var(--shadow-sm);
                    transition: transform .15s; transform: translateX(0); }
.ct-switch[data-state="checked"] .ct-switch__thumb { transform: translateX(calc(100% - 2px)); }

/* ==========================================================================
 * primitives/label · separator · skeleton · spinner
 * ======================================================================== */

.ct-label { display: flex; align-items: center; gap: .5rem;
            font-size: var(--text-sm); line-height: 1; font-weight: 500;
            user-select: none; color: var(--foreground); }
.ct-separator { background: var(--border); flex-shrink: 0; }
.ct-separator--horizontal { height: 1px; width: 100%; }
.ct-separator--vertical   { width: 1px; align-self: stretch; }
.ct-skeleton { animation: ct-pulse 2s cubic-bezier(.4,0,.6,1) infinite;
               border-radius: var(--radius-md); background: var(--muted); }
@keyframes ct-pulse { 0%,100% { opacity: 1 } 50% { opacity: .5 } }
.ct-spinner { width: 1rem; height: 1rem; animation: ct-spin 1s linear infinite; }
@keyframes ct-spin { to { transform: rotate(360deg) } }

/* ==========================================================================
 * primitives/item — itemVariants / itemMediaVariants
 * ======================================================================== */

.ct-item {
  display: flex; align-items: center; border: 1px solid transparent;
  font-size: var(--text-sm); border-radius: var(--radius-md);
  transition: background-color .1s; flex-wrap: wrap; outline: none;
}
a.ct-item:hover { background: color-mix(in oklab, var(--accent) 50%, transparent); }
.ct-item:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent); }
.ct-item--default { background: transparent; }
.ct-item--outline { border-color: var(--border); }
.ct-item--muted   { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.ct-item--size-default { padding: 1rem; gap: 1rem; }
.ct-item--size-sm { padding: .75rem 1rem; gap: .625rem; }
.ct-item--size-xs { padding: .5rem .75rem; gap: .5rem; }

.ct-item-media { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: .5rem; }
.ct-item-media--icon  { width: 2rem; height: 2rem; border: 1px solid var(--border);
                        border-radius: var(--radius-sm); background: var(--muted); }
.ct-item-media--image { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); overflow: hidden; }
.ct-item-media--image img { width: 100%; height: 100%; object-fit: cover; }
.ct-item-content { display: flex; flex: 1; flex-direction: column; gap: .25rem; min-width: 0; }
.ct-item-title { display: flex; width: fit-content; align-items: center; gap: .5rem;
                 font-size: var(--text-sm); line-height: 1.375; font-weight: 500; }
.ct-item-description { color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.4; }
.ct-item-actions { display: flex; align-items: center; gap: .5rem; }
.ct-item-header, .ct-item-footer { display: flex; flex-basis: 100%; align-items: center; justify-content: space-between; gap: .5rem; }
.ct-item-group { display: flex; flex-direction: column; }
.ct-item-separator { margin: 0; background: var(--border); height: 1px; }

/* ==========================================================================
 * primitives/field — fieldVariants
 * ======================================================================== */

.ct-field { display: flex; width: 100%; gap: .75rem; }
.ct-field[data-invalid="true"] { color: var(--destructive); }
.ct-field--vertical { flex-direction: column; }
.ct-field--vertical > * { width: 100%; }
.ct-field--horizontal { flex-direction: row; align-items: center; }
.ct-field-group { display: flex; flex-direction: column; gap: 1.75rem; width: 100%; }
.ct-field-label { display: flex; width: fit-content; gap: .5rem;
                  font-size: var(--text-sm); line-height: 1; font-weight: 500; }
.ct-field-title { display: flex; width: fit-content; align-items: center; gap: .5rem;
                  font-size: var(--text-sm); line-height: 1; font-weight: 500; }
.ct-field-description { color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.4; font-weight: 300; }
.ct-field-error { color: var(--destructive); font-size: var(--text-sm); font-weight: 300; }
.ct-field-content { display: flex; flex: 1; flex-direction: column; gap: .375rem; }
.ct-field-legend { margin-bottom: .75rem; font-weight: 500; }
.ct-field-separator { height: 1px; background: var(--border); margin-block: .5rem; }

/* ==========================================================================
 * primitives/empty — emptyMediaVariants
 * ======================================================================== */

.ct-empty { display: flex; min-width: 0; flex: 1; flex-direction: column;
            align-items: center; justify-content: center; gap: 1.5rem;
            border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; }
.ct-empty-header { display: flex; max-width: 24rem; flex-direction: column;
                   align-items: center; gap: .5rem; text-align: center; }
.ct-empty-media { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: .5rem; }
.ct-empty-media--icon { background: var(--muted); color: var(--foreground);
                        width: 2.5rem; height: 2.5rem; border-radius: var(--radius-lg); }
.ct-empty-media--icon > svg { width: 1.5rem; height: 1.5rem; }
.ct-empty-title { font-size: var(--text-base); font-weight: 300; letter-spacing: -.01em; }
.ct-empty-description { color: var(--muted-foreground); font-size: var(--text-sm); line-height: 1.5; }
.ct-empty-content { display: flex; width: 100%; max-width: 24rem; min-width: 0;
                    flex-direction: column; align-items: center; gap: .5rem; font-size: var(--text-sm); }

/* ==========================================================================
 * primitives/dialog · primitives/sheet · primitives/popover
 * ======================================================================== */

.ct-dialog-overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .70); }
.ct-dialog-content { background: var(--background); position: fixed; z-index: 50;
                     top: 50%; left: 50%; transform: translate(-50%, -50%);
                     display: flex; flex-direction: column; gap: 1rem;
                     width: 100%; max-width: 32rem; padding: 1.5rem;
                     border: 1px solid var(--border); border-radius: var(--radius-lg);
                     box-shadow: var(--shadow-lg); }
.ct-dialog-header { display: flex; flex-direction: column; gap: .5rem; text-align: left; }
.ct-dialog-title  { font-size: var(--text-lg); line-height: 1; font-weight: 600; }
.ct-dialog-description { color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.ct-dialog-footer { display: flex; gap: .5rem; justify-content: flex-end; }

.ct-sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .80); }
.ct-sheet-content { background: var(--background); position: fixed; z-index: 50;
                    display: flex; flex-direction: column; gap: 1rem;
                    box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.ct-sheet-header { display: flex; flex-direction: column; gap: .375rem; padding: 1rem; }
.ct-sheet-title  { color: var(--foreground); font-weight: 600; }
.ct-sheet-description { color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
.ct-sheet-footer { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding: 1rem; }

.ct-popover-content { background: var(--popover); color: var(--popover-foreground);
                      z-index: 50; width: 18rem; border-radius: var(--radius-md);
                      border: 1px solid var(--border); padding: 1rem;
                      box-shadow: var(--shadow-md); outline: none; }

/* ==========================================================================
 * primitives/dropdown-menu
 * ======================================================================== */

.ct-dm-content { background: var(--popover); color: var(--popover-foreground);
                 z-index: 50; min-width: 8rem; overflow: hidden auto;
                 border-radius: var(--radius-md); border: 1px solid var(--border);
                 padding: .25rem; box-shadow: var(--shadow-md); }
.ct-dm-item { position: relative; display: flex; cursor: default; align-items: center;
              gap: .5rem; border-radius: var(--radius-sm); padding: .375rem .5rem;
              font-size: var(--text-sm); outline: none; user-select: none; }
.ct-dm-item:hover, .ct-dm-item[data-highlighted] { background: var(--accent); color: var(--accent-foreground); }
.ct-dm-item > svg:not([class*="text-"]) { color: var(--muted-foreground); }
.ct-dm-item[data-variant="destructive"] { color: var(--destructive); }
.ct-dm-item[data-variant="destructive"]:hover { background: color-mix(in oklab, var(--destructive) 10%, transparent); }
.ct-dm-item[data-disabled] { pointer-events: none; opacity: .5; }
.ct-dm-label { padding: .375rem .5rem; font-size: var(--text-sm); font-weight: 500; }
.ct-dm-separator { background: var(--border); margin: .25rem -.25rem; height: 1px; }
.ct-dm-shortcut { color: var(--muted-foreground); margin-left: auto; font-size: var(--text-xs); letter-spacing: .1em; }

/* ==========================================================================
 * primitives/tabs — TabsTrigger size variants
 * ======================================================================== */

.ct-tabs { display: flex; flex-direction: column; gap: .5rem; }
.ct-tabs-list { display: inline-flex; align-items: center; gap: .25rem;
                border-bottom: 1px solid var(--border); width: 100%; }
.ct-tabs-trigger { display: inline-flex; align-items: center; justify-content: center;
                   white-space: nowrap; border: 0; background: transparent;
                   color: var(--muted-foreground); font-weight: 500; cursor: pointer;
                   border-bottom: 2px solid transparent; margin-bottom: -1px;
                   transition: color .15s, border-color .15s; outline: none; }
.ct-tabs-trigger:hover { color: var(--foreground); }
.ct-tabs-trigger[data-state="active"] { color: var(--foreground); border-bottom-color: var(--foreground); }
.ct-tabs-trigger--xs { padding: .125rem .5rem; font-size: var(--text-xs); gap: .25rem; }
.ct-tabs-trigger--xs > svg { width: .75rem; height: .75rem; }
.ct-tabs-trigger--sm { padding: .25rem .5rem; font-size: var(--text-sm); gap: .375rem; }
.ct-tabs-trigger--sm > svg { width: 1rem; height: 1rem; }
.ct-tabs-trigger--default { padding: .375rem .75rem; font-size: var(--text-base); gap: .5rem; }
.ct-tabs-trigger--default > svg { width: 1.25rem; height: 1.25rem; }
.ct-tabs-content { flex: 1; outline: none; }

/* ==========================================================================
 * primitives/avatar
 * ======================================================================== */

.ct-avatar { position: relative; display: flex; flex-shrink: 0;
             overflow: hidden; border-radius: 9999px;
             width: 2rem; height: 2rem; user-select: none; }
.ct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ct-avatar-fallback { background: var(--muted); display: flex; width: 100%; height: 100%;
                      align-items: center; justify-content: center; border-radius: 9999px;
                      font-size: var(--text-xs); font-weight: 500; color: var(--foreground); }
.ct-avatar-group { display: flex; }
.ct-avatar-group > * + * { margin-left: -.5rem; }
.ct-avatar-group-count { background: var(--muted); display: flex; align-items: center;
                         justify-content: center; border-radius: 9999px;
                         font-size: var(--text-xs); font-weight: 500;
                         width: 2rem; height: 2rem; box-shadow: 0 0 0 2px var(--background); }

/* ==========================================================================
 * primitives/section-header · page-section · left-right-layout
 * ======================================================================== */

.ct-section-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ct-section-header__title { display: flex; align-items: center; gap: .5rem; color: var(--muted-foreground); }
.ct-page-section { display: flex; flex-direction: column; gap: 1rem; }
.ct-left-right { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }

/* ==========================================================================
 * primitives/filter-chip
 * ======================================================================== */

.ct-filter-chip { display: inline-flex; align-items: center; border-radius: var(--radius-md);
                  border: 1px solid var(--input); background: transparent;
                  font-size: var(--text-sm); box-shadow: var(--shadow-xs);
                  cursor: pointer; overflow: hidden; color: var(--foreground); }
.ct-filter-chip:hover { background: var(--accent); }
.ct-filter-chip--active { border-color: var(--border-focus); }
.ct-filter-chip__body { display: flex; align-items: center; gap: .375rem; }
.ct-filter-chip__body > svg { width: 1rem; height: 1rem; }
.ct-filter-chip__clear { align-self: stretch; display: flex; align-items: center;
                         cursor: pointer; transition: opacity .15s; color: var(--muted-foreground); }
.ct-filter-chip__clear:hover { opacity: .7; }
.ct-filter-chip--default { height: 2.25rem; }
.ct-filter-chip--default .ct-filter-chip__body { padding-inline: .5rem; }
.ct-filter-chip--default .ct-filter-chip__clear { padding-right: .5rem; }
.ct-filter-chip--sm { height: 2rem; }
.ct-filter-chip--sm .ct-filter-chip__body { padding-inline: .375rem; }
.ct-filter-chip--sm .ct-filter-chip__clear { padding-right: .375rem; }

/* ==========================================================================
 * primitives/scroll-area
 * ======================================================================== */

.ct-scroll-area { position: relative; overflow: hidden; }
.ct-scroll-area__viewport { width: 100%; height: 100%; overflow: auto; }

/* ==========================================================================
 * primitives/calendar
 * ======================================================================== */

.ct-calendar { padding: .75rem; }
.ct-calendar__header { position: relative; display: flex; width: 100%;
                       align-items: center; justify-content: space-between; padding-top: .25rem; }
.ct-calendar__heading { font-size: var(--text-sm); font-weight: 500; }
.ct-calendar__grid { width: 100%; border-collapse: collapse; }
.ct-calendar__row { display: flex; }
.ct-calendar__head-cell { width: 2rem; border-radius: var(--radius-md);
                          font-size: .8rem; font-weight: 300; color: var(--muted-foreground); }
.ct-calendar__cell { position: relative; padding: 0; text-align: center; font-size: var(--text-sm); }
.ct-calendar__cell-trigger { width: 2rem; height: 2rem; border: 0; background: transparent;
                             border-radius: var(--radius-md); font-size: var(--text-sm);
                             font-weight: 300; cursor: pointer; color: var(--foreground); }
.ct-calendar__cell-trigger:hover { background: var(--accent); }
.ct-calendar__cell-trigger[data-selected] { background: var(--primary); color: var(--primary-foreground); }
.ct-calendar__cell-trigger[data-outside-view] { color: var(--muted-foreground); opacity: .5; }
