/* =============================================================================
   Clipper Kit — shared component CSS
   -----------------------------------------------------------------------------
   SINGLE SOURCE OF TRUTH for the components below. Every flow links this file;
   clipper-molecules-v2.html links it too, so the Kit sheet and the flows render
   from the same rules. Edit here and the change lands everywhere on next load —
   that is the whole point of the file.

   Requires design-system.css (tokens) to be linked first.

   Clipper nomenclature (--background/--foreground/--muted-foreground/--font-sans/--input) is
   used by these rules. Pages that link design-system.css alone need the alias
   layer at the bottom of this file; it is inert when a page already defines the
   Clipper names in its own :root.

   Contents
     1. Header bar organism  — .header-bar / .header-left / .header-right
     2. Header icon button   — .icon-btn (+ notification badge, info tooltip)
     3. Avatar               — .avatar
     4. Breadcrumb trail     — .breadcrumbs / .breadcrumb-item / .breadcrumb-sep
   ============================================================================= */

/* The legacy-name alias layer that used to sit here is gone. Every rule in
   this file, and every page that links it, speaks the shadcn dialect
   directly, so the indirection has no callers. */

/* ─── HEADER BAR (Organism) ─── */
/* 56px, down from 64px. The height was set by the 48px icon frames inside it,
   not by anything the bar itself needed: a 48px frame around a 16px glyph is
   16px of padding a side, which made the bar a third taller than the content
   asked for. The frames are now 40px — still well clear of the 24px target
   floor, and on the 4px grid — so the bar closes to 56px with the same 8px of
   breathing room above and below its controls. */
/* THE BAR HAS NO BACKGROUND, IN ANY MODE. It is transparent, so whatever the
   page is standing on runs behind it — the canvas in a shell, a panel in a
   drawer or dialog header. A --background fill made the bar a white band laid
   ON the page, which is wrong twice: it read as a floating object rather than
   the page's own top edge, and on --canvas it drew a hard seam the first row
   of panels then had to meet with no gap.

   Its bottom rule is what separates it. That is the whole chrome. */
/* THE BAR HAS NO CHROME AT ALL — no background and no border. It is a
   transparent strip that positions its contents; whatever the page stands on
   runs straight through it, and nothing draws a line under it. What separates
   it from the content below is the content's own top edge: in a shell, the
   first row of panels, which is exactly why those meet the header with a 0
   gap. A rule here would double up with that edge and read as a seam.

   SIDE GUTTERS ARE A FIXED 16px, always. Not 8, and not scaled by size — it
   is the same 16 the canvas puts either side of its panels, so the header's
   content lines up with the panel edges directly beneath it. At 8px the
   breadcrumb sat half a gutter inboard of the panels and the whole page read
   as slightly out of register. Vertical padding stays 0: the bar's height is
   its own, set above. */
.header-bar{display:flex;align-items:center;justify-content:space-between;height:48px;padding:0 var(--space-base);background:transparent;border-bottom:0}
/* ── Plain header — .header-bar.is-plain ──
   A title and the trailing controls, no breadcrumb trail. For a page that IS
   the destination: a dashboard, a settings root, a single-level view. Reach
   for the trail only when a user can be somewhere three levels deep and needs
   to know where; on a flat page it is chrome that says nothing.
   Shorter again at 48px, because a single line of title needs no more. */
/* Both variants are 48px now; .is-plain differs only in its title size and
   its icon frames. */
.header-bar.is-plain .header-title{font-size:var(--text-xl)}
/* Leading run — panel toggle, trail, info — on the shared 8px token.
   .header-right keeps its own spacing and is untouched. */
.header-left{display:flex;align-items:center;gap:var(--header-control-gap,8px);flex:1;min-width:0}
/* The trail wraps by default; inside a fixed-height bar it must not. */
.header-left .breadcrumbs{flex-wrap:nowrap;overflow:hidden}
.header-title{font:var(--font-weight-semibold) var(--text-2xl) var(--font-sans);color:var(--foreground);white-space:nowrap}
.header-right{display:flex;align-items:center;gap:0}
/* 40px, down from 48px — see .header-bar. It is what set the bar's height. */
.icon-btn{width:40px;height:40px;border-radius:var(--radius-md);display:grid;place-items:center;background:0;border:0;cursor:pointer;color:var(--muted-foreground);transition:background var(--duration-base);position:relative}
.header-bar.is-plain .icon-btn{width:36px;height:36px}
.icon-btn:hover{background:var(--hover-bg)}
.icon-btn .ico{width:16px;height:16px}
/* Flows predating the .ico helper put a bare <svg> in the button. Both markup
   styles are supported so linking this file is a no-op visually; the two sizes
   are a divergence to reconcile, not a new one being introduced. */
.icon-btn>svg{width:20px;height:20px}
.icon-btn .notif-badge{position:absolute;top:2px;right:2px;min-width:20px;height:20px;padding:0 4px;border-radius:var(--radius-full);background:var(--primary);color:var(--primary-foreground);font:var(--font-weight-medium) var(--text-3xs) var(--font-sans);display:flex;align-items:center;justify-content:center}
/* Tooltip below (header info icon) */
.hb-tooltip{position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);padding:8px 12px;border-radius:var(--radius-2xl);background:var(--foreground);color:var(--background);font:var(--font-weight-normal) var(--text-md)/1.5 var(--font-sans);white-space:normal;width:max-content;max-width:280px;opacity:0;pointer-events:none;transition:opacity var(--duration-base);z-index:var(--z-dropdown)/* no box-shadow, ever: a tooltip is a label, not a surface */}
.hb-tooltip::after{content:'';position:absolute;top:-4px;left:50%;transform:translateX(-50%) rotate(45deg);width:8px;height:8px;background:var(--foreground)}
.hb-info-btn:hover .hb-tooltip{opacity:1}
.avatar{width:32px;height:32px;border-radius:var(--radius-full);background:var(--primary);display:grid;place-items:center;color:var(--primary-foreground);font:var(--font-weight-semibold) var(--text-base) var(--font-sans)}

/* ─── BREADCRUMBS ───────────────────────────────────────────────────────────
   A standalone component as of v3.2. It had lived only inside the header bar,
   on unprefixed classes, which § 12.4 counts as flow CSS leaking into the kit.
   .ck-breadcrumb* are now the canonical names; the unprefixed ones stay as
   aliases because pages use them, the same arrangement as .switch/.ck-switch.

   The trail is 16px MEDIUM and the current crumb steps up to 18px SEMIBOLD,
   keyed to aria-current="page" so the drawing cannot drift from what is
   announced. Two axes separate them, weight and size — the inactive crumbs
   were semibold too, which left only 2px of size between "where you are" and
   "where you came from", and at a glance the trail read as five titles.

   Spec: references/components/breadcrumb.md */
.ck-breadcrumbs,.breadcrumbs{
  display:flex;align-items:center;gap:var(--breadcrumb-gap,4px);
  font:var(--font-weight-medium) var(--breadcrumb-size,16px) var(--font-sans);
  flex-wrap:wrap}
/* Compact trail, for a breadcrumb inside a dialog, drawer or panel header,
   where the page-level 16/18px would out-shout the panel's own title. */
.ck-breadcrumbs.size-sm{--breadcrumb-size:var(--text-base)}
.ck-breadcrumbs.size-sm .ck-breadcrumb-item[aria-current="page"],
.ck-breadcrumbs.size-sm .ck-breadcrumb-item.current{font-size:var(--text-lg)}

/* A CRUMB NEVER WRAPS. It is one name, and a name broken across two lines
   stops looking like a step in a path — it also makes the crumb taller than
   the bar holding it, which is how a 48px header ends up with 52px of
   breadcrumb inside it. The trail already truncates as a whole
   (.header-left .breadcrumbs is nowrap + overflow:hidden); this is the same
   rule one level down, where the text actually breaks. */
.ck-breadcrumb-item,.breadcrumb-item{
  display:inline-flex;align-items:center;gap:var(--space-xs);
  color:var(--muted-foreground);text-decoration:none;
  padding:4px 6px;border-radius:var(--radius-sm);cursor:pointer;
  white-space:nowrap;min-width:0;
  transition:color var(--duration-fast),background var(--duration-fast)}
.ck-breadcrumb-item:is(:hover,[data-force~="hover"]),.breadcrumb-item:is(:hover,[data-force~="hover"]){
  color:var(--foreground);background:var(--hover-bg)}
.ck-breadcrumb-item:is(:active,[data-force~="active"]),.breadcrumb-item:is(:active,[data-force~="active"]){background:var(--selected-bg)}
/* A crumb is interactive, so it owes a focus ring. It had none — the browser
   default does not follow the theme, and § 9 makes that a Sev-1. */
.ck-breadcrumb-item:is(:focus-visible,[data-force~="focus"]),.breadcrumb-item:is(:focus-visible,[data-force~="focus"]){
  outline:0;box-shadow:var(--focus-ring)}
/* Active crumb steps up in size AND weight: 18px semibold against the trail's
   16px medium. .current stays as a transitional alias. */
.ck-breadcrumb-item[aria-current="page"],.ck-breadcrumb-item.current,
.breadcrumb-item[aria-current="page"],.breadcrumb-item.current{
  color:var(--foreground);font-size:var(--text-2xl);
  font-weight:var(--font-weight-semibold);cursor:default}
.ck-breadcrumb-item[aria-current="page"]:hover,.ck-breadcrumb-item.current:hover,
.breadcrumb-item[aria-current="page"]:hover,.breadcrumb-item.current:hover{
  background:transparent}
.ck-breadcrumb-item svg,.breadcrumb-item svg{
  width:var(--icon-size);height:var(--icon-size);flex:none;display:block}

/* The separator reads the trail's own size token, so changing one size moves
   the chevrons with the text instead of leaving them behind. */
.ck-breadcrumb-sep,.breadcrumb-sep{
  color:var(--muted-foreground);font-size:var(--breadcrumb-size,16px);
  flex:none;user-select:none}
.ck-breadcrumb-sep svg,.breadcrumb-sep svg{
  width:1em;height:1em;display:block}

/* Collapsed middle. A trail deeper than about four levels stops being
   scannable, so the middle collapses behind one control that reveals the rest.
   It is a real <button> with an aria-label, not an inert ellipsis. */
.ck-breadcrumb-more{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:24px;height:24px;padding:0 var(--space-xs);
  border:0;border-radius:var(--radius-sm);background:0;cursor:pointer;
  color:var(--muted-foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  transition:color var(--duration-fast),background var(--duration-fast)}
.ck-breadcrumb-more:hover{color:var(--foreground);background:var(--hover-bg)}
.ck-breadcrumb-more:focus-visible{outline:0;box-shadow:var(--focus-ring)}

/* ─── SETTINGS PANEL (Organism) ───────────────────────────────────────────
   Section card + field grid + controls, as used by folder settings and any
   other settings surface. Prefixed ck- so these can never collide with a
   flow's own class names. Edit here and every flow follows on next load. */
/* Light teal, not grey: --primary is so dark and desaturated that a 4% mix
   reads as neutral. --teal carries actual hue at the same lightness. */
/* ─── CARD / SETTINGS CARD / TOOLBAR (Molecules) ──────────────────────────
   .ck-card had no base rule at all — only a descendant selector for an icon
   inside its title. Anything using it was inheriting nothing.

   Both card surfaces read --card / --accent rather than a color-mix of
   --teal (Rulebook §10).

   Spec: references/components/surfaces.md */
.ck-card{background:var(--card);color:var(--card-foreground);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);padding:16px}
.ck-card.size-sm{padding:12px}
.ck-card.size-lg{padding:24px}
.ck-card-title{font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--card-foreground);
  display:flex;align-items:center;gap:6px}
.ck-card-title .ck-info{width:var(--icon-size);height:var(--icon-size);color:var(--muted-foreground);cursor:help;display:inline-flex}
.ck-card-sub{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);margin-top:2px}

.ck-settings-card{background:var(--accent);color:var(--accent-foreground);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);padding:20px}
.ck-settings-card > .ck-card-title{font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--accent-foreground);
  padding-bottom:16px;border-bottom:1px solid var(--panel-border)}

.ck-toolbar{display:flex;align-items:center;gap:16px;margin-bottom:16px;flex-wrap:wrap}
.ck-toolbar .grow{flex:1}
.ck-toolbar.size-sm{gap:8px;margin-bottom:12px}

/* ─── FIELD GRID (Molecule) ─── */
/* ─── INPUT / FIELD (Atom + Molecule) ─────────────────────────────────────
   .ck-field is the labelled wrapper; .ck-input / .ck-select / .ck-textarea are
   the controls. .ck-field-grid lays fields out in 1-3 columns.

   Sizes share the control height scale (Rulebook §7a): 28 / 34 / 40. The
   height is explicit and the padding is inline only — an input sized by
   padding alone lands on whatever its font metrics produce, which is how
   input (35) and select (37) drifted away from button (34).

   A textarea has no fixed height, so its sizes change padding and min-height
   instead.

   No :active state, deliberately: pressing a text field puts the caret in it,
   which IS the focus state. A separate pressed treatment would flash for one
   frame and mean nothing. Buttons and triggers do get :active.

   Spec: references/components/input.md */
.ck-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ck-field-grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.ck-field-grid.cols-1{grid-template-columns:minmax(0,1fr)}
.ck-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.ck-field .ck-field-hint{margin-top:-2px}
/* A label is read at a glance, so it truncates instead of wrapping. Put the
   full text in a title attribute wherever it can run long. */
.ck-field-label{font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--foreground);display:flex;align-items:center;gap:6px;min-width:0}
.ck-field-label > .ck-field-label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-field-hint{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-field-error{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--destructive)}

/* .ck-select needs appearance:none. With the UA appearance active, Chrome
   paints the option text inside its own inner box on top of our padding, so a
   select's text sat further right than the input and dropdown trigger stacked
   above it in the same field grid — a visible misalignment with identical CSS.
   The caret is drawn with two gradients so its colour stays a token; a
   data-URI SVG would hardcode a hex and stop following the theme. */
.ck-select{appearance:none;-webkit-appearance:none}
.ck-select::-ms-expand{display:none}

.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger{
  box-sizing:border-box;width:100%;height:36px;padding:0 11px;
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground);background:var(--background);
  border:1px solid var(--input);border-radius:var(--radius-md);
  transition:border-color var(--duration-base),box-shadow var(--duration-base);
  /* Responsive by default: the field takes its parent's width and can shrink
     inside a flex or grid track instead of forcing that track wider. */
  max-width:100%;min-width:0
}
/* Long text. A single-line field scrolls sideways as it fills, so the caret
   stays visible and nothing the user typed hides behind an ellipsis. */
.ck-input,.ck-select{text-overflow:clip}

/* ── AI FIELD — .is-ai ──
   A field whose content came from, or is going to, the model: the AI feedback
   box. It reads --purple-soft-foreground on its stroke so it is legible at a
   glance as "this one is the AI's", without changing its shape, height or
   type — it is the SAME control, marked, not a different control.

   Purple and not a semantic tone on purpose. Success, warning and destructive
   all mean something about the VALUE; this means something about where the
   value came from, which is an orthogonal fact. Borrowing a semantic tone for
   it would make an AI field look like a passing or failing one.

   The mark is a stroke and a ring, never a fill: a tinted field reads as
   read-only or disabled, and this one is fully editable.

   It rides on the field family, so it works on .ck-input, .ck-select,
   .ck-textarea and .ck-dd-trigger with no extra rules — and every state below
   is the base state's structure with the purple substituted, so nothing about
   focus, invalid or disabled behaviour changes.

   Spec: references/components/input.md § AI field */
:is(.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger).is-ai{
  border-color:var(--purple-soft-foreground)}
:is(.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger).is-ai:is(:hover,[data-force~="hover"]){
  border-color:var(--purple)}
:is(.ck-input,.ck-select,.ck-textarea).is-ai:is(:focus,[data-force~="focus"]),
.ck-dd-trigger.is-ai:is(:focus-visible,[data-force~="focus"]),
.ck-dd.open .ck-dd-trigger.is-ai{
  outline:0;border-color:var(--purple-soft-foreground);box-shadow:var(--focus-ring-ai)}
/* Invalid still wins over the AI mark. A field that is wrong has to say wrong
   first — where it came from is the lesser fact, and the destructive stroke is
   the one a user must not miss. */
:is(.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger).is-ai[aria-invalid="true"]{
  border-color:var(--destructive)}
:is(.ck-input,.ck-select,.ck-textarea).is-ai[aria-invalid="true"]:is(:focus,[data-force~="focus"]){
  border-color:var(--destructive);box-shadow:var(--focus-ring-error)}
/* Disabled and read-only drop the mark entirely: an inactive field is not
   offering the user anything, so advertising its provenance is noise. */
:is(.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger).is-ai:is(:disabled,[aria-disabled="true"],[data-force~="disabled"]){
  border-color:var(--input)}
:is(.ck-input,.ck-textarea).is-ai:read-only:not(:disabled){border-color:var(--input)}
/* The label that names it. --purple-soft-foreground clears 4.5:1 on the page,
   so it is a real label and not a decoration. */
.ck-field-ai{
  display:inline-flex;align-items:center;gap:var(--space-xs);
  font:var(--font-weight-medium) var(--text-md) var(--font-sans);
  color:var(--purple-soft-foreground)}
.ck-field-ai > svg{width:var(--icon-size);height:var(--icon-size);flex:none}
/* Vertical only. A field's WIDTH belongs to its .ck-field-grid column, so a
   horizontal handle would let one field break the grid's alignment and every
   field beside it. Dragging cannot go under the size class's min-height, so a
   textarea can never be collapsed to nothing. */
.ck-textarea{height:auto;min-height:76px;padding:8px 11px;resize:vertical;
  /* A text area grows downward, so its long text scrolls VERTICALLY. */
  overflow-y:auto;overflow-x:hidden}
/* Where the row height is fixed — an editable table cell — suppress it. */
.ck-textarea.no-resize{resize:none}
/* Declared AFTER the shared rule: its `background:` shorthand resets
   background-image, so the caret has to come later or it never paints. */
.ck-select{
  padding-inline-end:30px;
  background-image:
    linear-gradient(45deg,transparent 50%,var(--muted-foreground) 50%),
    linear-gradient(135deg,var(--muted-foreground) 50%,transparent 50%);
  background-position:calc(100% - 16px) center,calc(100% - 11px) center;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat
}
.ck-select.size-sm{padding-inline-end:26px;background-position:calc(100% - 14px) center,calc(100% - 9px) center;background-size:4px 4px,4px 4px}
.ck-select.size-lg{padding-inline-end:36px;background-position:calc(100% - 18px) center,calc(100% - 13px) center;background-size:6px 6px,6px 6px}
.ck-select:disabled,.ck-field.is-locked .ck-select{background-image:none}

/* Sizes */
.ck-input.size-sm,.ck-select.size-sm{height:28px;padding:0 9px;font-size:var(--text-md)}
.ck-input.size-lg,.ck-select.size-lg{height:44px;padding:0 13px}
.ck-textarea.size-sm{min-height:60px;padding:6px 9px;font-size:var(--text-md)}
.ck-textarea.size-lg{min-height:96px;padding:10px 13px}

:is(.ck-input,.ck-select,.ck-textarea,.ck-dd-trigger):is(:hover,[data-force~="hover"]){border-color:var(--input-border-hover)}
:is(.ck-input,.ck-select,.ck-textarea):is(:focus,[data-force~="focus"]){outline:0;border-color:var(--primary);box-shadow:var(--focus-ring)}
.ck-input::placeholder,.ck-textarea::placeholder{color:var(--muted-foreground)}

/* Invalid */
.ck-input[aria-invalid="true"],.ck-select[aria-invalid="true"],.ck-textarea[aria-invalid="true"],.ck-dd-trigger[aria-invalid="true"]{border-color:var(--destructive)}
.ck-input[aria-invalid="true"]:focus,.ck-select[aria-invalid="true"]:focus,
.ck-textarea[aria-invalid="true"]:focus{border-color:var(--destructive);box-shadow:var(--focus-ring-error)}

/* Disabled and read-only. Locked keeps its own class for the field-level
   treatment that predates this. */
.ck-input:disabled,.ck-select:disabled,.ck-textarea:disabled,
.ck-field.is-locked .ck-input,.ck-field.is-locked .ck-select{
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);cursor:not-allowed
}
.ck-input:read-only:not(:disabled),.ck-textarea:read-only:not(:disabled){background:var(--muted)/* pairing-exempt: re-asserts the surface only; the base rule owns the colour */}

/* ── The field clear ─────────────────────────────────────────────────────
   One control for the whole family: an input, a search box, a textarea and a
   dropdown all clear the same way and it looks identical in each.

   It is REVEALED, not resident: hidden until the field is hovered or holds
   focus, so a row of filled fields is not a row of crosses. Visibility is
   driven by the WRAPPER, because a control hidden on its own cannot be
   hovered into view. :focus-within as well as :hover — hover alone would make
   it unreachable by keyboard (§ 14.4 check 4).

   The glyph is --icon-size like every other icon in the product; the 24px box
   around it is the target-size floor. */
.ck-input-wrap{position:relative}
/* One rule, not two. The geometry and the reveal used to be declared
   separately, which left width/height/radius stated twice and the second copy
   silently winning. */
.ck-input-clear{
  position:absolute;inset-inline-end:8px;inset-block:0;margin-block:auto;
  width:24px;height:24px;border:0;background:0;border-radius:var(--radius-sm);
  color:var(--muted-foreground);cursor:pointer;
  display:grid;place-items:center;
  display:grid;place-items:center;opacity:0;pointer-events:none;
  transition:opacity var(--duration-base)}
.ck-input-clear svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-input-clear:hover{background:var(--hover-bg);color:var(--foreground)}
.ck-input-clear:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* On a textarea the field is tall, so the clear anchors to the top-right
   corner instead of the vertical centre. */
.ck-input-wrap.is-textarea > .ck-input-clear{top:var(--space-sm);transform:none}
/* Revealed by the wrapper, and only once the field has something to clear. */
.ck-input-wrap.has-value:hover > .ck-input-clear,
.ck-input-wrap.has-value:focus-within > .ck-input-clear,
.ck-input-wrap.has-value[data-force~="hover"] > .ck-input-clear{
  opacity:1;pointer-events:auto}

/* ─── SWITCH (Atom) ─── */
/* ─── SWITCH (Atom) ────────────────────────────────────────────────────────
   shadcn component name: Switch · Clipper legacy name: Switcher.

   A Switch commits a binary choice the moment it is flipped — there is no Save
   step. Use it for settings that take effect immediately; for a mode that a
   button holds, use .ck-toggle.

   CANONICAL CLASS IS .switch. State is expressed the shadcn way with
   data-state="checked" / "unchecked", which is what the React kit's
   switch.tsx keys on (data-[state=checked]) — so the two halves of the kit now
   agree. The legacy .ck-switch class, the .on flag and aria-checked are all
   still honoured, so shipped flows keep rendering unchanged.

   role="switch" + aria-checked are still REQUIRED for accessibility:
   data-state drives the paint, aria-checked drives the announcement, and a
   <button> with neither announces no state at all.

   GEOMETRY is --switch-w / --switch-h / --switch-thumb / --switch-inset, and
   thumb travel is DERIVED from them rather than hard-coded, so a size variant
   is a token change and never a new rule.

   The track IS the affordance — there is no label inside it — so it must clear
   3:1 against the page ground unchecked as well as checked (WCAG 1.4.11).
   That is why --input was corrected; the unchecked track reads from it.

   data-force~="hover|active|focus|disabled" paints a state without the user
   being in it. It exists so a spec sheet can render the full states matrix
   from the kit's OWN rules instead of re-declaring them in page CSS, which
   § 12.1 warns goes stale. Documentation only — never in product markup.

   Spec: references/components/switcher.md */
.switch,.ck-switch{
  --switch-w:40px; --switch-h:24px; --switch-thumb:16px; --switch-inset:4px;
  width:var(--switch-w);height:var(--switch-h);flex-shrink:0;box-sizing:border-box;
  border-radius:var(--radius-full);border:0;padding:0;
  background:var(--toggle-track);/* pairing-exempt: track and thumb carry no text */
  position:relative;cursor:pointer;
  transition:background var(--duration-moderate)
}
.switch::after,.ck-switch::after{
  content:'';position:absolute;
  top:var(--switch-inset);left:var(--switch-inset);
  width:var(--switch-thumb);height:var(--switch-thumb);
  border-radius:var(--radius-full);
  background:var(--background);/* pairing-exempt: track and thumb carry no text */
  transition:transform var(--duration-moderate)
}

/* Checked — data-state first, then the two legacy forms. */
:is(.switch,.ck-switch):is([data-state="checked"],[aria-checked="true"],.on){
  background:var(--primary)/* pairing-exempt: track and thumb carry no text */}
:is(.switch,.ck-switch):is([data-state="checked"],[aria-checked="true"],.on)::after{
  transform:translateX(calc(var(--switch-w) - var(--switch-thumb) - (2 * var(--switch-inset))))
}

/* Sizes. Travel derives from the three metrics, so a size needs no separate
   translate value and cannot fall out of sync with its geometry. */
/* Every size keeps the SAME 4px inset, so a small switch does not look
   tighter than a large one — only smaller. A 20px knob in a 24px track left
   2px of track showing and read as a disc jammed into a slot; at 16px the
   knob is plainly a knob sitting in a groove. */
:is(.switch,.ck-switch).size-sm{--switch-w:32px;--switch-h:20px;--switch-thumb:12px;--switch-inset:4px}
:is(.switch,.ck-switch).size-lg{--switch-w:48px;--switch-h:28px;--switch-thumb:20px;--switch-inset:4px}

/* Hover */
:is(.switch,.ck-switch):is(:hover,[data-force~="hover"]){
  background:var(--toggle-track-hover)/* pairing-exempt: track and thumb carry no text */}
:is(.switch,.ck-switch):is([data-state="checked"],[aria-checked="true"],.on):is(:hover,[data-force~="hover"]){
  background:var(--primary-hover)/* pairing-exempt: track and thumb carry no text */}

/* Pressed */
:is(.switch,.ck-switch):is(:active,[data-force~="active"]){
  background:var(--toggle-track-hover)/* pairing-exempt: track and thumb carry no text */}
:is(.switch,.ck-switch):is([data-state="checked"],[aria-checked="true"],.on):is(:active,[data-force~="active"]){
  background:var(--primary-active)/* pairing-exempt: track and thumb carry no text */}

/* Disabled — a FADED version of whatever the switch is actually showing, which
   is the v2.0 treatment and the one the product's users already know. The
   track keeps its real colour (--toggle-track off, --primary on) and the knob
   keeps its white, and the whole control drops to --disabled-opacity.

   This is the kit's one opacity-based disabled state, and it is a declared
   exception rather than a lapse. The no-opacity rule exists because opacity
   dims a control's LABEL along with its box, so the text reads as a rendering
   fault instead of an unavailable action. A switch has no label and no glyph:
   it is a track and a circle. There is nothing for opacity to damage, and
   fading is exactly the message — this control still says what it says, you
   just cannot change it.

   The alternative was re-colouring: --muted track with a --muted-foreground
   knob. It measured better (4.41:1) but it changed what the control looked
   like rather than dimming it, so a disabled OFF and a disabled ON stopped
   being recognisable as the same component in two states.

   Position still carries on/off either way, and inactive controls are exempt
   from 1.4.11, so the low track-vs-page contrast here is allowed. */
:is(.switch,.ck-switch):is(:disabled,.is-disabled,[aria-disabled="true"],[data-force~="disabled"]){
  opacity:var(--disabled-opacity);cursor:not-allowed}
:is(.switch,.ck-switch):is(:disabled,.is-disabled,[aria-disabled="true"]){pointer-events:none}

/* Focus */
:is(.switch,.ck-switch):is(:focus-visible,[data-force~="focus"]){outline:0;box-shadow:var(--focus-ring)}
/* A 3-column 1fr grid pushed each toggle to the far right of its column,
   landing it nearer the NEXT label than its own. Gestalt: the gap inside a
   pair must be smaller than the gap between pairs. So the row is capped at a
   readable width and the column gap is widened well past it. */
.ck-switch-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,240px));gap:16px 56px;justify-content:start}
@media (max-width:760px){.ck-switch-grid{grid-template-columns:minmax(0,1fr);gap:2px 0}}
/* space-between pushed the toggle to the far edge: 203px from its own label,
   24px from the next one. The label now has a bounded min-width so toggles
   still line up, but the switch sits right after it. */
.ck-switch-row{display:flex;align-items:center;justify-content:flex-start;gap:14px;max-width:240px;padding:7px 0}
.ck-switch-row > span{min-width:112px;flex:none}
.ck-switch-row > span{font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground)}

/* ─── DATA TABLE (Organism) ─── */
/* ─── TABLE (Molecule) ─────────────────────────────────────────────────────
   Sizes are row density, which is what a table's size actually means.
   .is-sticky pins the header when the table scrolls inside a container.

   The --muted header band with --foreground text is a declared pairing
   exemption: 15.87:1 where the nominal --muted-foreground partner is 3.16:1.

   Spec: references/components/table.md */
.ck-table{
  --table-row-height:40px;
  width:100%;border-collapse:collapse;
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  background:var(--card);color:var(--card-foreground);
  border-radius:var(--radius-2xl);overflow:hidden}
.ck-table th{/* pairing-exempt: --muted is a header band, not a muted-content surface; --foreground on it is 15.87:1 where the nominal --muted-foreground partner is 3.16:1 */
  text-align:start;padding:10px 14px;background:var(--muted);
  font:var(--font-weight-medium) var(--text-sm) var(--font-sans);color:var(--foreground);white-space:nowrap;
  height:var(--table-header-height)}
/* Row height is EXPLICIT, not emergent from font metrics. A data row and a
   loading row have different content — text versus a 12px bar — so left to
   padding alone they land on different heights and the table jumps when the
   real rows arrive (§ 14.10 check 17). One property drives both. */
/* The separator is DOTTED, and it reads --panel-border rather than --border.
   A dotted rule shows less ink than a solid one of the same colour, so at
   --border (#f5f5f5, 1.09:1) it disappeared entirely; --panel-border is the
   token whose job is a visible stroke. */
.ck-table td{height:var(--table-row-height);padding:11px 14px;
  border-top:1px dotted var(--panel-border);color:var(--card-foreground)}
.ck-table tbody tr:hover td{background:var(--hover-bg)}
.ck-table tbody tr[aria-selected="true"] td,.ck-table tbody tr.is-selected td{background:var(--selected-bg);color:var(--selected-fg)}

/* ── Errored row ──
   The soft-semantic triplet at rest, and hover deepens to the destructive
   HOVER tint rather than the neutral --hover-bg. A row that is a problem must
   not stop looking like one the moment the cursor lands on it. */
.ck-table tbody tr.is-error td{
  background:var(--destructive-bg);color:var(--destructive-soft-foreground);
  border-top-color:var(--destructive-border)}
/* Hover deepens the STROKE, not the fill, and that is forced rather than
   chosen. § 8's derivation rule says a hover fill must still clear 4.5:1
   against its family foreground — and on a soft tint there is no headroom:
   the rest state is already 4.58:1 in light, so any deepening drops under AA,
   and reusing --destructive-border as a fill measures 3.57:1 in light and
   1.00:1 in high contrast, where the text would vanish outright. So the
   hover "shifts the other way": the rules go solid --destructive and a 2px
   rail lands on the leading edge. Text contrast is untouched in all three
   themes, and the row still answers the cursor destructively instead of
   reverting to the neutral --hover-bg. */
.ck-table tbody tr.is-error:hover td,
.ck-table tbody tr.is-error[data-force~="hover"] td{
  border-top-color:var(--destructive)}
.ck-table tbody tr.is-error:hover td:first-child,
.ck-table tbody tr.is-error[data-force~="hover"] td:first-child{
  box-shadow:inset 2px 0 0 var(--destructive)}

/* ── Sortable column header ──
   Three states, cycled in one order: unsorted -> ascending -> descending ->
   unsorted. aria-sort is the state, so a screen reader is told the same thing
   the glyph shows.

   THE GLYPH IS REVEALED ON HOVER WHILE UNSORTED, AND RESIDENT ONCE SORTED. A
   header row of permanent arrows is noise, but a column that IS sorted has to
   say so whether the cursor is there or not — the indicator is the only record
   of why the rows are in this order.

   THE TOOLTIP NAMES THE NEXT ACTION, NOT THE CURRENT STATE: "Sort A to Z",
   then "Sort Z to A", then "Clear sorting". A label that describes what you
   are already looking at tells you nothing you cannot see. ckTableSort() in
   clipper-kit.js keeps the label and aria-label in step with aria-sort.

   ONE GLYPH, THREE READINGS. It is always the same chevron pair — an up
   chevron above a down chevron — and the STATE IS WHICH HALF IS LIT:

     unsorted     both halves --muted-foreground   "either direction is available"
     ascending    up lit --primary, down --input    "sorted up; down is available"
     descending   down lit --primary, up --input    "sorted down; up is available"

   Swapping the glyph for a different one per state was wrong twice over: the
   mark moved under the cursor between states, and the lit half is what says
   which direction you are IN while the faded half says which you can go to.
   The fade is a token change, never opacity — a half-transparent stroke over
   a --muted header band is a different colour, not a dimmer one. */
.ck-table th.is-sortable{
  cursor:pointer;user-select:none;
  padding-inline-end:calc(14px + var(--icon-size) + var(--space-xs))}
.ck-table th.is-sortable:is(:hover,[data-force~="hover"]){background:var(--hover-bg)/* pairing-exempt: re-asserts the surface only; the base th rule owns the colour */}
.ck-table th.is-sortable:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--primary)}
.ck-table th.is-sortable > .ck-th{display:inline-flex;align-items:center;gap:var(--space-xs);position:relative}
.ck-th-sort{
  width:var(--icon-size);height:var(--icon-size);flex:none;display:grid;place-items:center;
  color:var(--muted-foreground);
  opacity:0;transition:opacity var(--duration-base)}
.ck-th-sort svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-table th.is-sortable:is(:hover,:focus-visible,[data-force~="hover"]) .ck-th-sort{opacity:1}

/* ── A DELETE CONTROL ON EVERY COLUMN — .ck-th-delete ─────────────────────
   Revealed on the same approach as the sort control: hover, and focus-within
   so a keyboard reaches it too. It removes the COLUMN, not the data, which is
   why it is destructive in tone but not in weight — a filled red button on
   every header would make a table look like a minefield.

   It sits inboard of the resize handle, so dragging the edge never lands on
   it by mistake. */
.ck-th-delete{
  width:var(--icon-size);height:var(--icon-size);flex:none;
  display:grid;place-items:center;padding:0;border:0;background:0;
  color:var(--muted-foreground);cursor:pointer;
  opacity:0;transition:opacity var(--duration-base),color var(--duration-base)}
.ck-th-delete svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-th-delete:is(:hover,[data-force~="hover"]){color:var(--destructive)}
.ck-th-delete:focus-visible{outline:0;box-shadow:var(--focus-ring-error);border-radius:var(--radius-xs)}
.ck-table th:is(:hover,:focus-within,[data-force~="hover"]) .ck-th-delete{opacity:1}

/* ── RESIZABLE COLUMNS — .ck-th-resize ────────────────────────────────────
   A 6px grab strip on the trailing edge of the header, drawn as a 1px rule so
   the target is bigger than the thing you can see. The column's own min-width
   comes from the shortest data it holds and is set per column with
   --ck-col-min; the ceiling is 400px for every column, because past that a
   line of text is harder to scan, not easier.

   The table keeps table-layout:fixed while resizing so the other columns do
   not redistribute under the pointer — a drag that moves two edges at once is
   impossible to aim. */
.ck-table th{position:relative}
.ck-th-resize{
  position:absolute;inset-block:0;inset-inline-end:-3px;width:6px;
  cursor:col-resize;background:0;border:0;padding:0;
  touch-action:none;user-select:none;z-index:1}
.ck-th-resize::before{
  content:'';position:absolute;inset-block:4px;inset-inline-start:2px;width:1px;
  background:var(--input);opacity:0;transition:opacity var(--duration-base)}
.ck-table th:is(:hover,[data-force~="hover"]) .ck-th-resize::before,
.ck-th-resize:focus-visible::before{opacity:1}
.ck-th-resize:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* While a drag is live the whole table shows the resize cursor, so the pointer
   does not flicker between cells as it crosses them. */
.ck-table.is-resizing{cursor:col-resize;user-select:none}
.ck-table.is-resizing .ck-th-resize::before{opacity:1;background:var(--primary)/* pairing-exempt: a 1px drag indicator, carries no text */}
/* Once a column has been sized by hand the cells must be able to give way, or
   `white-space: nowrap` holds the column open at its own text width and the
   declared minimum can never be reached — the handle appears to stop early for
   no visible reason. .is-sized is added the moment a width is set. */
.ck-table.is-sized th,.ck-table.is-sized td{overflow:hidden;text-overflow:ellipsis}
.ck-table.is-sized td{white-space:nowrap}
/* Sorted: resident, and in --primary so the active column is unmistakable. */
.ck-table th[aria-sort="ascending"] .ck-th-sort,
.ck-table th[aria-sort="descending"] .ck-th-sort{opacity:1;color:var(--primary)}
/* Unsorted shows BOTH halves at equal weight: neither direction is in force,
   and both are one click away. */
.ck-table th[aria-sort="none"] .ck-th-sort,
.ck-table th.is-sortable:not([aria-sort]) .ck-th-sort{color:var(--muted-foreground)}
/* Which half is lit. The whole glyph takes the state colour and the INACTIVE
   half is overridden back to --input, so there is one place per state to
   change and the two halves can never both claim to be active. */
.ck-table th[aria-sort="ascending"] .ck-th-sort .ck-sort-down,
.ck-table th[aria-sort="descending"] .ck-th-sort .ck-sort-up{stroke:var(--input)}

/* ── Row actions ──
   Revealed on row hover and on focus-within, like every other hover-revealed
   control in the kit (§ 14.3 check 31). The cell keeps its width whether the
   actions show or not, so a row never reflows under the cursor. */
.ck-table-actions{
  display:inline-flex;align-items:center;gap:var(--space-2xs);
  opacity:0;pointer-events:none;transition:opacity var(--duration-base)}
.ck-table tbody tr:hover .ck-table-actions,
.ck-table tbody tr:focus-within .ck-table-actions,
.ck-table tbody tr[data-force~="hover"] .ck-table-actions{opacity:1;pointer-events:auto}
.ck-table td.ck-cell-actions{width:1%;white-space:nowrap;text-align:end}

/* ─── TABLE CELL DATA TYPES — .ck-table.is-data ────────────────────────────
   The default table holds text. This variant is the same table carrying every
   kind of value the product actually shows, one per column, so a screen can be
   assembled from named patterns instead of hand-rolled cells.

   Nothing here restyles a component. A badge in a cell is a badge, a dropdown
   is a dropdown, a switch is a switch. These classes only handle the two
   things a CELL owns: how the value is aligned, and how it behaves when it is
   longer than its column.

   It is wide by design — put it in a .ck-table-panel > .ck-table-scroll with
   .is-sticky on the table, and it scrolls with its header pinned.

   Spec: references/components/table.md § Data types */
.ck-table.is-data td{vertical-align:middle}

/* Flag — a tone rail on the leading edge of the row. It is the row's status at
   a glance, and it is never the only carrier of that status: a flagged row
   also says why in words somewhere.

   IT IS FLUSH TO THE WALL AND FULL HEIGHT. A 4px cell with no padding, and the
   rail absolutely positioned across the whole block axis — so it butts the
   table's left edge and runs the row's entire height whatever that row's
   density is. It was a floating 20px capsule inset by 10px, which read as a
   dot in a margin rather than as the row's own edge.

   Square ends, not --radius-xs: a rail that meets the wall and both
   separators has no ends to round, and rounding them reopens the gap the
   flush edge exists to close. .ck-table's overflow:hidden clips it to the
   panel's corner radius on the first and last row, which is what should
   happen.

   The dotted separator is dropped on this cell only, so the rule does not cut
   across the rail — the rails then read as a continuous edge segmented by
   colour, which is the point of them. */
.ck-table.is-data td.ck-cell-flag{
  position:relative;width:4px;min-width:4px;padding:0;border-top:0}
.ck-flag{
  position:absolute;inset-block:0;inset-inline-start:0;width:4px;
  background:var(--input)/* pairing-exempt: a rail, carries no text */}
.ck-flag.is-success{background:var(--success)/* pairing-exempt: carries no text */}
.ck-flag.is-warning{background:var(--warning)/* pairing-exempt: carries no text */}
.ck-flag.is-error{background:var(--destructive)/* pairing-exempt: carries no text */}
.ck-flag.is-info{background:var(--info)/* pairing-exempt: carries no text */}

/* Expander chevron. Same clockwise-both-ways rotation as the accordion and the
   dropdown, from the same keyframes — a disclosure is a disclosure. */
.ck-table.is-data td.ck-cell-chev{width:1%;padding-inline-end:0}
.ck-row-chev{
  width:var(--icon-size);height:var(--icon-size);display:grid;place-items:center;
  border:0;background:0;padding:0;cursor:pointer;
  color:var(--muted-foreground);transform:rotate(0deg)}
.ck-row-chev svg{width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-row-chev:focus-visible{outline:0;box-shadow:var(--focus-ring);border-radius:var(--radius-xs)}
tr[aria-expanded="true"] > td > .ck-row-chev{
  animation:ck-chev-open var(--duration-moderate) var(--ease-default) forwards}
tr.is-collapsing > td > .ck-row-chev{
  animation:ck-chev-close var(--duration-moderate) var(--ease-default) forwards}

/* Name with avatar */
.ck-cell-name{display:inline-flex;align-items:center;gap:var(--space-sm);min-width:0}
.ck-cell-name > span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Email — a real link, so it takes the link token and the link underline. */
.ck-cell-email{
  color:var(--link);text-decoration:underline;text-underline-offset:2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:220px}
/* No --link-hover exists, and none should be minted: the link family signals
   hover by THICKENING THE UNDERLINE, which is exactly what .ck-btn.link does.
   A labelled link and an email in a cell must not answer the cursor
   differently. */
.ck-cell-email{text-decoration-thickness:1px}
.ck-cell-email:is(:hover,[data-force~="hover"]){color:var(--link);text-decoration-thickness:2px}
.ck-cell-email:focus-visible{outline:0;box-shadow:var(--focus-ring);border-radius:var(--radius-xs)}

/* Numeric, amount, date, counter — all right-aligned with tabular figures, so
   a column of them lines up on the decimal and stepping 9 -> 10 shifts
   nothing. An amount additionally carries its currency in the header, never
   repeated per row. */
.ck-table.is-data td.ck-cell-num,
.ck-table.is-data td.ck-cell-amount,
.ck-table.is-data th.ck-cell-num,
.ck-table.is-data th.ck-cell-amount{text-align:end;font-variant-numeric:tabular-nums}
.ck-table.is-data td.ck-cell-amount{font-weight:var(--font-weight-semibold)}
.ck-table.is-data td.ck-cell-date{white-space:nowrap;font-variant-numeric:tabular-nums}
.ck-table.is-data td.ck-cell-counter{text-align:center;width:1%}

/* Long text, two behaviours and they are NOT interchangeable.
   .ck-cell-multi WRAPS — for a value the user has to read in full, capped at
   three lines so one long note cannot make the row twice the height of its
   neighbours.
   .ck-cell-trunc TRUNCATES and hands the full text to a tooltip — for a value
   that is scanned, where the column has to stay narrow. Wrap it in
   .ck-tip-host and the tooltip appears on hover AND on keyboard focus. */
.ck-table.is-data td.ck-cell-multi{
  white-space:normal;min-width:220px;max-width:320px;
  display:table-cell}
.ck-cell-multi > span{
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden;line-height:1.45}
.ck-table.is-data td.ck-cell-trunc{max-width:180px}
.ck-cell-trunc .ck-tip-host{max-width:100%}
.ck-cell-trunc .ck-tip-host > span:first-child{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}

/* Editable cell — it reads as text until the row is hovered or the field takes
   focus, then it becomes visibly a field. A grid of permanent input boxes is
   unreadable as data, and a value that never shows it is editable is
   undiscoverable; revealing the stroke on approach is the middle. */
/* The cell editor sizes its input with the ATOM's own size class in the
   markup (.ck-input.size-sm), not by overriding height here — an organism
   places an atom, it does not re-measure it (§ 14 check 40). */
.ck-cell-edit > .ck-input{padding:0 var(--space-xs);
  border-color:transparent;background:transparent}
.ck-table tbody tr:hover .ck-cell-edit > .ck-input,
.ck-table tbody tr[data-force~="hover"] /* The cell editor sizes its input with the ATOM's own size class in the
   markup (.ck-input.size-sm), not by overriding height here — an organism
   places an atom, it does not re-measure it (§ 14 check 40). */
.ck-cell-edit > .ck-input{
  border-color:var(--input);background:var(--background);color:var(--foreground)}
.ck-cell-edit > .ck-input:focus{
  border-color:var(--primary);background:var(--background);color:var(--foreground)}

/* Progress in a cell — the bar plus its number, because a bar alone is not a
   label (§ 14.3 check 25). */
.ck-cell-progress{display:flex;align-items:center;gap:var(--space-sm);min-width:140px}
.ck-cell-progress > .ck-progress{flex:1}
.ck-cell-progress > span{
  flex:none;font-variant-numeric:tabular-nums;color:var(--muted-foreground);
  font-size:var(--text-sm)}

/* Switch and CTA cells shrink to their content and never set the row height —
   the controls inside are already on the control scale. */
.ck-table.is-data td.ck-cell-switch,
.ck-table.is-data td.ck-cell-cta,
.ck-table.is-data td.ck-cell-bar{width:1%;white-space:nowrap}

/* ── AVATAR (Atom) ──
   Initials on a tinted plate, or an image. Round, on the icon-box scale so it
   lines up with a glyph in the same column. */
.ck-avatar{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  width:var(--icon-box);height:var(--icon-box);border-radius:var(--radius-full);
  background:var(--group);color:var(--group-foreground);
  border:1px solid var(--panel-border);
  font:var(--font-weight-semibold) var(--text-2xs) var(--font-sans);
  text-transform:uppercase;overflow:hidden;user-select:none}
.ck-avatar.size-sm{width:20px;height:20px;font-size:var(--text-3xs)}
.ck-avatar.size-lg{width:32px;height:32px;font-size:var(--text-xs)}
.ck-avatar > img{width:100%;height:100%;object-fit:cover;display:block}

/* ── RATING (Atom) ──
   Read-only by default. The score is stated in text beside the stars, because
   counting glyphs is not reading a value — and a screen reader gets the number
   from the text, not from five identical icons. */
.ck-rating{display:inline-flex;align-items:center;gap:var(--space-2xs)}
.ck-rating > svg{
  width:var(--icon-size);height:var(--icon-size);flex:none;
  color:var(--input);fill:none}
.ck-rating > svg.is-on{color:var(--warning);fill:var(--warning)}
.ck-rating > .ck-rating-value{
  margin-inline-start:var(--space-xs);
  font-variant-numeric:tabular-nums;color:var(--muted-foreground);
  font-size:var(--text-sm)}

/* Density */
.ck-table.size-sm{--table-row-height:32px}
.ck-table.size-lg{--table-row-height:48px}
.ck-table.size-sm th{padding:7px 10px}
.ck-table.size-sm td{padding:7px 10px;font-size:var(--text-md)}
.ck-table.size-lg th{padding:13px 16px}
.ck-table.size-lg td{padding:15px 16px}

/* Sticky header, for a table scrolling inside a fixed-height container. */
.ck-table.is-sticky th{position:sticky;top:0;z-index:var(--z-sticky)}

/* Numeric columns read faster right-aligned and tabular. */
.ck-table .num{text-align:end;font-variant-numeric:tabular-nums}
.ck-table-empty{padding:36px 16px;text-align:center;color:var(--muted-foreground);font:var(--font-weight-normal) var(--text-md) var(--font-sans)}

/* ─── TOOLBAR (Molecule) ─── */
.ck-toolbar{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.ck-toolbar .grow{flex:1}

/* ─── BUTTON (Atom) ────────────────────────────────────────────────────────
   Four variants x three sizes, plus hover / active / disabled / focus.

   THE DEFAULT IS THE SECOND-TIER BUTTON. There is no separate grey
   `secondary` variant, and there should not be one: the outlined default was
   always doing that job, and having both meant every screen had to choose
   between two things that meant the same thing. The bare class is the button
   you reach for beside a primary.

   Base is the outline variant: a --background surface carrying a --primary
   label and border. That is the recognised "outline" pairing (Rulebook §3) —
   label and border share one token, and primary on background is 12.01:1.
   Hover is --hover-bg, the product's own tint. NOTHING in the kit hovers to
   grey; a grey-hovering button read as a different system.

   Filled variants darken their fill on hover via the minted --*-hover tokens.
   They must never use opacity, which dims the label with the fill and reads
   as disabled (Rulebook §8).

   Spec: references/components/button.md */
.ck-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:36px;padding:0 14px;box-sizing:border-box;
  border-radius:var(--radius-md);
  border:1px solid var(--primary);
  background:var(--background);color:var(--primary);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  white-space:nowrap;cursor:pointer;
  transition:background var(--duration-base),border-color var(--duration-base),color var(--duration-base)
}
.ck-btn svg{width:var(--icon-size);height:var(--icon-size);flex:none}

/* Sizes — height and padding only; the label stays 12.5px/600 at every size
   so a row of mixed-size buttons shares one baseline. */
.ck-btn.size-sm{height:28px;padding:0 10px;gap:4px}
.ck-btn.size-lg{height:44px;padding:0 18px;gap:8px}

/* Variants */
.ck-btn.primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
/* Success — the one action that CONFIRMS a completed result: the "Done" on an
   import-complete dialog. Not a general affirmative; a green Save is a primary
   action wearing the wrong colour, and there is one --primary per view for a
   reason.

   IT IS THE SOFT TRIPLET, NOT A SOLID GREEN FILL, and that is measurement not
   taste. A solid --success with its nominal white partner is 3.43:1 in light —
   under AA for a button label, and the standing Sev-4 in § 11 for "any solid
   success fill with white text". Dark ink on it is no better across themes.
   The soft triplet passes everywhere: 4.72:1 light, 4.54:1 dark, 10.79:1 high
   contrast. It also sits at the right volume — a solid green CTA shouts louder
   than the primary action it is standing in for. */
.ck-btn.success{
  background:var(--success-bg);color:var(--success-soft-foreground);
  border-color:var(--success-border)}
.ck-btn.destructive{background:var(--destructive);color:var(--destructive-foreground);border-color:var(--destructive)}
.ck-btn.ghost{background:transparent;color:var(--foreground);border-color:transparent}

/* Hover — solid fills darken; outline and ghost take the product hover tint. */
.ck-btn:hover{background:var(--hover-bg)}
.ck-btn.primary:hover{background:var(--primary-hover);border-color:var(--primary-hover)}
/* Hover deepens the STROKE, not the fill — § 8's derivation rule again. On a
   soft tint there is no headroom: the rest state is 4.72:1 and darkening the
   fill drops the label under AA, exactly as it does on an errored table row. */
.ck-btn.success:hover{background:var(--success-bg);border-color:var(--success)}
.ck-btn.destructive:hover{background:var(--destructive-hover);border-color:var(--destructive-hover)}
.ck-btn.ghost:hover{background:var(--hover-bg);color:var(--primary)}
/* Destructive ghost. .ck-btn.ghost is declared after .ck-btn.destructive, so at
   equal specificity ghost wins and the pair rendered as a neutral ghost. Two
   classes lifts this to 0-3-0. Same treatment .ck-icon-btn.tone-danger carries:
   destructive label at rest, soft destructive fill on hover, solid on press —
   so a labelled and an unlabelled destructive action agree.

   This replaces the retired .ck-clear-btn, which was a whole component for
   what is one variant combination. */
.ck-btn.ghost.destructive{background:transparent;color:var(--destructive);border-color:transparent}
.ck-btn.ghost.destructive:hover{background:var(--destructive-bg);color:var(--destructive-soft-foreground);border-color:transparent}
.ck-btn.ghost.destructive:active{background:var(--destructive);color:var(--destructive-foreground);border-color:transparent}
.ck-btn.ghost.destructive:focus-visible{box-shadow:var(--focus-ring-error)}
.ck-btn.ghost.destructive:disabled,.ck-btn.ghost.destructive[aria-disabled="true"]{
  background:transparent;color:var(--muted-foreground);border-color:transparent}

/* Active */
.ck-btn:active{background:var(--selected-bg)}
.ck-btn.primary:active{background:var(--primary-active);border-color:var(--primary-active)}
/* Pressed doubles the stroke rather than deepening the fill. It used to fill
   with --success-border, which stopped working the moment that token became a
   real green: a solid --success-soft-foreground fill under
   --success-soft-foreground text is 1.00:1. The fill has no headroom to move
   (§ 8), so the press moves the edge. */
.ck-btn.success:active{
  background:var(--success-bg);border-color:var(--success);
  box-shadow:inset 0 0 0 1px var(--success)}
.ck-btn.destructive:active{background:var(--destructive-active);border-color:var(--destructive-active)}
.ck-btn.ghost:active{background:var(--selected-bg)}

/* Disabled — one treatment for every variant, so a disabled row reads as one
   thing. Covers the attribute and the class the reference pages use. */
.ck-btn:disabled,.ck-btn.disabled,.ck-btn[aria-disabled="true"]{
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);
  cursor:not-allowed;pointer-events:none
}

/* Focus — visible ring on every variant; destructive gets the error ring. */
.ck-btn:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-btn.destructive:focus-visible{box-shadow:var(--focus-ring-error)}

/* ─── BADGE / CHIP / PILL (Atom) ───────────────────────────────────────────
   One component, three names. `.ck-badge` and `.ck-chip` are aliases of
   `.ck-pill`; use whichever reads better in context.

   Shape is always --radius-full. There is no rounded-rectangle variant and
   there must not be one: two page-local implementations had border-radius:6px
   and both are gone.

   Text colour is always --*-soft-foreground, never the solid token. The solid
   as text on its own -bg tint fails 4.5:1 in 12 of 66 family/theme pairs.

   Spec: references/components/pill.md */
.ck-pill,.ck-badge,.ck-chip{
  display:inline-flex;align-items:center;box-sizing:border-box;
  gap:var(--ck-pill-gap);height:var(--ck-pill-h);padding:var(--ck-pill-pad);
  max-width:var(--ck-pill-max);
  border-radius:var(--radius-full);border:1px solid var(--border);
  background:var(--muted);color:var(--foreground);
  font:600 var(--ck-pill-fs) var(--font-sans);
  white-space:nowrap;vertical-align:middle;
  transition:background var(--duration-base),border-color var(--duration-base)
}

/* ── Sizes ──
   Height is fixed per size so a row of pills never staggers.

   Width hugs the content up to a hard 150px cap, the same at every size — a
   pill is a status label, and a row of pills that all stop at one width scans
   faster than one where each is as wide as its text. Past the cap the LABEL
   truncates; the pill never grows. A container holding pills sizes to the
   pill, not the reverse. */
/* One var block per size, covering all three names. These were duplicated —
   .ck-pill got the counter variables and .ck-badge / .ck-chip did not, so a
   counter or dismiss inside a badge or chip collapsed to 0px. An alias must
   never be able to miss a variable, so there is one block per size now. */
.ck-pill,.ck-badge,.ck-chip{
  --ck-pill-h:24px;--ck-pill-pad:0 10px;--ck-pill-fs:var(--text-md);--ck-pill-gap:6px;
  --ck-pill-max:152px;--ck-pill-ico:var(--icon-size);
  --ck-count-h:16px;--ck-count-fs:var(--text-xs);--ck-count-pad:5px;--ck-count-inset:4px}
.ck-pill.size-sm,.ck-badge.size-sm,.ck-chip.size-sm{
  --ck-pill-h:20px;--ck-pill-pad:0 8px;--ck-pill-fs:var(--text-sm);--ck-pill-gap:4px;
  --ck-pill-max:152px;--ck-pill-ico:var(--icon-size);
  --ck-count-h:12px;--ck-count-fs:var(--text-2xs);--ck-count-pad:4px;--ck-count-inset:3px}
.ck-pill.size-lg,.ck-badge.size-lg,.ck-chip.size-lg{
  --ck-pill-h:28px;--ck-pill-pad:0 12px;--ck-pill-fs:var(--text-base);--ck-pill-gap:8px;
  --ck-pill-max:152px;--ck-pill-ico:var(--icon-size);
  --ck-count-h:20px;--ck-count-fs:var(--text-sm);--ck-count-pad:6px;--ck-count-inset:5px}

/* ── Label: truncates, never wraps ──
   .ck-mid-trunc keeps the head and the tail — "Missing D…nt" — because the
   tail of a status label usually carries the distinguishing word. The full
   string goes in title= for hover; ckMiddleTruncate in clipper-kit.js sets it. */
.ck-pill-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── Icons: either side, or both ── */
.ck-pill svg,.ck-badge svg,.ck-chip svg{width:var(--ck-pill-ico);height:var(--ck-pill-ico);flex:none;display:block}
.ck-pill-dot{width:6px;height:6px;flex:none;border-radius:var(--radius-full);background:currentColor}
.ck-pill.size-sm .ck-pill-dot{width:5px;height:5px}
.ck-pill.size-lg .ck-pill-dot{width:7px;height:7px}

/* ── Counter: hollow, and only hollow ──
   Transparent fill, 1px border and text both in currentColor, which is the
   tone's --*-soft-foreground. The filled and subtle forms that the pages
   shipped are discarded. --radius-full so it matches the pill it sits in. */
.ck-pill-count{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  min-width:var(--ck-pill-h);height:var(--ck-count-h);
  margin-inline-end:calc(-1 * var(--ck-count-inset));
  padding:0 var(--ck-count-pad);
  border:1px solid currentColor;border-radius:var(--radius-full);
  background:transparent;color:currentColor;
  font:600 var(--ck-count-fs) var(--font-sans);font-variant-numeric:tabular-nums;
  line-height:1
}
.ck-pill-count{min-width:var(--ck-count-h)}

/* ── Tones. Surface, border and text are one family; text is soft-foreground. ── */
.ck-pill.off,.ck-pill.is-neutral,.ck-badge.is-neutral,.ck-chip.is-neutral{/* pairing-exempt: --muted is a pill tint, not a muted-content surface; --foreground on it is 15.87:1 where --muted-foreground would be 3.16:1 */background:var(--muted);color:var(--foreground);border-color:var(--border)}
.ck-pill.ok,.ck-pill.is-success,.ck-badge.is-success,.ck-chip.is-success{background:var(--success-bg);color:var(--success-soft-foreground);border-color:var(--success-border)}
.ck-pill.warn,.ck-pill.is-warning,.ck-badge.is-warning,.ck-chip.is-warning{background:var(--warning-bg);color:var(--warning-soft-foreground);border-color:var(--warning-border)}
.ck-pill.err,.ck-pill.is-error,.ck-badge.is-error,.ck-chip.is-error{background:var(--destructive-bg);color:var(--destructive-soft-foreground);border-color:var(--destructive-border)}
.ck-pill.info,.ck-pill.is-info,.ck-badge.is-info,.ck-chip.is-info{background:var(--info-bg);color:var(--info-soft-foreground);border-color:var(--info-border)}
.ck-pill.teal,.ck-badge.teal,.ck-chip.teal,.ck-counter.teal{background:var(--teal-bg);color:var(--teal-soft-foreground);border-color:var(--teal-border)}
.ck-pill.cyan,.ck-badge.cyan,.ck-chip.cyan,.ck-counter.cyan{background:var(--cyan-bg);color:var(--cyan-soft-foreground);border-color:var(--cyan-border)}
.ck-pill.indigo,.ck-badge.indigo,.ck-chip.indigo,.ck-counter.indigo{background:var(--indigo-bg);color:var(--indigo-soft-foreground);border-color:var(--indigo-border)}
.ck-pill.pink,.ck-badge.pink,.ck-chip.pink,.ck-counter.pink{background:var(--pink-bg);color:var(--pink-soft-foreground);border-color:var(--pink-border)}
.ck-pill.rose,.ck-badge.rose,.ck-chip.rose,.ck-counter.rose{background:var(--rose-bg);color:var(--rose-soft-foreground);border-color:var(--rose-border)}
.ck-pill.amber,.ck-badge.amber,.ck-chip.amber,.ck-counter.amber{background:var(--amber-bg);color:var(--amber-soft-foreground);border-color:var(--amber-border)}
.ck-pill.lime,.ck-badge.lime,.ck-chip.lime,.ck-counter.lime{background:var(--lime-bg);color:var(--lime-soft-foreground);border-color:var(--lime-border)}
.ck-pill.emerald,.ck-badge.emerald,.ck-chip.emerald,.ck-counter.emerald{background:var(--emerald-bg);color:var(--emerald-soft-foreground);border-color:var(--emerald-border)}
.ck-pill.violet,.ck-badge.violet,.ck-chip.violet,.ck-counter.violet{background:var(--violet-bg);color:var(--violet-soft-foreground);border-color:var(--violet-border)}
.ck-pill.fuchsia,.ck-badge.fuchsia,.ck-chip.fuchsia,.ck-counter.fuchsia{background:var(--fuchsia-bg);color:var(--fuchsia-soft-foreground);border-color:var(--fuchsia-border)}
.ck-pill.sky,.ck-badge.sky,.ck-chip.sky,.ck-counter.sky{background:var(--sky-bg);color:var(--sky-soft-foreground);border-color:var(--sky-border)}
.ck-pill.slate,.ck-badge.slate,.ck-chip.slate,.ck-counter.slate{background:var(--slate-bg);color:var(--slate-soft-foreground);border-color:var(--slate-border)}
.ck-pill.gold,.ck-badge.gold,.ck-chip.gold,.ck-counter.gold{background:var(--gold-bg);color:var(--gold-soft-foreground);border-color:var(--gold-border)}
.ck-pill.crimson,.ck-badge.crimson,.ck-chip.crimson,.ck-counter.crimson{background:var(--crimson-bg);color:var(--crimson-soft-foreground);border-color:var(--crimson-border)}
.ck-pill.sage,.ck-badge.sage,.ck-chip.sage,.ck-counter.sage{background:var(--sage-bg);color:var(--sage-soft-foreground);border-color:var(--sage-border)}
.ck-pill.purple,.ck-badge.purple,.ck-chip.purple,.ck-counter.purple{background:var(--purple-bg);color:var(--purple-soft-foreground);border-color:var(--purple-border)}
.ck-pill.orange,.ck-badge.orange,.ck-chip.orange,.ck-counter.orange{background:var(--orange-bg);color:var(--orange-soft-foreground);border-color:var(--orange-border)}
.ck-pill.blue,.ck-badge.blue,.ck-chip.blue,.ck-counter.blue{background:var(--blue-bg);color:var(--blue-soft-foreground);border-color:var(--blue-border)}

/* ── States. A pill is not interactive by default; these apply once it is
      (a filter chip, a clickable status). Hover and active follow §8. ── */
.ck-pill.is-interactive,.ck-badge.is-interactive,.ck-chip.is-interactive{cursor:pointer}
.ck-pill.is-interactive:hover,.ck-chip.is-interactive:hover{background:var(--hover-bg)}
.ck-pill.is-interactive:active,.ck-chip.is-interactive:active{background:var(--selected-bg)}
/* A chip used as a TOGGLE — a source filter, a facet — needs a state that
   survives the pointer leaving, and :active is not it. aria-pressed is the
   attribute that says so, so it is what the rule keys off: the state cannot be
   styled as pressed while reading as unpressed to a screen reader. The kit's
   selection language is --selected-bg with its own foreground, the same pair
   the tree row and the menu option use. */
.ck-pill.is-interactive[aria-pressed="true"],
.ck-chip.is-interactive[aria-pressed="true"]{
  background:var(--selected-bg);color:var(--selected-fg);
  border-color:var(--selected-fg);font-weight:var(--font-weight-semibold)}
.ck-pill.is-interactive[aria-pressed="true"]:hover,
.ck-chip.is-interactive[aria-pressed="true"]:is(:hover,[data-force~="hover"]){
  background:var(--selected-bg);color:var(--selected-fg)}
.ck-pill.is-interactive:focus-visible,.ck-chip.is-interactive:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-pill[aria-selected="true"],.ck-chip[aria-selected="true"]{background:var(--selected-bg);color:var(--selected-fg);border-color:var(--primary)}
.ck-pill.is-disabled,.ck-badge.is-disabled,.ck-chip.is-disabled,
.ck-pill:disabled,.ck-chip:disabled{
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);
  cursor:not-allowed;pointer-events:none}

/* Dismiss. .ck-icon-btn.size-xs, so it clears the 24x24 WCAG 2.5.8 floor —
   .filter-chip-x was 14px and failed it. The negative margin pulls it into the
   pill's padding so the pill does not grow to accommodate it. */
/* Dismiss inside a pill — an exception to the icon-button tone system.
   It rests in the PILL'S OWN foreground (currentColor, i.e. the tone's
   --*-soft-foreground) rather than in --destructive, so it reads as part of the
   pill instead of as a standing warning. The destructive tokens appear only on
   hover, when the action is actually imminent.

   This is why .tone-danger is wrong here: that tone is destructive at rest.
   The pill's dismiss inverts that — neutral at rest, destructive on approach. */
/* .size-xs is declared later at equal specificity, so it was winning and the
   dismiss computed to 24px inside a 22px pill — taller than the pill, with a
   6px radius inside a fully-round one. The doubled class lifts this to 0-3-0.

   The VISUAL size matches the counter (13 / 16 / 19px) so it fits the pill and
   is round like it. The HIT AREA stays 24x24 via a ::before that overflows the
   visual bounds — WCAG 2.5.8 sizes the target, not the paint, so a small glyph
   with a large target satisfies it. */
.ck-pill .ck-icon-btn,.ck-badge .ck-icon-btn,.ck-chip .ck-icon-btn,
.ck-pill .ck-icon-btn.size-xs,.ck-badge .ck-icon-btn.size-xs,.ck-chip .ck-icon-btn.size-xs{
  position:relative;
  margin-inline-end:calc(-1 * var(--ck-pill-gap));
  width:var(--ck-count-h);height:var(--ck-count-h);
  border-radius:var(--radius-sm);
  color:inherit;
  --ck-icon-hover:var(--destructive-bg);
  --ck-icon-hover-fg:var(--destructive-soft-foreground)}
.ck-pill .ck-icon-btn::before,.ck-badge .ck-icon-btn::before,.ck-chip .ck-icon-btn::before{
  content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:24px;height:24px;border-radius:var(--radius-sm)}
/* Hover must be declared at pill specificity. The rule above is 0-3-0
   (.ck-pill .ck-icon-btn.size-xs) and .ck-icon-btn:hover is only 0-2-0, so
   `color:inherit` was winning on hover and the destructive colour never
   appeared — resting and hover rendered identically. */
.ck-pill .ck-icon-btn:hover,.ck-badge .ck-icon-btn:hover,.ck-chip .ck-icon-btn:hover,
.ck-pill .ck-icon-btn.size-xs:hover,.ck-badge .ck-icon-btn.size-xs:hover,
.ck-chip .ck-icon-btn.size-xs:is(:hover,[data-force~="hover"]){
  background:var(--destructive-bg);color:var(--destructive-soft-foreground)}

/* Active goes to the SOLID destructive pair, not --destructive-border:
   in high contrast --destructive-border and --destructive-soft-foreground are
   the same colour, so the icon vanished on its own fill at 1.0:1. The solid
   pair also reads as a firmer press. */
.ck-pill .ck-icon-btn:active,.ck-badge .ck-icon-btn:active,.ck-chip .ck-icon-btn:active,
.ck-pill .ck-icon-btn.size-xs:active,.ck-badge .ck-icon-btn.size-xs:active,
.ck-chip .ck-icon-btn.size-xs:active{
  background:var(--destructive);color:var(--destructive-foreground)}
.ck-pill .ck-icon-btn:focus-visible,.ck-badge .ck-icon-btn:focus-visible,
.ck-chip .ck-icon-btn:focus-visible{box-shadow:var(--focus-ring-error)}
.ck-pill.is-disabled .ck-icon-btn,.ck-chip.is-disabled .ck-icon-btn{color:var(--muted-foreground)}
/* A dismiss inside a pill is the ONE place the 16px glyph does not apply, and
   it is derived rather than picked: the glyph is the dismiss button's own size
   less 4px, so there are exactly 2px of clear space on every side at every
   pill size — 8px in 12px, 12px in 16px, 16px in 20px.

   A flat --icon-size here put a 16px cross in a 16px button, edge to edge:
   the cross touched the button's bounds, read a size too large for a 24px
   chip, and broke § 14.3 check 11 ("icons keep their buffer"). The kit's
   "16px glyph everywhere" rule is about icons laid out in their own box; a
   glyph living inside a control takes that control's padding, and a 16px-tall
   control has none to give.

   The HIT AREA is unaffected — it stays 24x24 on the ::before, which
   overflows the paint box, because WCAG 2.5.8 sizes the target and not the
   paint. */
.ck-pill .ck-icon-btn svg,.ck-chip .ck-icon-btn svg,.ck-badge .ck-icon-btn svg,
.ck-pill .ck-icon-btn.size-xs svg,.ck-chip .ck-icon-btn.size-xs svg,
.ck-badge .ck-icon-btn.size-xs svg{
  width:calc(var(--ck-count-h) - var(--space-xs));
  height:calc(var(--ck-count-h) - var(--space-xs))}

/* ─── FULFILMENT STATUS (Molecule) — .ck-fulfil ────────────────────────────
   A quantity, and under it what is still true about that quantity: a delta
   counter plus a one-word state. It is the pattern a reconciliation line uses
   in the product, and it is NOT a badge with a label inside.

   THE LABEL IS PLAIN TONE-COLOURED TEXT, NOT A PILL. Wrapping the word in a
   filled pill and putting the count inside it, which is what this used to be,
   made two different facts look like one object — and a row of them read as a
   wall of tinted rectangles rather than a column of numbers you can scan. The
   number is the data; the counter is the delta; the word says which.

   FULFILLED CARRIES NO COUNTER. Its delta is zero by definition, and a chip
   reading "0" is noise the reader has to interpret. The absence of a counter
   IS the signal, and the word still says it in full.

   Tones map to the semantic families: remaining is destructive (work
   outstanding), excess is --violet (over-delivery — neither good nor an
   error, and it must not be confused with either), fulfilled is success. */
.ck-fulfil{display:inline-flex;flex-direction:column;gap:var(--space-2xs);min-width:0}
.ck-fulfil-qty{
  font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);
  color:var(--foreground);font-variant-numeric:tabular-nums;line-height:1.2}
/* An unknown quantity is an em dash in --muted-foreground, never an empty
   cell: blank reads as "nothing here", the dash reads as "not known yet". */
.ck-fulfil-qty.is-unknown{color:var(--muted-foreground)}
.ck-fulfil-state{display:inline-flex;align-items:center;gap:var(--space-xs);min-width:0}
.ck-fulfil-count{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  min-width:20px;height:20px;padding:0 var(--space-xs);
  border:1px solid transparent;border-radius:var(--radius-sm);
  font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);
  font-variant-numeric:tabular-nums;line-height:1}
.ck-fulfil-label{
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* --radius-sm, not --radius-full: this is a small numeric chip beside text,
   not a status pill, and a full round on a 20px box makes the digits look
   squeezed against the ends. */
.ck-fulfil.is-remaining .ck-fulfil-count{
  background:var(--destructive-bg);color:var(--destructive-soft-foreground);border-color:var(--destructive-border)}
.ck-fulfil.is-remaining .ck-fulfil-label{color:var(--destructive-soft-foreground)}
.ck-fulfil.is-excess .ck-fulfil-count{
  background:var(--violet-bg);color:var(--violet-soft-foreground);border-color:var(--violet-border)}
.ck-fulfil.is-excess .ck-fulfil-label{color:var(--violet-soft-foreground)}
.ck-fulfil.is-fulfilled .ck-fulfil-label{color:var(--success-soft-foreground)}

/* The delta chooser between two quantities — a dashed outline says "this is
   editable and not yet committed", which a solid stroke does not. */
.ck-fulfil-delta{
  display:inline-flex;align-items:center;gap:var(--space-xs);box-sizing:border-box;
  height:28px;padding:0 var(--space-sm);
  border:1px dashed var(--input);border-radius:var(--radius-md);
  background:var(--background);color:var(--foreground);
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);
  font-variant-numeric:tabular-nums;cursor:pointer;
  transition:border-color var(--duration-base),background var(--duration-base)}
.ck-fulfil-delta:is(:hover,[data-force~="hover"]){border-color:var(--primary);background:var(--hover-bg)}
.ck-fulfil-delta:focus-visible{outline:0;border-color:var(--primary);box-shadow:var(--focus-ring)}
.ck-fulfil-delta > svg{width:var(--icon-size);height:var(--icon-size);flex:none;color:var(--muted-foreground)}

/* ── Standalone counter and status ──
      Same protocol as the pill's own, so a counter in a nav item and a counter
      inside a badge are the same shape, height and treatment.

      A COUNTER IS BUILT LIKE A BADGE: three tokens, one per job — a
      `-bg` surface, a `-soft-foreground` numeral, a `-border` stroke. It used
      to be a transparent circle with `border: 1px solid currentColor`, which
      made one colour do all three and left the surface inherited from whatever
      was behind it. That is a Law 3 break, and it also read as an outlined
      ring rather than as the same object a badge is.

      Every tone's numeral clears AA on its own fill: success 4.72:1, warning
      4.51:1, error 4.58:1, info 4.63:1, neutral 14.56:1. */
.ck-counter{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  min-width:20px;height:20px;padding:0 6px;
  /* The stroke is --input, and that is a considered choice. A counter is a
     20px circle whose fill is --muted at 1.04:1 against a white page, so the
     EDGE is what gives the mark a shape at all. --border is #f5f5f5 in light —
     the same value as the fill, so it drew nothing — and --panel-border is
     1.16:1, barely better. --input is 3.17:1, and § 4 already assigns it to
     "form control borders and any unlabelled control surface", which is what
     this edge is. A toned counter needs none of this: it takes its own
     -border step, which is a real tint of its own tone. */
  border:1px solid var(--input);border-radius:var(--radius-full);
  background:var(--muted);color:var(--foreground)/* pairing-exempt: --muted is a counter tint, not a muted-content surface; --foreground on it is 14.56:1 where the nominal --muted-foreground partner is 3.16:1 — the same declared cross-pair .ck-pill.is-neutral carries */;
  font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);font-variant-numeric:tabular-nums;line-height:1}
.ck-counter.size-sm{min-width:16px;height:16px;padding:0 4px;font-size:var(--text-2xs)}
.ck-counter.size-lg{min-width:24px;height:24px;padding:0 7px;font-size:var(--text-md)}

/* ── A FIXED BADGE FOOTPRINT — .ck-pill.is-fixed ──────────────────────────
   150 x 24, so badges stacked down a table column sit on one vertical line
   instead of stepping in and out with their text. Applied automatically to
   any pill inside a table cell, and available by hand as .is-fixed.

   It is NOT the atom's default, and that is deliberate: a filter chip, a menu
   badge and a status in a card are all sized by their content, and forcing
   150px on them would leave a row of half-empty capsules. The rule exists to
   solve alignment in a column, so it applies where there IS a column.

   The label truncates from the MIDDLE — "Missin…eact" — because the tail of a
   status is usually what distinguishes it. ckMiddleTruncate() measures the
   real font against the real width, so the cut is exact at any size, and it
   keeps the full string in title= for hover. Every gap inside stays on the
   4px grid. */
.ck-pill.is-fixed,
.ck-table td .ck-pill,
.ck-table td .ck-badge{
  width:150px;min-width:150px;max-width:150px;height:24px;
  justify-content:flex-start;gap:var(--space-xs);
  padding-inline:var(--space-sm)}
.ck-pill.is-fixed > .ck-pill-label,
.ck-table td .ck-pill > .ck-pill-label,
.ck-table td .ck-badge > .ck-pill-label{
  flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:clip}
/* A counter keeps its own size: it is a number, not a label, and stretching
   it to 150px would put a 2-digit count in a capsule wider than the cell. */
.ck-table td .ck-counter{width:auto;min-width:20px;max-width:none}
.ck-counter.is-success{background:var(--success-bg);color:var(--success-soft-foreground);border-color:var(--success-border)}
.ck-counter.is-warning{background:var(--warning-bg);color:var(--warning-soft-foreground);border-color:var(--warning-border)}
.ck-counter.is-error{background:var(--destructive-bg);color:var(--destructive-soft-foreground);border-color:var(--destructive-border)}
.ck-counter.is-info{background:var(--info-bg);color:var(--info-soft-foreground);border-color:var(--info-border)}
/* The one place a counter keeps a transparent surface: sitting ON a --primary
   fill, where borrowing that fill is the point. Both the numeral and the
   stroke are the fill's own partner. */
.ck-counter.on-primary{
  background:transparent;color:var(--primary-foreground);
  border-color:var(--primary-foreground)/* pairing-exempt: deliberately borrows the --primary fill it sits on as its surface; the numeral is that fill's declared partner at 12.01:1 */}

.ck-status{display:inline-flex;align-items:center;gap:6px;font:var(--font-weight-medium) var(--text-md) var(--font-sans);color:var(--foreground)}
.ck-status.size-sm{font-size:var(--text-sm);gap:5px}
.ck-status.size-lg{font-size:var(--text-base);gap:7px}
.ck-status-dot{width:8px;height:8px;flex:none;border-radius:var(--radius-full);background:var(--muted-foreground)/* pairing-exempt: carries no text */}
.ck-status.size-sm .ck-status-dot{width:6px;height:6px}
.ck-status.size-lg .ck-status-dot{width:10px;height:10px}
.ck-status.is-success .ck-status-dot{background:var(--success-soft-foreground)/* pairing-exempt: carries no text */}
.ck-status.is-warning .ck-status-dot{background:var(--warning-soft-foreground)/* pairing-exempt: carries no text */}
.ck-status.is-error .ck-status-dot{background:var(--destructive-soft-foreground)/* pairing-exempt: carries no text */}
.ck-status.is-info .ck-status-dot{background:var(--info-soft-foreground)/* pairing-exempt: carries no text */}
.ck-status.is-neutral .ck-status-dot{background:var(--muted-foreground)/* pairing-exempt: carries no text */}

/* ─── TABS (Organism) ─── */
/* Fixed height so a tab bar is the same height wherever it appears, and a
   16px gutter to match every other container edge. */
/* ─── TABS (Molecule) ──────────────────────────────────────────────────────
   A tab bar is a structural strip, not a control in a row, so it has its own
   height scale rather than the control scale (Rulebook §7a).

   The active indicator is --primary at 12:1, which is what conveys selection.
   The rail behind it is --panel-border: a visible structural stroke per §5,
   not the near-invisible --border it used to be.

   Spec: references/components/tabs.md */
.ck-tabs{
  display:flex;align-items:stretch;box-sizing:border-box;flex-shrink:0;
  height:44px;padding:0 16px;gap:0;
  border-bottom:2px solid var(--panel-border)
}
.ck-tabs.size-sm{height:36px;padding:0 12px}
.ck-tabs.size-sm .ck-tab{padding:0 12px;font-size:var(--text-md)}

.ck-tab{
  display:inline-flex;align-items:center;height:100%;padding:0 16px;
  font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--muted-foreground);
  border:0;background:0;cursor:pointer;position:relative;
  transition:color var(--duration-base),background var(--duration-base)
}
/* A LONG TAB LABEL TRUNCATES FROM THE MIDDLE — "Newtab…showup" — and shows
   the full text on hover. A tab names a destination, and the end of that name
   is as likely to distinguish it as the start ("Invoices — Q3" against
   "Invoices — Q4"), so cutting only the tail would make two tabs identical.
   The cap is a max-width, not a fixed one: a short label still shrinks to fit
   its own text. */
.ck-tab{max-width:180px}
.ck-tab > .ck-mid-trunc{display:block;min-width:0;overflow:hidden;white-space:nowrap}
.ck-tab:hover{color:var(--foreground);background:var(--hover-bg)}
.ck-tab:active{background:var(--selected-bg)}

/* Selected. Driven by aria-selected so the visual cannot drift from what a
   screen reader announces; .active is kept as a transitional alias. */
.ck-tab[aria-selected="true"],.ck-tab.active{color:var(--primary);font-weight:600}
.ck-tab[aria-selected="true"]::after,.ck-tab.active::after{
  content:'';position:absolute;left:0;right:0;bottom:-2px;height:2px;background:var(--primary)/* pairing-exempt: carries no text */}

.ck-tab:disabled,.ck-tab[aria-disabled="true"]{
  color:var(--input);cursor:not-allowed;pointer-events:none;background:0
}
.ck-tab:focus-visible{outline:0;box-shadow:var(--focus-ring)}

/* A count or badge riding along in the label. */
.ck-tab .ck-pill{margin-inline-start:6px}

/* ── Icons in a tab label — either side, or both ──
   The glyph is --icon-size like every other icon, and the gap is the label's
   own. A leading glyph classifies the tab; a trailing one points at what
   selecting it does. Put a count in a badge, never in a glyph. */
.ck-tab{gap:var(--space-sm)}
.ck-tab > svg{width:var(--icon-size);height:var(--icon-size);flex:none;stroke-width:var(--icon-stroke)}

/* ── STROKE WIDTHS, stated once ──
   underline rail        2px  --panel-border
   underline indicator   2px  --primary, sitting IN the rail's own band
   segmented outer edge  1px  --input
   segmented divider     1px  --input
   pill trough           0    a fill, no stroke
   pill active plate     1px  --panel-border, plus --shadow-raised
   Anything thicker reads as a structural rule; anything thinner disappears
   against the page. */
.ck-tabs{--ck-tab-rail:2px}
.ck-tabs{border-bottom-width:var(--ck-tab-rail)}
/* NO GAP between the indicator and the separator. The indicator is pulled up
   by exactly the rail's thickness, so it occupies the rail's band rather than
   sitting below it — the two are one continuous 2px line, and the active tab's
   segment of it is --primary. Offsetting by anything other than
   --ck-tab-rail leaves either a hairline of --panel-border showing through or
   a 1px step where the colours meet. */
.ck-tab[aria-selected="true"]::after,.ck-tab.active::after{
  bottom:calc(-1 * var(--ck-tab-rail));height:var(--ck-tab-rail)}

/* ─── PILL TABS — .ck-tabs.is-pill ────────────────────────────────────────
   A recessed trough with the active tab raised out of it. Use it for
   switching between peer views of the same data, where none of them is a
   "page" — the underline variant implies a section, this one implies a mode.

   Selection is carried three ways, not one: the plate lifts to --background,
   the label goes from --segment-foreground to --foreground, and the weight
   goes semibold. The plate alone is only 1.13:1 against the trough, so on
   colour it would be no signal at all. */
.ck-tabs.is-pill{
  display:inline-flex;height:auto;padding:var(--space-xs);gap:var(--space-2xs);
  border:0;border-radius:var(--radius-md);
  background:var(--segment);color:var(--segment-foreground)}
.ck-tabs.is-pill .ck-tab{
  height:28px;padding:0 var(--space-md);border-radius:var(--radius-sm);
  color:var(--segment-foreground)}
.ck-tabs.is-pill.size-lg .ck-tab{height:36px;padding:0 var(--space-base)}
.ck-tabs.is-pill .ck-tab:is(:hover,[data-force~="hover"]){background:var(--hover-bg);color:var(--foreground)}
.ck-tabs.is-pill .ck-tab:is([aria-selected="true"],.active){
  background:var(--background);color:var(--foreground);
  border:1px solid var(--panel-border);box-shadow:var(--shadow-raised);
  font-weight:var(--font-weight-semibold)}
/* The underline indicator is the other variant's mechanism; a pill must not
   also grow a bar. */
.ck-tabs.is-pill .ck-tab:is([aria-selected="true"],.active)::after{display:none}
.ck-tabs.is-pill .ck-tab:is(:disabled,[aria-disabled="true"]){background:0;color:var(--input)}

/* ─── SEGMENTED / BORDERED TABS — .ck-tabs.is-segmented ───────────────────
   One bordered block divided into segments, the active one filled solid. Use
   it for a small closed set of mutually exclusive choices — Day / Week /
   Month / Year — where the options are a scale rather than destinations.

   Selection here CAN rest on the fill, because --primary-foreground on
   --primary is 12.01:1 and the fill is a genuine surface change, not a tint. */
.ck-tabs.is-segmented{
  display:inline-flex;height:auto;padding:0;gap:0;overflow:hidden;
  border:1px solid var(--input);border-radius:var(--radius-md);
  background:var(--background);color:var(--foreground)}
.ck-tabs.is-segmented .ck-tab{
  height:36px;padding:0 var(--space-base);border-radius:0;
  color:var(--foreground)}
.ck-tabs.is-segmented.size-sm .ck-tab{height:28px;padding:0 var(--space-md);font-size:var(--text-md)}
.ck-tabs.is-segmented .ck-tab + .ck-tab{border-inline-start:1px solid var(--input)}
.ck-tabs.is-segmented .ck-tab:is(:hover,[data-force~="hover"]){background:var(--hover-bg);color:var(--primary)}
.ck-tabs.is-segmented .ck-tab:is([aria-selected="true"],.active){
  background:var(--primary);color:var(--primary-foreground);
  font-weight:var(--font-weight-semibold)}
.ck-tabs.is-segmented .ck-tab:is([aria-selected="true"],.active)::after{display:none}
.ck-tabs.is-segmented .ck-tab:is(:disabled,[aria-disabled="true"]){background:var(--muted);color:var(--muted-foreground)}
/* Focus is inset on both of these, because the strip clips its overflow and an
   outer ring would be cut off by the rounded corner. */
.ck-tabs.is-pill .ck-tab:focus-visible,
.ck-tabs.is-segmented .ck-tab:focus-visible{
  outline:0;box-shadow:inset 0 0 0 2px var(--primary)}

/* ── Panel connected to an underline bar ──
   The panel's top edge IS the tab rail, so they must not both draw one. */
.ck-tab-panel{
  padding:var(--space-base);box-sizing:border-box;
  border:1px solid var(--panel-border);border-top:0;
  border-end-start-radius:var(--radius-md);border-end-end-radius:var(--radius-md);
  background:var(--card);color:var(--card-foreground)}
.ck-tab-panel[hidden]{display:none}

/* ─── EMPTY STATE (Molecule) ─── */
/* ─── EMPTY STATE (Molecule) ───────────────────────────────────────────────
   Structure, not just centred text: a glyph, a title, a line of explanation,
   and one action. An empty state with no action is a dead end.

   Spec: references/components/empty-state.md */
.ck-empty{/* pairing-exempt: empty-state copy is deliberately de-emphasised; --muted-foreground on --background is 3.44:1 */
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:36px 16px;text-align:center;
  color:var(--muted-foreground);font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  background:var(--background);border-radius:var(--radius-2xl);
  border:1px dashed var(--input)}
.ck-empty.size-sm{padding:20px 12px;gap:6px}
.ck-empty.size-lg{padding:56px 24px;gap:12px}
.ck-empty-icon{width:32px;height:32px;color:var(--input)}
.ck-empty-icon svg{width:32px;height:32px;display:block}
.ck-empty-title{font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--foreground)}
.ck-empty-msg{max-width:44ch}
.ck-empty-action{margin-top:6px}
/* A field the caller has already decided — shown, explained, not editable. */
.ck-field.is-locked .ck-input,.ck-field.is-locked .ck-select{background:var(--muted);color:var(--muted-foreground);cursor:not-allowed}

/* ─── SEARCHABLE DROPDOWN (Organism) ──────────────────────────────────────
   Trigger + filterable panel. Behaviour lives in clipper-dropdown.js; link
   both to use it. Replaces a native <select> wherever the option list is
   long enough that scanning it is slower than typing. */
.ck-dd{position:relative;width:100%}
/* The trigger is a variant of the field base above, not a copy of it. It
   overrides only what a button genuinely differs in: it lays its value and
   chevron out as a row, and it is clickable. Everything else — height,
   padding, type, colours, stroke, radius, transition — comes from the base,
   so the family cannot drift the way it did when .ck-search re-declared the
   input and then missed aria-invalid, :disabled and ::placeholder. */
.ck-dd-trigger{
  display:flex;align-items:center;gap:8px;
  cursor:pointer;text-align:left}
/* data-force~="hover|active|focus|disabled" paints a state without the user
   being in it, so a spec sheet renders the full state set from the kit's OWN
   rules instead of re-declaring them in page CSS (§ 12.1). Documentation only.
   Same hook the Switch carries. */
/* Sizes — kept identical to .ck-input so a dropdown and a text field in
   the same .ck-field-grid line up. */
.ck-dd.size-sm .ck-dd-trigger{height:28px;padding:0 9px;font-size:var(--text-md)}
.ck-dd.size-lg .ck-dd-trigger{height:44px;padding:0 13px}
:is(.ck-dd-trigger:disabled,.ck-dd-trigger[aria-disabled="true"],.ck-dd-trigger[data-force~="disabled"]){
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);cursor:not-allowed}
.ck-dd-trigger:disabled,.ck-dd-trigger[aria-disabled="true"]{pointer-events:none}
:is(.ck-dd-trigger:disabled,.ck-dd-trigger[aria-disabled="true"],.ck-dd-trigger[data-force~="disabled"]) .ck-dd-arrow{
  color:var(--muted-foreground)}
:is(.ck-dd-trigger:active,.ck-dd-trigger[data-force~="active"]){background:var(--hover-bg)/* pairing-exempt: re-asserts the surface only; the base rule owns the colour */}
:is(.ck-dd-trigger:focus-visible,.ck-dd-trigger[data-force~="focus"]),.ck-dd.open .ck-dd-trigger{outline:0;border-color:var(--primary);box-shadow:var(--focus-ring)}
/* Invalid focus takes the error ring, like every other field control (§ 14.9). */
:is(.ck-dd-trigger[aria-invalid="true"]:focus-visible,.ck-dd-trigger[aria-invalid="true"][data-force~="focus"]){
  border-color:var(--destructive);box-shadow:var(--focus-ring-error)}
.ck-dd-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-dd-value.is-placeholder{color:var(--muted-foreground)}
/* A dropdown's clear behaves exactly like a field's: hidden until the trigger
   is hovered or focused, and only when something is selected. It sits inboard
   of the chevron, the same order a search box uses. */
.ck-dd-clear{
  position:absolute;z-index:1;
  /* Inboard of the chevron: 11px of trigger padding, the 16px glyph, and 2px
     so the two 24px hit targets do not overlap. It is
     a sibling of the trigger, never a child — a button inside a button is
     invalid markup, and the parser would lift it straight back out. Centred by
     inset + auto margins, never by transform, because the chevron's rotation
     already owns transform on this row. */
  inset-inline-end:29px;inset-block:0;margin-block:auto;
  display:grid;place-items:center;width:24px;height:24px;
  border:0;background:0;border-radius:var(--radius-sm);
  color:var(--muted-foreground);cursor:pointer;
  opacity:0;pointer-events:none;transition:opacity var(--duration-base)}
.ck-dd.size-sm .ck-dd-clear{inset-inline-end:27px}
.ck-dd.size-lg .ck-dd-clear{inset-inline-end:31px}
/* The clear's lane is held open inside the value whether the clear is showing
   or not, so a long label ellipsises short of it and revealing it on hover
   never nudges the text. */
.ck-dd.has-value .ck-dd-value{padding-inline-end:20px}
.ck-dd-clear svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-dd-clear:hover{background:var(--hover-bg);color:var(--foreground)}
.ck-dd-clear:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-dd.has-value:hover .ck-dd-clear,
.ck-dd.has-value:focus-within .ck-dd-clear,
.ck-dd.has-value[data-force~="hover"] .ck-dd-clear{opacity:1;pointer-events:auto}

/* The stroked chevron is the dropdown's one visual addition to the field
   base, so it takes the product's standard glyph size like every other icon. */
.ck-dd-arrow{width:var(--icon-size);height:var(--icon-size);flex:none;color:var(--muted-foreground);transition:transform var(--duration-base)}
/* The class normally goes ON the svg. When markup wraps it in a span instead,
   the class sizes the SPAN and the svg inside inherits nothing — an unsized
   <svg> in a flex row expands to fill the line, and the chevron renders at the
   full width of the field. That is not hypothetical: it is the defect the kit
   already recorded once for the multi-select trigger, and it came back the
   moment a second author wrote the wrapper form. Sizing the child here makes
   both markup forms correct, so it cannot come back a third time. */
.ck-dd-arrow > svg{width:var(--icon-size);height:var(--icon-size);display:block}
/* The chevron turns CLOCKWISE in both directions. A two-state transition
   cannot do that: with closed at 0deg and open at 180deg, closing interpolates
   180 -> 0 and reads as counter-clockwise. So opening and closing are separate
   keyframes, and ClipperDropdown adds .is-closing for the duration of the
   close. Closing runs 180 -> 360, which is clockwise. */
@keyframes ck-chev-open{from{transform:rotate(0deg)}to{transform:rotate(180deg)}}
@keyframes ck-chev-close{from{transform:rotate(180deg)}to{transform:rotate(360deg)}}
.ck-dd-arrow{transform:rotate(0deg)}
.ck-dd.open .ck-dd-arrow{animation:ck-chev-open var(--duration-moderate) var(--ease-default) forwards}
.ck-dd.is-closing .ck-dd-arrow{animation:ck-chev-close var(--duration-moderate) var(--ease-default) forwards}

.ck-dd-panel{position:absolute;z-index:var(--z-dropdown);left:0;right:0;top:calc(100% + 4px);display:none;flex-direction:column;background:var(--popover);color:var(--popover-foreground);border:1px solid var(--panel-border);border-radius:var(--radius-2xl);box-shadow:var(--shadow-panel);overflow:hidden}
/* Portalled to <body>: fixed, above dialogs and drawers, never clipped by a
   scrolling ancestor and never part of the layout. */
.ck-dd-panel.is-portal{position:fixed;right:auto;top:auto;z-index:calc(var(--z-toast) + 10);display:flex}
.ck-dd.open .ck-dd-panel{display:flex}
.ck-dd.drop-up .ck-dd-panel{top:auto;bottom:calc(100% + 4px)}
/* Also the .ck-search molecule; this only places it. See the note on
   .ck-menu-search above. */
.ck-dd-search{padding:8px;border-bottom:1px solid var(--border);flex:none}
.ck-dd-search > .ck-search{display:block}
.ck-dd-opt{width:100%;display:flex;align-items:center;gap:8px;padding:7px 9px;border:0;background:0;border-radius:var(--radius-sm);font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground);cursor:pointer;text-align:left}
:is(.ck-dd-opt:hover,.ck-dd-opt.active,.ck-dd-opt[data-force~="hover"]){background:var(--hover-bg)}
.ck-dd-opt.selected{background:var(--selected-bg);color:var(--selected-fg);font-weight:600}
/* The option row was missing three of its six states (§ 14.3 check 4): no
   pressed, no focus-visible and no disabled, where .ck-menu-item and .ck-pick
   — the same shape of control — carry all three. Focus is an INSET rule for
   the same reason theirs is: a 3px outer ring is clipped by the list's 4px
   padding and reads as a smudge. */
:is(.ck-dd-opt:active,.ck-dd-opt[data-force~="active"]){
  background:var(--selected-bg);color:var(--selected-fg)}
:is(.ck-dd-opt:focus-visible,.ck-dd-opt[data-force~="focus"]){
  outline:0;background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
:is(.ck-dd-opt:disabled,.ck-dd-opt[aria-disabled="true"],.ck-dd-opt[data-force~="disabled"]){
  color:var(--input);background:0;cursor:not-allowed}
:is(.ck-dd-opt:disabled,.ck-dd-opt[aria-disabled="true"]){pointer-events:none}
.ck-dd-opt mark{background:var(--highlight-bg);color:inherit;border-radius:var(--radius-xs);padding:0 1px}
.ck-dd-opt-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-dd-opt.selected 

/* ═══ SEARCHABLE DROPDOWN — THE TWO MULTI FORMS ════════════════════════════
   Multi-select is not a separate component. It is a .ck-dd whose options are
   checkable, and it was a separate organism only by accident of history: it
   had grown its own trigger, its own option row and its own focus ring, all
   parallel to the dropdown's and already drifting from them. One parent means
   the panel, the search row, the empty state and every field state are defined
   once.

     .ck-dd.is-multi    The FIELD form. A trigger showing what is chosen as
                        chips, a checkable list, and a footer to commit.
     .ck-dd.is-picker   The PANEL form, always open. A title, a search, the
                        chosen set as chips with Clear all beside them, a
                        select-all band over a bordered list, and a footer.
                        For when choosing IS the task rather than one field
                        in a form.

   THE OPTION ROW IS A <label>, NOT A <button>. It was a button wrapping an
   <input class="ck-check"> — invalid, because a button may not contain
   interactive content, and browsers only vary in how they cope. It also meant
   clicking the row did nothing: the row and its checkbox were two separate
   targets, and only the 16px box worked.

   A label makes the whole row the checkbox's target natively — no JS, no click
   handler, nothing that can desync from the input's real state. It also makes
   the ARIA honest: a multi-select list is a group of checkboxes ("several of
   these can be true"), not a listbox, and each row announces as
   "<name>, checkbox, checked".

   Spec: references/components/dropdown.md */

/* ── The row, shared by both forms and by the single-select list ── */
.ck-dd-opt.has-check{gap:var(--space-sm);align-items:center}
.ck-dd-opt.has-check > .ck-check{flex:none}
/* The row lays the checkbox out and sets NO width, height or border on it, so
   the Checkbox atom stays the single definition of what a checkbox looks like.
   Sizing it here is the v2.0 defect the June feedback flagged. */

/* ── .is-multi — the field form ── */
/* THE MULTI TRIGGER IS A div[role="combobox"], NOT A <button>. Its chips carry
   dismiss buttons, and a button may not contain a button — the parser closes
   the outer one at the first nested <button>, so the trigger ended after the
   first chip and every chip, glyph and arrow after it spilled onto the page
   below. ARIA 1.2 puts role="combobox" on exactly this kind of element, so the
   correct markup is also the valid one. ckMultiTrigger() gives it the keyboard
   a button would have had. */
.ck-dd.is-multi .ck-dd-trigger{height:auto;min-height:36px;padding:var(--space-2xs) var(--space-md)}
.ck-dd.is-multi .ck-dd-trigger:focus-visible{outline:0;border-color:var(--primary);box-shadow:var(--focus-ring)}
.ck-dd.is-multi.size-sm .ck-dd-trigger{min-height:28px;padding:0 var(--space-sm)}
.ck-dd.is-multi.size-lg .ck-dd-trigger{min-height:44px;padding:var(--space-xs) var(--space-md)}
.ck-dd-tags{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-xs);flex:1;min-width:0}
.ck-dd-foot{
  display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);
  padding:var(--space-sm);border-top:1px solid var(--border);flex:none}

/* ── .is-picker — the panel form ── */
.ck-dd.is-picker{
  position:static;
  display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground)}
.ck-dd-picker-head{
  display:flex;align-items:center;gap:var(--space-md);flex:none;
  padding:var(--space-base) var(--space-base) var(--space-md)}
.ck-dd-picker-title{
  flex:1;min-width:0;
  font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);
  color:var(--card-foreground);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-dd-picker-body{
  display:flex;flex-direction:column;gap:var(--space-md);min-height:0;
  padding:0 var(--space-base) var(--space-base)}
/* The chips row owns Clear all. It belongs beside the thing it clears, not up
   in the title: a title says what the panel IS, and an action parked there
   reads as applying to the whole panel rather than to the chosen set. It also
   only has anything to do when there are chips, so it lives where they do. */
.ck-dd-picker-chips{
  display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-xs)}
.ck-dd-picker-chips > .ck-btn{margin-inline-start:auto;flex:none}
.ck-dd-picker-chips:empty{display:none}
/* The list is its own bordered container, so the select-all band and the rows
   read as one block rather than as items floating on the panel. */
.ck-dd-picker-list{
  display:flex;flex-direction:column;min-height:0;overflow:hidden;
  border:1px solid var(--panel-border);border-radius:var(--radius-md);
  background:var(--background);color:var(--foreground)}
.ck-dd-picker-all{/* pairing-exempt: --muted is a header band, not a muted-content surface; --foreground on it is 15.87:1 where the nominal --muted-foreground partner is 3.16:1 */
  display:flex;align-items:center;gap:var(--space-sm);flex:none;
  min-height:44px;padding:var(--space-sm) var(--space-md);
  background:var(--muted);color:var(--foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  cursor:pointer}
.ck-dd-picker-all .ck-check{flex:none}
.ck-dd-picker-scroll{overflow-y:auto;min-height:0;max-height:320px}
/* Rows sit flush and are separated by a hairline, not by a gap or a radius. */
.ck-dd-picker-list .ck-dd-opt{
  border-radius:0;min-height:44px;
  padding:var(--space-sm) var(--space-md);
  border-top:1px solid var(--border)}
/* In the picker the CHECKBOX carries selection, so a chosen row is not also
   tinted and bolded. The field form keeps both, because there the row is the
   only thing that shows state. Tinting every chosen row in a long list makes
   it stripey and doubles an indicator that is already unambiguous. Hover and
   focus still respond, so the row remains legible as a target. */
.ck-dd-picker-list .ck-dd-opt:is([aria-selected="true"],.selected,:has(> .ck-check:checked)){
  background:transparent;color:var(--foreground);font-weight:var(--font-weight-normal)}
.ck-dd-picker-list .ck-dd-opt:is(:hover,[data-force~="hover"]){background:var(--hover-bg)}
/* A label cannot take :focus-visible for its own control, so the ring is drawn
   when the checkbox inside it has focus. Inset, because a 3px outer ring is
   clipped by the list's own overflow. */
.ck-dd-opt:has(> .ck-check:focus-visible){
  background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
.ck-dd-picker-foot{
  display:flex;align-items:center;justify-content:flex-end;gap:var(--space-sm);flex:none;
  padding:var(--space-md) var(--space-base);border-top:1px solid var(--border)}
.ck-dd-none{padding:16px 10px;text-align:center;font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}

/* ─── LOADERS (Atoms) ─────────────────────────────────────────────────────
   Same look and feel as the loaders in clipper-kit-v2.0.html and
   clipper-molecules-v2.html: a border spinner and a shimmering skeleton.
   Keyframes are ck- prefixed on purpose — flows already define their own
   `spin` and `shimmer` with different directions, and an unprefixed
   keyframe in this shared file would silently retime every one of them. */
@keyframes ck-spin{to{transform:rotate(360deg)}}
@keyframes ck-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}

/* ─── SPINNER / SKELETON (Atoms) ───────────────────────────────────────────
   Spinner track is --skeleton-sheen, the same value the skeleton sweeps
   through, so the whole loading family reads as one thing. It was --input — a
   control-border grey at 3.17:1 — which made the ring compete with the arc
   that actually carries the motion. The arc stays --primary at 12.01:1, and
   that is the affordance; the track is context, exactly as with the progress
   bar. It is deliberately quiet, not invisible.

   Spec: references/components/feedback.md */
.ck-spinner{display:inline-block;/* without this it is inline, so width/height
     are ignored and a standalone spinner renders 4px wide */
  /* Tracks --icon-box: a spinner swapped in where an icon was must not resize
     the row it sits in. */
  width:var(--icon-box);height:var(--icon-box);flex:none;box-sizing:border-box;
  border:2px solid var(--skeleton-sheen);border-top-color:var(--primary);
  border-radius:var(--radius-full);animation:ck-spin .8s linear infinite}
.ck-spinner.size-sm,.ck-spinner.sm{width:16px;height:16px;border-width:2px}
.ck-spinner.size-lg,.ck-spinner.lg{width:28px;height:28px;border-width:3px}

.ck-skeleton{/* pairing-exempt: carries no text */
  background:linear-gradient(90deg,var(--muted) 25%,var(--skeleton-sheen) 50%,var(--muted) 75%);
  background-size:200% 100%;animation:ck-shimmer 1.5s ease-in-out infinite;
  border-radius:var(--radius-sm)}
.ck-skeleton-text{height:12px;border-radius:var(--radius-sm)}
.ck-skeleton-title{height:16px;border-radius:var(--radius-sm);max-width:40%}
.ck-skeleton-circle{border-radius:var(--radius-full)}
.ck-skeleton-row{display:flex;align-items:center;gap:10px;padding:7px 9px}

@media (prefers-reduced-motion:reduce){
  .ck-spinner{animation-duration:2.4s}
  /* The chevron still needs to END in the right place, so the animation is
     shortened rather than removed — dropping it would leave the arrow pointing
     the wrong way. */
  .ck-dd.open .ck-dd-arrow,.ck-dd.is-closing .ck-dd-arrow{animation-duration:1ms}
  .ck-skeleton{animation:none;background:var(--skeleton-sheen)/* pairing-exempt: carries no text */}
}

/* ─── SEARCH LOADER ───────────────────────────────────────────────────────
   While a search is in flight the magnifier becomes a spinner and the list
   shows skeleton rows, so the panel keeps its height instead of collapsing
   to an empty state and snapping back. */
/* Centred with inset + auto margins, NOT transform: ck-spin animates
   transform, so a translateY(-50%) here would be replaced by the
   rotation — the spinner slid downward through every revolution and
   snapped back. Leave transform free wherever it is animated. */
.ck-dd-search .ck-spinner{position:absolute;right:17px;left:auto;
  inset-block:0;margin-block:auto;display:none}
.ck-dd-search.is-loading svg{display:none}
.ck-dd-search.is-loading .ck-spinner{display:block}
.ck-dd-loading{padding:4px}
.ck-dd-loading .ck-skeleton-row .ck-skeleton-text{flex:1}
.ck-dd-loading .ck-skeleton-row:nth-child(2) .ck-skeleton-text{max-width:70%}
.ck-dd-loading .ck-skeleton-row:nth-child(3) .ck-skeleton-text{max-width:85%}
.ck-dd-loading .ck-skeleton-row:nth-child(4) .ck-skeleton-text{max-width:55%}

/* Standalone search field loader, for search inputs outside a dropdown. */
/* ─── SEARCH BOX (Molecule) ────────────────────────────────────────────────
   A wrapper around a .ck-input, not a parallel control. It used to re-declare
   the input's border, fill, type, hover and focus — 7 of 8 declarations
   duplicated — which meant every input state and size had to be added twice.
   The input inside must carry .ck-input; this file only adds the trailing
   glyph, the clear button and the loading swap.

   Sizes: none of its own. Size the .ck-input inside it.

   Spec: references/components/search.md */
.ck-search{position:relative}
.ck-search > svg{position:absolute;inset-inline-end:10px;top:50%;transform:translateY(-50%);width:var(--icon-size);height:var(--icon-size);color:var(--muted-foreground);pointer-events:none}
.ck-search > .ck-spinner{position:absolute;inset-inline-end:10px;
  inset-block:0;margin-block:auto;display:none}
.ck-search.is-loading > svg{display:none}
.ck-search.is-loading > .ck-spinner{display:block}

/* Room for the glyph. The input keeps every other declaration from .ck-input. */
.ck-search > .ck-input{padding-inline-end:36px}
.ck-search.has-value > .ck-input{padding-inline-end:60px}

.ck-search > .ck-search-clear{
  /* The magnifier is the right-most icon, occupying 10-26px from the trailing
     edge. The clear ends 8px before it starts: 26 + 8 = 34. */
  position:absolute;inset-inline-end:34px;top:50%;transform:translateY(-50%);
  width:24px;height:24px;display:none;place-items:center;
  border:0;background:0;color:var(--muted-foreground);cursor:pointer;
  border-radius:var(--radius-sm)
}
.ck-search > .ck-search-clear svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-search > .ck-search-clear:hover{background:var(--hover-bg);color:var(--foreground)}
.ck-search > .ck-search-clear:active{background:var(--selected-bg);color:var(--foreground)}
.ck-search > .ck-search-clear:disabled{color:var(--input);background:0;cursor:not-allowed;pointer-events:none}
.ck-search > .ck-search-clear:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* Present once there is a value, visible once the field is hovered or focused. */
.ck-search.has-value > .ck-search-clear{
  display:grid;opacity:0;pointer-events:none;transition:opacity var(--duration-base)}
.ck-search.has-value:hover > .ck-search-clear,
.ck-search.has-value:focus-within > .ck-search-clear,
.ck-search.has-value[data-force~="hover"] > .ck-search-clear{
  opacity:1;pointer-events:auto}

/* ══════════════════════════════════════════════════════════════════════
   ICON CONTROLS — shape and tone only                            (Atom)
   ══════════════════════════════════════════════════════════════════════
   Rounded-square on hover and selection — § 7b puts an icon button in the
   CONTROL tier (--radius-md), and .size-xs in the INNER tier (--radius-sm).
   The Round tier is pills, counters, avatars, switch, radio, spinner and
   status dot; an icon control is not in it. Tone comes from --ck-icon-hover /
   --ck-icon-hover-fg, so one shape reads grey in neutral chrome, accent
   blue in navigation, red on a destructive action.

   This block sets NO width, height or aspect-ratio, deliberately. An
   earlier version forced a 32px frame with and broke every
   control that sizes itself — folder-panel affordances that collapse to
   zero width at rest, the labelled Move back row, pagers, segmented
   buttons. Shape is safe to impose across a codebase; size is not. Opt
   into a standard frame with .ck-icon-btn (.sm / .lg) where you want one.
   ══════════════════════════════════════════════════════════════════════ */
/* Icon hover is --hover-bg, the product-wide hover fill. § 8 says "--hover-bg
   — hover fill on any interactive row, item, or ghost control" and an icon
   button is a ghost control, so --icon-hover-bg was a second token for a
   decision already made once. It is retired into --hover-bg (rename map, § 2).

   This drives EVERY icon control through --ck-icon-hover: .ck-icon-btn, the
   header bar's .icon-btn, .ck-ico.is-interactive and the eight retired
   one-offs. They agree because they all read the same property. */
:root{ --ck-icon-hover: var(--hover-bg); --ck-icon-hover-fg: var(--foreground); }

/* The opt-in primitive — the only place a size is declared. */
/* ─── ICON BUTTON (Atom) ───────────────────────────────────────────────────
   A button whose whole label is its glyph, so it always needs an aria-label.

   Sizes share the control height scale (Rulebook §7a): 28 / 34 / 40, square.
   They were 26 / 32 / 38, which left an icon button 2px short of the button
   beside it in every toolbar. `.sm` / `.lg` are kept as aliases because pages
   already use them.

   Tone is set by two local properties rather than a variant class per colour,
   so a new tone is two declarations and no new rules.

   Spec: references/components/icon-button.md */
.ck-icon-btn{
  /* No local hover override: it reads --ck-icon-hover from :root, which is
     --hover-bg. This used to re-point the property locally, so an icon button
     hovered blue while the header bar's .icon-btn, carrying no override,
     hovered grey. The fix is one value in :root rather than an override here,
     so every icon control agrees by construction. */
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  width:36px;height:36px;padding:0;
  border:0;border-radius:var(--radius-md);
  background:transparent;color:var(--muted-foreground);cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base)
}
.ck-icon-btn svg{width:var(--icon-size);height:var(--icon-size);display:block}

/* Sizes — square, from the control height scale. */
.ck-icon-btn.size-sm,.ck-icon-btn.sm{width:28px;height:28px}
.ck-icon-btn.size-lg,.ck-icon-btn.lg{width:44px;height:44px}
/* 24px — the WCAG 2.5.8 floor, for controls that sit inside another control:
   a chip's dismiss, a dialog's close, an inline remove. Do not go smaller;
   .ck-remove used to be 16px and failed the floor. */
.ck-icon-btn.size-xs{width:24px;height:24px;border-radius:var(--radius-sm)}

/* Tones */
.ck-icon-btn.tone-accent{--ck-icon-hover:var(--hover-bg);--ck-icon-hover-fg:var(--primary)}
/* § 7c's destructive icon column, in full. It previously set only the two
   hover properties, so the glyph rested on --muted-foreground and hovered to
   the solid --destructive: no destructive rest colour, and a hover foreground
   that § 7c gives as --destructive-soft-foreground. A cross, a trash, a
   disconnect IS a destructive icon, so it reads destructive at rest.

   .ck-alert's dismiss is listed alongside rather than duplicating the values.
   A dismiss inside a PILL is deliberately different — neutral at rest,
   destructive on approach (§ 14.6 check 10) — and keeps its own rules. */
.ck-icon-btn.tone-danger,.ck-alert > .ck-icon-btn{
  color:var(--icon-color-destructive);
  --ck-icon-hover:var(--destructive-bg);
  --ck-icon-hover-fg:var(--destructive-soft-foreground)}
.ck-icon-btn.tone-danger:active,.ck-alert > .ck-icon-btn:active{
  background:var(--destructive);color:var(--destructive-foreground)}
.ck-icon-btn.tone-danger.is-selected{
  background:var(--destructive-bg);color:var(--destructive-soft-foreground)}
.ck-icon-btn.tone-danger:is(:focus-visible,[data-force~="focus"]),
.ck-alert > .ck-icon-btn:is(:focus-visible,[data-force~="focus"]){
  box-shadow:var(--focus-ring-error)}
.ck-icon-btn.tone-primary{--ck-icon-hover:var(--primary);--ck-icon-hover-fg:var(--primary-foreground)}
.ck-icon-btn.on-dark{--ck-icon-hover:var(--toolbar-dark-hover);--ck-icon-hover-fg:var(--toolbar-dark-foreground)}
/* Outlined — a bordered icon control, for a run of them that must read as a
   group against a busy row (pagination's first/prev/next/last). It takes the
   field stroke set, so it stays in sync with .ck-input and .ck-dd-trigger. */
.ck-icon-btn.is-outlined{
  /* pairing-exempt: --muted-foreground on --background is 3.44:1, the same
     declared de-emphasis .ck-empty carries. A nav control in a table footer
     must read quieter than the data above it; --foreground would make a run
     of four chevrons as loud as the rows they page through. */
  background:var(--background);color:var(--muted-foreground);
  border:1px solid var(--input)}
.ck-icon-btn.is-outlined:is(:hover,[data-force~="hover"]){
  background:var(--ck-icon-hover);color:var(--ck-icon-hover-fg);
  border-color:var(--input-border-hover)}
.ck-icon-btn.is-outlined:is(:active,[data-force~="active"]){
  background:var(--selected-bg);border-color:var(--primary)}
.ck-icon-btn.is-outlined:is(:disabled,[aria-disabled="true"],[data-force~="disabled"]){
  /* The same triplet .ck-btn's disabled state uses, so an outlined icon
     control and a disabled button read as the same kind of unavailable. */
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input)}

.ck-icon-btn:is(:hover,[data-force~="hover"]){
  background:var(--ck-icon-hover);color:var(--ck-icon-hover-fg)}
.ck-icon-btn:is(:active,[data-force~="active"]){
  background:var(--selected-bg);color:var(--ck-icon-hover-fg)}
.ck-icon-btn.is-selected{background:var(--selected-bg);color:var(--selected-fg)}

/* Disabled — tokens, not opacity, so the glyph keeps its contrast. */
.ck-icon-btn:is(:disabled,[aria-disabled="true"],[data-force~="disabled"]){
  background:transparent;color:var(--input);cursor:not-allowed;pointer-events:none
}
.ck-icon-btn:is(:focus-visible,[data-force~="focus"]){outline:0;box-shadow:var(--focus-ring)}

/* Shape, applied across the hub. Nothing else. */
.ck-icon-btn,
.icon-btn,
.icon-btn-ghost,
.ck-remove,
.ck-dialog-x,
.act-btn,
.de-tbl-ic,
.dialog-close,
.toast-close,
.file-search-clear,
.accordion-chevron,
.pag-btn,
.panel-close-btn,
.pin-btn,
.theme-btn,
.theme-opt,
.theme-seg-btn,
.nav-btn,
.ci-row-menu-btn,
.copy-inline,
.doc-card__icon,
.doc-card__action-btn,
.toolbar__btn,
.preview-toolbar__btn,
.topbar__info,
.topbar__icon-btn,
.search-clear,
.ck-search-clear,
.ab-btn,
.dropzone-file-remove,
.filter-drawer-close,
.filter-input-clear,
.filter-chip-x,
.td-expand,
.dfp-copy,
.dfp-tool-btn,
.dfp-multi-remove,
[data-set-theme][data-set-theme]{ border-radius: var(--radius-md); }

/* Tone, only where a control had no hover of its own. */
.ck-icon-btn:hover,
.icon-btn:hover,
.icon-btn-ghost:hover,
.ck-remove:hover,
.ck-dialog-x:hover,
.act-btn:hover,
.de-tbl-ic:hover,
.dialog-close:hover,
.toast-close:hover,
.file-search-clear:hover,
.accordion-chevron:hover,
.pag-btn:hover,
.panel-close-btn:hover,
.pin-btn:hover,
.theme-btn:hover,
.theme-opt:hover,
.theme-seg-btn:hover,
.nav-btn:hover,
.ci-row-menu-btn:hover,
.copy-inline:hover,
.doc-card__icon:hover,
.doc-card__action-btn:hover,
.toolbar__btn:hover,
.preview-toolbar__btn:hover,
.topbar__info:hover,
.topbar__icon-btn:hover,
.search-clear:hover,
.ck-search-clear:hover,
.ab-btn:hover,
.dropzone-file-remove:hover,
.filter-drawer-close:hover,
.filter-input-clear:hover,
.filter-chip-x:hover,
.td-expand:hover,
.dfp-copy:hover,
.dfp-tool-btn:hover,
.dfp-multi-remove:hover,
[data-set-theme]:hover{ background:var(--ck-icon-hover); color:var(--ck-icon-hover-fg); }

/* Focus. Only .ck-icon-btn had a ring; every unprefixed icon control in the
   list above fell through to the BROWSER's default outline — a blue box that
   is not a kit value and does not follow the theme. § 9 makes a missing focus
   ring a Sev-1, so the same list gets the same ring. */
.ck-icon-btn:focus-visible,
.icon-btn:focus-visible,
.icon-btn-ghost:focus-visible,
.ck-remove:focus-visible,
.ck-dialog-x:focus-visible,
.act-btn:focus-visible,
.de-tbl-ic:focus-visible,
.dialog-close:focus-visible,
.toast-close:focus-visible,
.file-search-clear:focus-visible,
.accordion-chevron:focus-visible,
.pag-btn:focus-visible,
.panel-close-btn:focus-visible,
.pin-btn:focus-visible,
.theme-btn:focus-visible,
.theme-opt:focus-visible,
.theme-seg-btn:focus-visible,
.nav-btn:focus-visible,
.ci-row-menu-btn:focus-visible,
.copy-inline:focus-visible,
.doc-card__icon:focus-visible,
.doc-card__action-btn:focus-visible,
.toolbar__btn:focus-visible,
.preview-toolbar__btn:focus-visible,
.topbar__info:focus-visible,
.topbar__icon-btn:focus-visible,
.search-clear:focus-visible,
.ck-search-clear:focus-visible,
.ab-btn:focus-visible,
.dropzone-file-remove:focus-visible,
.filter-drawer-close:focus-visible,
.filter-input-clear:focus-visible,
.filter-chip-x:focus-visible,
.td-expand:focus-visible,
.dfp-copy:focus-visible,
.dfp-tool-btn:focus-visible,
.dfp-multi-remove:focus-visible,
[data-set-theme]:focus-visible{ outline:0; box-shadow:var(--focus-ring); }

.act-btn.danger, .de-tbl-ic.danger, .ck-remove, .is-destructive,
.dropzone-file-remove, .dfp-multi-remove, .filter-chip-x, .ab-error{
  --ck-icon-hover: var(--destructive-bg); --ck-icon-hover-fg: var(--destructive); }
.nav-btn, .theme-opt, .theme-seg-btn, [data-set-theme]{
  --ck-icon-hover: var(--hover-bg); --ck-icon-hover-fg: var(--primary); }
.ck-icon-btn.is-selected, .nav-btn.active, .theme-opt.active,
.theme-seg-btn.active, [data-set-theme].active{
  background:var(--selected-bg); color:var(--selected-fg); }
.preview-toolbar__btn{ --ck-icon-hover: var(--toolbar-dark-hover); --ck-icon-hover-fg: var(--toolbar-dark-foreground); }

/* ─── MIDDLE TRUNCATION (Utility) ───────────────────────────────────────
   A filename's tail carries the meaning — the extension, a trailing index —
   so end-truncation throws away the useful half. .ck-mid-trunc marks an
   element for ckMiddleTruncate(), which measures and inserts the ellipsis in
   the middle. The element must not also be clipping with text-overflow, or
   the two fight. */
.ck-mid-trunc{
  display:block;min-width:0;max-width:100%;
  white-space:nowrap;overflow:hidden;text-overflow:clip;
}

/* ─── TOAST (Molecule) ──────────────────────────────────────────────────
   Confirmation for a completed action, success or destructive. Four tones,
   all sharing one shape: icon, title, optional detail, dismiss.

     .ck-toast.is-success   .ck-toast.is-error
     .ck-toast.is-warning   .ck-toast.is-info

   Stack them in .ck-toast-stack, which is fixed to the corner. */
/* ─── TOAST (Organism) ────────────────────────────────────────────────────
   Transient, non-blocking, self-dismissing. For anything the user must answer,
   use a dialog.

   Eight tones, taken from the v2.0 molecules reference: four FEEDBACK
   (success / error / warning / info) and four ACTION (download / upload /
   undo / default). Each is the soft-semantic pattern — an --X-bg fill inside
   an --X-border stroke with the icon on the solid --X — rather than the
   leading 3px accent bar this kit had shipped, which read as a hairline on a
   --popover card and lost the tone almost entirely.

   Three things the reference did that are NOT copied, because the kit already
   has them and § 10 rule 1 says reuse beats minting:
     · its own .toast-btn        -> .ck-btn.size-sm (primary / outline)
     · its own .toast-progress   -> .ck-progress.size-sm
     · rgba(0,59,74,.06) tint    -> --primary-bg, pre-composited per theme
   Its 10px radius is not copied either: § 7b puts a toast in the panel tier,
   which is --radius-2xl for every panel in the kit.

   The stack is pointer-events:none so it never blocks the page beneath; each
   toast re-enables them for itself.

   Sizes: none. A toast is one width, because a row of different-width toasts
   reads as broken rather than as a hierarchy.

   Spec: references/components/toast.md */
.ck-toast-stack{position:fixed;inset-block-end:24px;inset-inline-end:24px;z-index:var(--z-toast);
  display:flex;flex-direction:column;gap:12px;max-width:min(420px,calc(100vw - 48px));pointer-events:none}
.ck-toast{
  display:flex;align-items:flex-start;gap:var(--space-md);box-sizing:border-box;
  padding:var(--space-md) var(--space-base);
  border:1px solid var(--input);border-radius:var(--radius-2xl);
  background:var(--muted);color:var(--foreground);
  box-shadow:var(--shadow-panel);
  pointer-events:auto;opacity:0;transform:translateY(10px);
  transition:opacity var(--duration-base) ease,transform var(--duration-base) ease
  /* pairing-exempt: --muted is a toast tint, not a muted-content surface; --foreground on it is 15.87:1 where the nominal --muted-foreground partner is 3.16:1 */}
.ck-toast.is-shown{opacity:1;transform:translateY(0)}
.ck-toast.is-leaving{opacity:0;transform:translateY(-6px)}

/* Tone = fill + stroke + icon, one family each. */
.ck-toast.is-success{background:var(--success-bg);border-color:var(--success-border)}
.ck-toast.is-error{background:var(--destructive-bg);border-color:var(--destructive-border)}
.ck-toast.is-warning{background:var(--warning-bg);border-color:var(--warning-border)}
.ck-toast.is-info{background:var(--info-bg);border-color:var(--info-border)}
.ck-toast.is-upload{background:var(--cyan-bg);border-color:var(--cyan-border)}
.ck-toast.is-undo{background:var(--violet-bg);border-color:var(--violet-border)}
/* Download is the in-progress toast, so it takes the solid --primary stroke
   rather than a soft one — it is the only tone that is still working. */
.ck-toast.is-download{background:var(--primary-bg);border-color:var(--primary)}

.ck-toast-icon{width:var(--icon-box);height:var(--icon-box);flex:none;margin-top:1px;
  display:inline-grid;place-items:center;color:var(--muted-foreground)}
.ck-toast-icon svg{width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);display:block}
.ck-toast.is-success .ck-toast-icon{color:var(--success)}
.ck-toast.is-error .ck-toast-icon{color:var(--destructive)}
.ck-toast.is-warning .ck-toast-icon{color:var(--warning)}
.ck-toast.is-info .ck-toast-icon{color:var(--info)}
.ck-toast.is-upload .ck-toast-icon{color:var(--cyan)}
.ck-toast.is-undo .ck-toast-icon{color:var(--violet)}
.ck-toast.is-download .ck-toast-icon{color:var(--primary)}

.ck-toast-content{flex:1;min-width:0}
.ck-toast-title{font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  margin-bottom:var(--space-2xs)}
.ck-toast-msg{font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground);line-height:1.45}
/* Actions are .ck-btn.size-sm — there is no toast-only button. */
.ck-toast-actions{display:flex;align-items:center;gap:var(--space-sm);margin-top:var(--space-sm)}
.ck-toast-action{align-self:flex-start;margin-top:var(--space-2xs)}
/* Progress is .ck-progress.size-sm, spanning the toast under the copy. */
.ck-toast-progress{margin-top:var(--space-sm)}
@media (prefers-reduced-motion: reduce){
  .ck-toast{transition:none;opacity:1;transform:none}
}

/* ─── MENU (Organism) ─── */
/* A menu floats over the panel it came from, so it needs a shadow that
   actually lifts it - the ambient --shadow-lg alone reads flat against a
   light panel. Weighted downward, since it drops from its trigger. */
/* ─── MENU (Organism) ──────────────────────────────────────────────────────
   An action list anchored to a trigger. Shares its panel treatment with
   .ck-dd-panel; the searchable variant shares its search row.

   Behaviour is ClipperMenu in clipper-kit.js.

   Spec: references/components/menu.md */
.ck-menu{position:fixed;z-index:var(--z-dropdown);min-width:208px;
  background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  box-shadow:var(--shadow-panel);padding:4px}
.ck-menu.size-sm{min-width:168px}
.ck-menu.size-lg{min-width:280px}

.ck-menu-item{width:100%;display:flex;align-items:center;gap:10px;padding:9px 10px;
  border:0;background:0;border-radius:var(--radius-sm);
  font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--popover-foreground);
  cursor:pointer;text-align:start}
.ck-menu-item:is(:hover,[data-force~="hover"]){background:var(--hover-bg)}
.ck-menu-item:active{background:var(--selected-bg)}
/* An inset rule rather than --focus-ring: a 3px outer ring on a menu item
   would be clipped by the panel's 4px padding and read as a smudge. */
.ck-menu-item:focus-visible{outline:0;background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
.ck-menu-item[aria-selected="true"],.ck-menu-item.selected{background:var(--selected-bg);color:var(--selected-fg)}
.ck-menu-item:disabled,.ck-menu-item[aria-disabled="true"]{
  color:var(--input);cursor:not-allowed;pointer-events:none;background:0}
.ck-menu-item svg{width:16px;height:16px;flex:none;color:var(--muted-foreground)}
.ck-menu-item:is(:hover,[data-force~="hover"]) svg{color:var(--primary)}
.ck-menu-item:disabled svg,.ck-menu-item[aria-disabled="true"] svg{color:var(--input)}
.ck-menu-item.is-destructive{color:var(--destructive)}
.ck-menu-item.is-destructive:is(:hover,[data-force~="hover"]){background:var(--destructive-bg)}
.ck-menu-item.is-destructive svg{color:var(--destructive)}

/* A header block at the top of a menu — an identity for a profile menu, or a
   title for a long one. It is NOT a menu item: no hover, no focus, not in the
   tab order, and it sits outside .ck-menu-list so the list still scrolls on
   its own. Ported from the v2.0 profile menu. */
.ck-menu-header{
  display:flex;align-items:center;gap:var(--space-sm);flex:none;
  padding:var(--space-md);
  border-bottom:1px solid var(--border);
  background:var(--muted)/* pairing-exempt: --foreground on --muted is 15.87:1,
    the declared header pairing .ck-table th and .ck-alert also use */;
  color:var(--foreground)}
.ck-menu-header-info{display:flex;flex-direction:column;min-width:0;gap:1px}
.ck-menu-header-name{
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  color:var(--foreground);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-menu-header-meta{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* A menu carrying a header drops its own padding, so the header meets the
   panel edge instead of floating inside a 4px frame. */
.ck-menu:has(.ck-menu-header){padding:0;overflow:hidden}
.ck-menu:has(.ck-menu-header) .ck-menu-list{padding:var(--space-xs)}

.ck-menu-sep{height:1px;margin:4px 0;background:var(--border)/* pairing-exempt: carries no text */}
/* Symmetric 5px, was 6px top / 4px bottom — a 2px asymmetry with no
   stated reason reads as a mistake and QA cannot tell it from one. */
.ck-menu-label{padding:5px 10px;font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);color:var(--muted-foreground);
  text-transform:uppercase;letter-spacing:.07em}

/* ─── SELECTION MENU — .ck-menu.is-select [.is-multi] ─────────────────────
   A menu whose rows are VALUES rather than actions. This is where the
   multi-select dropdown lives: it was a second component with its own
   classes, and it was the same object — a floating panel of rows anchored to
   a trigger. One component, four orthogonal choices:

     .is-select              rows are values; picking one is a choice, not an act
     .is-multi               each row carries a checkbox; several can be true
     .ck-menu-search child   adds the search row. Markup, not a class
     .ck-menu-item-badge     adds a trailing badge to a row. Markup, not a class

   So "multi-select with search and badges" is `.is-select.is-multi` plus two
   children, not a variant with a name of its own — which is why they compose
   instead of multiplying into eight rules.

   AN ACTION MENU AND A SELECTION MENU DIFFER IN ROLE, NOT JUST IN PAINT.
   An action list is role="menu" with role="menuitem" rows: activating one
   does something and the menu closes. A selection menu is role="listbox"
   with role="option" rows and aria-selected, and a MULTI one adds
   aria-multiselectable="true" and stays open while you pick. Getting that
   wrong is the defect, not the tick.

   THERE IS NO TICK GLYPH. A single-select row used to carry a circle-check at
   its trailing edge; it is gone. The row's own surface is the mark — the same
   --selected-bg / --selected-fg pair a tree row, a dropdown option and a menu
   item already use — so selection is stated once, in the kit's one selection
   language, instead of with a glyph unique to this component. It also frees
   the trailing lane for the badge, which is real content. */
.ck-menu.is-select .ck-menu-item[aria-selected="true"],
.ck-menu.is-select .ck-menu-item.selected{
  background:var(--selected-bg);color:var(--selected-fg);
  font-weight:var(--font-weight-semibold)}
.ck-menu.is-select .ck-menu-item[aria-selected="true"]:is(:hover,[data-force~="hover"]),
.ck-menu.is-select .ck-menu-item.selected:is(:hover,[data-force~="hover"]){
  background:var(--selected-bg);color:var(--selected-fg)}
/* A leading glyph is decoration, not the mark. */
.ck-menu.is-select .ck-menu-item > svg:first-child{color:var(--muted-foreground)}

/* Multi select: a real checkbox per row, and the Checkbox atom stays the one
   definition of a checkbox — the v2.0 row sized the box itself and fought
   .ck-check's 16px. */
.ck-menu.is-select.is-multi .ck-menu-item{gap:var(--space-sm)}
/* A multi-select menu item is a <label>, so the whole row toggles its box —
   it was a <button> wrapping an <input>, which is invalid and left only the
   16px box clickable (§ 14 check 38). A label cannot take :focus-visible for
   its own control, so the ring is drawn from the checkbox inside it. */
.ck-menu-item:has(> .ck-check:focus-visible){
  background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
.ck-menu.is-select.is-multi .ck-menu-item > .ck-check{flex:none;pointer-events:none}
/* No selected fill in the multi form — the ticked box is the mark, and a
   filled row on top of it fights the hover state for the same pixels. */
.ck-menu.is-select.is-multi .ck-menu-item[aria-selected="true"]{
  background:0;color:var(--popover-foreground);font-weight:var(--font-weight-normal)}
.ck-menu.is-select.is-multi .ck-menu-item[aria-selected="true"]:is(:hover,[data-force~="hover"]){background:var(--hover-bg)}

/* A trailing badge on a row — a count, a status, a tone. It goes at the
   trailing edge and never replaces the label: the label says what the row is
   and the badge qualifies it. */
.ck-menu-item-badge{margin-inline-start:auto;flex:none}
/* A badge's own glyph is not a menu glyph, so the menu's icon colouring must
   not reach into it. */
.ck-menu-item .ck-menu-item-badge svg{color:inherit}
.ck-menu-item:is(:hover,[data-force~="hover"]) .ck-menu-item-badge svg{color:inherit}

/* ── .is-badges-only — the row IS the badge ──────────────────────────────
   A list whose rows carry nothing but a badge: picking a status, a label, a
   reconcile outcome. The badge is not qualifying a label here, it is the
   whole content, so it moves to the LEADING edge and the auto margin that
   normally pushes it right is dropped.

   Every other rule still applies — the row is still a .ck-menu-item, so
   hover, selection, focus, disabled and the keyboard are the ones the menu
   already has, and the multi form still uses a real .ck-check. The badge
   itself is the .ck-pill atom, untouched.

   Available in all four forms, the same as the labelled list:
     .is-select                        single, no search
     .is-select.has-search             single, with search
     .is-select.is-multi               multi,  no search
     .is-select.is-multi.has-search    multi,  with search */
.ck-menu.is-badges-only .ck-menu-item-badge{margin-inline-start:0}
/* Nothing trails the badge, so the row shrinks to its content and the whole
   width stays a target. */
.ck-menu.is-badges-only .ck-menu-item{justify-content:flex-start}
/* A selected badge row does not take the selected FILL: the row is one badge
   on a surface, and tinting behind a toned pill muddies both. It takes the
   kit's selection stroke instead, which reads against any tone. */
.ck-menu.is-badges-only.is-select .ck-menu-item:is([aria-selected="true"],.selected){
  background:transparent;color:var(--popover-foreground);
  box-shadow:inset 2px 0 0 var(--primary)}
.ck-menu.is-badges-only.is-select .ck-menu-item:is([aria-selected="true"],.selected):hover{
  background:var(--hover-bg);color:var(--popover-foreground)}

/* A select-all row above a multi list. Same band as the picker's, because it
   is the same control in a different container. */
.ck-menu-all{
  display:flex;align-items:center;gap:var(--space-md);flex:none;
  padding:var(--space-sm) var(--space-md);
  border-bottom:1px solid var(--border);
  background:var(--muted)/* pairing-exempt: --foreground on --muted is 15.87:1, the declared header pairing */;
  color:var(--foreground);
  font:var(--font-weight-semibold) var(--text-md) var(--font-sans)}
.ck-menu:has(.ck-menu-all){padding:0;overflow:hidden}
.ck-menu:has(.ck-menu-all) .ck-menu-list{padding:var(--space-xs)}

/* ─── CENTRED DIALOG (Organism) ─── */
/* ─── DIALOG (Organism) ────────────────────────────────────────────────────
   Sizes are widths, not heights — a dialog is as tall as its content up to the
   viewport. .wide is kept as an alias for .size-lg.

   Every text part reads --popover-foreground, not --foreground. The two are
   identical in all three themes today, so the old crossed pairing showed
   nothing; it would break the moment the popover surface diverges.

   Spec: references/components/dialog.md */
.ck-dialog-scrim{position:fixed;inset:0;z-index:var(--z-overlay);display:grid;place-items:center;padding:24px}
/* The tint is painted on ::before with --scrim-opacity rather than as an
   alpha colour, so the token stays 6-digit hex. It cannot go on the scrim
   itself: the dialog is its child and would fade with it.

   AND THE PANEL MUST BE POSITIONED, or the tint lands on top of it. An
   absolutely-positioned ::before paints above every NON-positioned descendant
   no matter what order they are declared in, so a static .ck-dialog rendered
   as a washed-out grey card — the scrim over the dialog instead of behind it.
   position + z-index puts the panel back in front. Anything else dropped
   inside a scrim needs the same. */
.ck-dialog-scrim::before{content:'';position:absolute;inset:0;background:var(--scrim);opacity:var(--scrim-opacity)/* pairing-exempt: carries no text */}
.ck-dialog{
  position:relative;z-index:1;
  width:100%;max-width:460px;max-height:calc(100vh - 48px);overflow:auto;
  background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  box-shadow:var(--shadow-overlay)
}
/* Same guard for anything else placed inside a scrim. */
.ck-dialog-scrim > *{position:relative;z-index:1}
.ck-dialog.size-sm{max-width:380px}
.ck-dialog.size-lg,.ck-dialog.size-full{max-width:calc(100vw - 48px)}

.ck-dialog-head{display:flex;align-items:flex-start;gap:10px;padding:18px 20px 14px;border-bottom:1px solid var(--border)}
.ck-dialog-title{font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);color:var(--popover-foreground);flex:1}
.ck-dialog-sub{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);margin-top:0}
.ck-dialog-body{padding:18px 20px;display:flex;flex-direction:column;gap:16px}
.ck-dialog-foot{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;border-top:1px solid var(--border)}
/* A footer carrying a low-emphasis escape hatch beside its buttons — "Discard
   changes" next to Go back / Save. The link goes to the LEADING edge and the
   buttons stay trailing, so the destructive-ish escape is never the thing a
   user's hand lands on by reflex. */
.ck-dialog-foot.is-split{justify-content:space-between;align-items:center}
.ck-dialog-foot-actions{display:flex;align-items:center;gap:var(--space-sm)}

/* ═══ .ck-dialog.is-popover — the ANCHORED, NON-MODAL variant ═════════════
   A small panel holding controls — a filter, a quick edit, a confirmation —
   opened from a trigger rather than over the whole page. Not a tooltip (which
   holds no controls) and not a menu (which is a list).

   IT IS THE SAME COMPONENT, AND THAT IS THE POINT: the surface, the stroke,
   the radius, the title, the body, the footer and the tone plate are the
   dialog's. Only three things change — where it sits, how wide it is, and
   whether it blocks the page.

   WHAT MUST NOT BE SHARED IS THE MODALITY. A dialog is modal: it carries
   aria-modal="true", tints its scrim, traps focus, and inerts the rest of the
   page, because the user must answer it before going on. A popover is none of
   those. Its scrim is a transparent click-catcher, focus is free to leave, and
   ClipperOverlay must NOT be pointed at it — trapping focus in a non-modal
   panel strands a keyboard user in a box they never asked to enter.

   So: one component for everything you can see, two behaviours for what you
   can do. Use role="dialog" WITHOUT aria-modal on a popover.

   Spec: references/components/dialog.md § Popover */
/* Anchored, so the scrim neither centres nor tints. It exists only to catch
   the click that dismisses. */
.ck-dialog-scrim.is-popover{display:block;padding:0;background:transparent}
.ck-dialog-scrim.is-popover::before{content:none}
.ck-dialog.is-popover{
  position:fixed;width:320px;max-width:calc(100vw - 32px);max-height:none;
  box-shadow:var(--shadow-panel);
  padding:var(--space-base);
  display:flex;flex-direction:column;gap:var(--space-md)}
.ck-dialog.is-popover.size-sm{width:240px;max-width:calc(100vw - 32px);padding:var(--space-md);gap:var(--space-sm)}
.ck-dialog.is-popover.size-lg{width:400px;max-width:calc(100vw - 32px)}
/* One padded box, not three banded ones: at this size a rule above the footer
   spends more height on the line than the row it separates. The dialog's own
   parts keep their type and their roles — only the chrome is dropped. */
.ck-dialog.is-popover .ck-dialog-head,
.ck-dialog.is-popover .ck-dialog-body,
.ck-dialog.is-popover .ck-dialog-foot{padding:0;border:0}
.ck-dialog.is-popover .ck-dialog-body{gap:var(--space-sm)}
.ck-dialog.is-popover .ck-dialog-foot{gap:var(--space-sm)}
/* With no head band to lay the row out, the title carries the row itself, so
   a close button still lands at the trailing edge instead of beside the words.
   .grow marks whatever should take the slack. */
.ck-dialog.is-popover .ck-dialog-title{display:flex;align-items:center;gap:var(--space-sm)}
.ck-dialog.is-popover .ck-dialog-title > .grow{flex:1;min-width:0}

/* ── The dialog's tone plate — .ck-dialog-icon ──
   A tinted rounded square holding one 16px glyph, leading the title. It tells
   the user what KIND of dialog this is before they read a word: a deletion, a
   confirmation, a warning, a result, an explanation.

   Each tone is the soft-semantic triplet — a --*-bg plate with a
   --*-soft-foreground glyph — so it matches the inline alert a dialog body
   often carries. --radius-md, not --radius-full: a round plate reads as an
   avatar, and this is not a person.

   THE PLATE IS NEVER THE ONLY SIGNAL. The title still says "Delete 3
   invoices?" and the destructive button still says "Delete invoices". A user
   who cannot separate red from amber must get the same warning from the
   words. */
.ck-dialog-icon{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  width:36px;height:36px;border-radius:var(--radius-md);
  background:var(--muted);color:var(--foreground)/* pairing-exempt: --muted is a tone plate, not a muted-content surface; --foreground on it is 15.87:1 where the nominal --muted-foreground partner is 3.16:1 */}
.ck-dialog-icon svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-dialog-icon.is-destructive{background:var(--destructive-bg);color:var(--destructive-soft-foreground)}
.ck-dialog-icon.is-warning{background:var(--warning-bg);color:var(--warning-soft-foreground)}
.ck-dialog-icon.is-success{background:var(--success-bg);color:var(--success-soft-foreground)}
.ck-dialog-icon.is-info{background:var(--info-bg);color:var(--info-soft-foreground)}
/* The head becomes a three-part row: plate, the title-and-body stack, close.
   The copy stacks under the title rather than beside the plate, so a long
   explanation does not wrap into a narrow column next to the glyph. */
.ck-dialog-head.has-icon{align-items:flex-start;gap:var(--space-md)}
.ck-dialog-head-text{display:flex;flex-direction:column;gap:var(--space-xs);flex:1;min-width:0}
/* A dialog whose whole message lives in the head needs no rule under it — the
   body it would separate is not there. */
.ck-dialog-head.is-only{border-bottom:0;padding-block-end:0}

/* ── A row list inside a dialog body — .ck-dialog-rows ──
   Label on the left, its value or shortcut on the right, one per line. For a
   reference dialog: keyboard shortcuts, a summary of what an action will do.
   Rules between rows, none above the first or below the last, so the list
   does not double up on the body's own padding. */
.ck-dialog-rows{display:flex;flex-direction:column}
.ck-dialog-row{
  display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);
  padding-block:var(--space-sm);
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--popover-foreground)}
.ck-dialog-row + .ck-dialog-row{border-top:1px solid var(--border)}
.ck-dialog-row > .ck-kbd-combo,.ck-dialog-row > .ck-kbd{flex:none}

/* ─── SWITCH BLOCK (Molecule) ─────────────────────────────────────────────
   A toggle with a title and an explanation, laid out two-up. Used by folder
   Automation settings, where every row needs the "what does this do" line. */
/* Stacked list: rows sit on top of each other, switch pinned to the far
   right, title semi-bold with its subtext in regular directly beneath. */
.ck-switch-list{display:flex;flex-direction:column}
.ck-switch-list > .ck-switch-block{padding:16px 0}
.ck-switch-list > .ck-switch-block + .ck-switch-block{border-top:1px solid var(--border)}
.ck-switch-list > .ck-switch-block:first-child{padding-top:0}
.ck-switch-list > .ck-switch-block:last-child{padding-bottom:0}
/* Title sits tight to its subtext: they are one unit. */
.ck-switch-block{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:24px;row-gap:0;align-items:start;max-width:none}
.ck-switch-block .ck-sb-title{grid-column:1;font:var(--font-weight-semibold) var(--text-base) var(--font-sans);color:var(--foreground);line-height:1.45}
.ck-switch-block .ck-switch{grid-column:2;grid-row:1;margin-top:1px}
.ck-switch-block .ck-sb-desc{grid-column:1;font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);line-height:1.55;max-width:78ch}

/* ─── RADIO GROUP (Molecule) ─── */
.ck-radio-set{display:flex;flex-direction:column;gap:10px}
.ck-radio-set + .ck-radio-set{margin-top:20px}
.ck-radio-legend{font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--foreground)}
.ck-radio-row{display:flex;align-items:center;gap:28px;flex-wrap:wrap}
/* ─── RADIO (Atom) ─────────────────────────────────────────────────────────
   shadcn semantics: --input border at rest, --primary border and dot when
   checked, --ring for focus, --destructive for aria-invalid. 16px, matching
   .ck-check and shadcn's size-4.

   Spec: references/components/radio.md */
.ck-radio{display:inline-flex;align-items:center;gap:8px;font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground);cursor:pointer}
.ck-radio input{appearance:none;-webkit-appearance:none;width:16px;height:16px;margin:0;flex:none;
  box-sizing:border-box;border:1.5px solid var(--input);border-radius:var(--radius-full);
  background:var(--background);position:relative;cursor:pointer;
  transition:border-color var(--duration-base),background var(--duration-base)/* pairing-exempt: carries no text */}
.ck-radio input:checked{border-color:var(--primary)}
.ck-radio input:checked::after{content:'';position:absolute;inset:3px;border-radius:var(--radius-full);background:var(--primary)/* pairing-exempt: carries no text */}
.ck-radio:is(:hover,[data-force~="hover"]) input{border-color:var(--primary)}
.ck-radio input:active{background:var(--hover-bg)/* pairing-exempt: carries no text */}
.ck-radio:is(:hover,[data-force~="hover"]) input:checked::after{background:var(--primary-hover)/* pairing-exempt: carries no text */}
.ck-radio input:checked:active::after{background:var(--primary-active)/* pairing-exempt: carries no text */}

/* Invalid */
.ck-radio input[aria-invalid="true"]{border-color:var(--destructive)/* pairing-exempt: carries no text */}
.ck-radio input[aria-invalid="true"]:checked::after{background:var(--destructive)/* pairing-exempt: carries no text */}
.ck-radio input[aria-invalid="true"]:focus-visible{box-shadow:var(--focus-ring-error)}

/* Disabled — the whole row dims via tokens, and the label goes muted so the
   control and its text read as one disabled unit. */
.ck-radio:has(input:disabled),.ck-radio.is-disabled{color:var(--muted-foreground);cursor:not-allowed}
.ck-radio input:disabled,.ck-radio input[aria-disabled="true"]{
  background:var(--muted);border-color:var(--input);cursor:not-allowed;pointer-events:none
/* pairing-exempt: carries no text */}
.ck-radio input:disabled:checked{border-color:var(--input)/* pairing-exempt: carries no text */}
.ck-radio input:disabled:checked::after{background:var(--muted-foreground)/* pairing-exempt: carries no text */}

.ck-radio input:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-radio:is(:hover,[data-force~="hover"]) input{border-color:var(--primary)}

/* ─── MEMBER CARD (Molecule) ─── */
/* ─── MEMBER CARD (Molecule) ───────────────────────────────────────────────
   Row actions are hidden until hover, which is fine for a mouse and invisible
   to a keyboard — so they also reveal on :focus-within.

   Surface is --accent, not a color-mix of --teal. --teal is a badge palette
   colour; using it as a surface tint means a brand change to --accent would
   never reach this card (Rulebook §10).

   Spec: references/components/member-card.md */
.ck-member-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ck-member-grid.cols-1{grid-template-columns:minmax(0,1fr)}
.ck-member{display:flex;align-items:center;gap:12px;padding:14px 16px;
  border-radius:var(--radius-2xl);background:var(--accent);color:var(--accent-foreground);
  border:1px solid var(--panel-border)}
.ck-member:hover{background:var(--hover-bg)}
.ck-member-av{/* pairing-exempt: outline pattern — initials in --primary on --background, 12.01:1 */
  width:36px;height:36px;flex:none;border-radius:var(--radius-full);
  display:grid;place-items:center;font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  background:var(--background);color:var(--primary)}
.ck-member-main{flex:1;min-width:0}
.ck-member-top{display:flex;align-items:center;gap:10px}
.ck-member-name{font:var(--font-weight-semibold) var(--text-base) var(--font-sans);color:var(--accent-foreground);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-member-role{white-space:nowrap;flex:none}
.ck-member-mail{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);margin-top:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-member .ck-icon-btn{opacity:0;transition:opacity var(--duration-base)}
.ck-member:hover .ck-icon-btn,.ck-member:focus-within .ck-icon-btn{opacity:1}

/* ─── SIDE DRAWER (Organism) ─── */
/* ─── DRAWER (Organism) ────────────────────────────────────────────────────
   A side panel for work the user does alongside the page. For a decision that
   blocks, use a dialog; for a small anchored panel, a popover.

   Sizes are widths. .from-start opens on the leading edge.

   Spec: references/components/drawer.md */
/* The tint is on ::before, not on the scrim itself. The drawer is normally a
   SIBLING of the scrim, so opacity on the element would have been safe — but
   only until someone nests it, and then group opacity fades the panel and no
   z-index can rescue it. Painting the tint on a pseudo-element makes that
   impossible by construction, the same way the dialog does it. */
.ck-drawer-scrim{position:fixed;inset:0;z-index:var(--z-overlay)}
.ck-drawer-scrim::before{content:'';position:absolute;inset:0;background:var(--scrim);opacity:var(--scrim-opacity)/* pairing-exempt: carries no text */}
.ck-drawer-scrim > *{position:relative;z-index:1}
.ck-drawer{position:fixed;inset-block:0;inset-inline-end:0;z-index:calc(var(--z-overlay) + 1);
  width:min(420px,100%);
  background:var(--popover);color:var(--popover-foreground);
  border-inline-start:1px solid var(--panel-border);
  box-shadow:var(--shadow-overlay);
  display:flex;flex-direction:column}
.ck-drawer.size-sm{width:min(320px,100%)}
.ck-drawer.size-lg{width:min(560px,100%)}
.ck-drawer.size-full{width:min(880px,100%)}
.ck-drawer.from-start{inset-inline-end:auto;inset-inline-start:0;
  border-inline-start:0;border-inline-end:1px solid var(--panel-border)}

/* EVERY SPACING VALUE HERE IS A MULTIPLE OF 4. The head was 18px top and
   bottom, which is the only number in the drawer that was not — and it read
   as a head that did not line up with anything below it.

   The bigger problem was invisible: .ck-drawer-title is an <h4> and
   .ck-drawer-sub a <p>, so both carried the BROWSER'S default margins —
   21.28px around the title and 12px around the subtitle. Nobody chose those,
   they are the UA stylesheet, and they were inflating the head to 130px and
   putting a 21px gap between a title and its own subtitle. Zeroed here, with
   a designed 4px gap in their place. */
.ck-drawer-head{display:flex;align-items:center;gap:var(--space-md);padding:var(--space-base) var(--space-lg);border-bottom:1px solid var(--border);flex:none}
.ck-drawer-title{font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);color:var(--popover-foreground);flex:1;margin:0}
.ck-drawer-sub{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);margin:0}
/* The title and its subtitle are one block: 4px apart, and the head's own
   gap keeps them clear of the close button. */
.ck-drawer-heading{display:flex;flex-direction:column;gap:var(--space-xs);flex:1;min-width:0}
.ck-drawer-tools{padding:var(--space-base) var(--space-lg) var(--space-md);flex:none}
.ck-drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 var(--space-md) var(--space-md)}
.ck-drawer-foot{display:flex;justify-content:flex-end;gap:8px;padding:16px 20px;border-top:1px solid var(--border);flex:none}
.ck-select-count{display:flex;align-items:center;gap:10px;padding:6px 8px 12px;font:var(--font-weight-medium) var(--text-md) var(--font-sans);color:var(--foreground)}

/* ═══ DRAWER VARIANTS ══════════════════════════════════════════════════════
   Filters and Manage columns are not two components. They are one drawer
   wearing two bodies: same scrim, same panel, same head, same footer, same
   open/close behaviour, same focus trap. Only .ck-drawer-body's contents
   differ, and that is what .is-filters and .is-columns change.

   They were separate organisms before, and the cost showed: the filter drawer
   carried its own -head, -title, -desc and -foot that duplicated the parent's
   and had already drifted from them. One parent means a change to the drawer's
   chrome reaches both, which matters because these two are the most frequently
   opened panels in the product.

   Both are built from atoms — .ck-dd, .ck-input, .ck-search, .ck-btn,
   .ck-chip, .ck-check, .ck-pill, .ck-icon-btn. Nothing here restyles an atom;
   these rules place them and nothing more.

   Spec: references/components/drawer.md */

/* ─── Variant: .is-filters ─────────────────────────────────────────────────
   A stack of rule cards, each one a sentence: FIELD, OPERATOR, then the
   values that answer it. The drawer's head counts the rules and offers to
   clear them; the footer saves or applies. */
/* No separator under the head in this variant. The rule cards are already
   discrete blocks on their own ground, so a line above the first one draws a
   boundary where the eye does not need one — and it cut the head off from the
   content it introduces. The columns drawer keeps its rule, because there the
   body is a flat list with nothing else to separate it. */
/* ── THE WIDTH ADJUSTOR — [data-ck-resize] ────────────────────────────────
   A grab strip on the panel's own edge. 6px wide so it can be hit, drawn as a
   1px rule so it is quiet until approached. The drawer takes it on its LEADING
   edge (it grows leftwards into the page); the folder navigator takes it on
   its trailing edge.

   The bounds are declared per panel and they are the whole point: without them
   a drawer can be dragged down to 40px, which hides the data it exists to
   show, or out to the full viewport, which is a page pretending to be a
   drawer. ckPanelResize() reads them and clamps. */
.ck-drawer,.ck-folder-nav{--ck-resize-min:320px;--ck-resize-max:720px}
[data-ck-resize]{
  position:absolute;inset-block:0;width:6px;z-index:2;
  cursor:col-resize;background:0;border:0;padding:0;
  touch-action:none;user-select:none}
[data-ck-resize="start"]{inset-inline-start:-3px}
[data-ck-resize="end"]{inset-inline-end:-3px}
[data-ck-resize]::before{
  content:'';position:absolute;inset-block:var(--space-md);inset-inline-start:2px;width:1px;
  background:var(--input);opacity:0;transition:opacity var(--duration-base)}
[data-ck-resize]:is(:hover,:focus-visible)::before,
.is-resizing > [data-ck-resize]::before{opacity:1}
.is-resizing > [data-ck-resize]::before{background:var(--primary)/* pairing-exempt: a 1px drag indicator, carries no text */}
[data-ck-resize]:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* The panel must be a positioning context for the handle to sit on its edge,
   and must not clip it. */
.ck-folder-nav{position:relative}

.ck-drawer.is-filters .ck-drawer-head{border-bottom:0}
.ck-drawer.is-filters{width:min(480px,100%)}
.ck-drawer.is-filters .ck-drawer-body{
  padding:var(--space-md) var(--space-base) var(--space-base);
  display:flex;flex-direction:column;gap:var(--space-md)}
/* Clearing every rule is destructive and says so, but it is not the drawer's
   main action — so it is a link button in the destructive tone, not a filled
   red button competing with Apply. */
/* A link button in the destructive tone. Named `destructive` like every other
   tone in the family — .ck-btn.ghost.destructive already exists, and a second
   spelling for one idea is how two of them drift apart. Not scoped to the
   drawer: any link button may carry it. */
.ck-btn.link.destructive{color:var(--destructive)}
.ck-btn.link.destructive:is(:hover,[data-force~="hover"]){
  color:var(--destructive);text-decoration-thickness:2px}

/* One rule. --accent is the kit's soft cyan attention surface, which is what
   the shipped drawer uses: the card has to read as a unit without a stroke
   loud enough to make four of them look like a grid. */
/* --filter-card, a token of its own. It is not --accent: that is the kit's
   "you are here" surface — an open row, a hovered header, the active nav item
   — and borrowing it for a dozen rule cards at once makes the whole drawer
   look selected. Nor is it a palette tint like --teal-bg, which belongs to
   teal-toned CONTENT and would drag its own foreground along with it.

   A rule card is a block you are EDITING inside a panel. That is its own role,
   so it gets its own tokens, minted in all three themes: a fill about 1.21:1
   from the panel it sits on, and a stroke about 1.10:1 from that fill. The
   stroke is a STEP UP FROM THE FILL, not a different colour — it is there to
   close the card, not to outline it. High contrast is the exception by design:
   its stroke steps to 1.56:1, because amplifying edges is what that theme is
   for. */
.ck-filter-rule{
  display:flex;flex-direction:column;gap:var(--space-sm);
  padding:var(--space-md) var(--space-base);
  border:1px solid var(--filter-card-border);border-radius:var(--radius-2xl);
  background:var(--filter-card);color:var(--filter-card-foreground)}
.ck-filter-rule-head{
  display:flex;align-items:center;gap:var(--space-sm);row-gap:var(--space-sm);flex-wrap:wrap}
/* The field name reads as part of the sentence, so its trigger drops the box
   and keeps only the chevron. It is still a .ck-dd — the menu, the keyboard
   handling and the open state all come from the atom. */
.ck-filter-rule-field{flex:none;width:auto;min-width:0}
.ck-dd.ck-filter-rule-field > .ck-dd-trigger{
  height:auto;padding:0;border:0;background:transparent;
  font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);
  color:var(--foreground);gap:var(--space-xs)}
.ck-dd.ck-filter-rule-field > .ck-dd-trigger:is(:hover,[data-force~="hover"]){
  background:transparent;border:0;color:var(--primary)}
.ck-dd.ck-filter-rule-field .ck-dd-arrow{color:var(--foreground)}
/* The operator is a real control — it changes what the rule means — so it
   keeps a surface, sized down to sit under the field name. */
.ck-filter-rule-op{flex:none;width:auto;min-width:0}
.ck-dd.ck-filter-rule-op > .ck-dd-trigger{
  height:28px;padding:0 var(--space-sm);gap:var(--space-xs);
  border:0;border-radius:var(--radius-md);
  background:var(--segment);color:var(--segment-foreground);
  font:var(--font-weight-medium) var(--text-base) var(--font-sans)}
.ck-dd.ck-filter-rule-op > .ck-dd-trigger:is(:hover,[data-force~="hover"]){
  background:var(--hover-bg);color:var(--segment-foreground)}
/* A rule whose operator cannot vary states it in words rather than offering a
   control that does nothing. */
.ck-filter-rule-op-static{
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);
  color:var(--muted-foreground);flex:none}
/* Remove. A hollow ring in the destructive tone — small, because removing one
   rule is minor and reversible, and the drawer has not been applied yet. The
   ::before gives it the 24x24 target § 7c requires without a 24px circle. */
.ck-filter-rule-remove{
  position:relative;margin-inline-start:auto;flex:none;
  display:grid;place-items:center;
  width:16px;height:16px;padding:0;
  border:1.5px solid var(--destructive);border-radius:var(--radius-full);
  background:transparent;color:var(--destructive);cursor:pointer}
.ck-filter-rule-remove::before{
  content:'';position:absolute;left:50%;top:50%;
  width:24px;height:24px;transform:translate(-50%,-50%)}
.ck-filter-rule-remove svg{width:10px;height:10px;stroke-width:2.5;display:block}
.ck-filter-rule-remove:is(:hover,[data-force~="hover"]){
  background:var(--destructive);color:var(--destructive-foreground)}
.ck-filter-rule-remove:focus-visible{outline:0;box-shadow:var(--focus-ring-error)}
/* The value row. Whatever answers the rule goes here — an input, a dropdown,
   a date field — and it always spans the card.

   THE OPERATOR DECIDES WHETHER THERE IS A VALUE AT ALL. "is empty" answers
   itself, so the row and the counter go: showing an input beside it invites an
   answer that will be ignored. "is between" takes two, side by side.
   ckFilterSchema() sets data-value-shape; these rules only respond to it. */
.ck-filter-rule-row{display:flex;align-items:center;gap:var(--space-sm)}
.ck-filter-rule-row > *{flex:1;min-width:0}
.ck-filter-rule[data-value-shape="none"] .ck-filter-rule-row,
.ck-filter-rule[data-value-shape="none"] .ck-filter-hint,
.ck-filter-rule[data-value-shape="none"] .ck-filter-rule-chips{display:none}
.ck-filter-rule[data-value-shape$="-range"] .ck-filter-rule-row > *{flex:1 1 0}
/* How many values are in, against the ceiling. It is a count, not an error,
   until it is one. */
.ck-filter-hint{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground)}
.ck-filter-hint.is-full{color:var(--destructive)}
.ck-filter-rule-chips{display:flex;flex-wrap:wrap;gap:var(--space-sm)}
.ck-filter-rule-chips:empty{display:none}
/* An invalid rule takes the destructive soft triplet and says what is wrong
   in words underneath — tone is redundancy, never the only signal. */
.ck-filter-rule.is-error{
  background:var(--destructive-bg);color:var(--destructive-soft-foreground);
  border-color:var(--destructive-border)}
.ck-filter-rule.is-error .ck-dd.ck-filter-rule-field > .ck-dd-trigger{color:var(--destructive-soft-foreground)}
.ck-filter-error{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--destructive-soft-foreground)}
/* Add sits at the trailing edge under the last rule: it belongs to the stack,
   not to the footer, and the footer's two actions must stay unambiguous. */
.ck-filter-add-row{display:flex;justify-content:flex-end}

/* ─── Variant: .is-columns ─────────────────────────────────────────────────
   A reorderable checklist of the table's columns. Every row does four things —
   show, rename, reorder, and say where the column comes from — so the row is
   the component and the list is just a stack of them. */
.ck-drawer.is-columns{width:min(520px,100%)}
.ck-drawer.is-columns .ck-drawer-body{
  padding:0 var(--space-base) var(--space-base);
  display:flex;flex-direction:column;gap:var(--space-sm)}
/* Search and reset share a row; the search takes the slack. */
.ck-col-tools{display:flex;align-items:center;gap:var(--space-sm)}
.ck-col-tools > .ck-search{flex:1;min-width:0}
.ck-col-tools > .ck-btn{flex:none}
/* Source filter. Chips, not tabs: these narrow a list in place, they do not
   swap panels, and calling them tabs would promise a tabpanel that is not
   there. Selection is aria-pressed on a toggle button. */
.ck-col-seg{display:flex;flex-wrap:wrap;gap:var(--space-sm)}
/* Select-all. The tri-state lives on a real .ck-check, so indeterminate is the
   browser's own property rather than a class that can fall out of step. */
.ck-col-master{
  display:flex;align-items:center;gap:var(--space-sm);
  padding:var(--space-xs) 0;
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  color:var(--foreground)}
.ck-col-list{display:flex;flex-direction:column;gap:var(--space-sm);list-style:none;margin:0;padding:0}
.ck-col-card{
  display:flex;align-items:center;gap:var(--space-sm);
  padding:var(--space-md) var(--space-base);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);
  transition:border-color var(--duration-base),background var(--duration-base)}
.ck-col-card:is(:hover,[data-force~="hover"]){border-color:var(--input);background:var(--hover-bg)}
.ck-col-card:focus-within{border-color:var(--ring)}
/* A column that is off is still listed — it has to be, or you could not turn
   it back on — so it steps down in weight and colour rather than disappearing. */
.ck-col-card.is-off .ck-col-name{color:var(--muted-foreground);font-weight:var(--font-weight-medium)}
.ck-col-grip{
  flex:none;display:grid;place-items:center;
  width:24px;height:24px;padding:0;
  border:0;background:0;border-radius:var(--radius-sm);
  color:var(--input);cursor:grab}
.ck-col-grip:active{cursor:grabbing}
.ck-col-grip svg{width:var(--icon-size);height:var(--icon-size);display:block}
.ck-col-grip:is(:hover,[data-force~="hover"]){background:var(--hover-bg);color:var(--muted-foreground)}
.ck-col-grip:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-col-main{display:flex;align-items:baseline;gap:var(--space-xs);flex:1;min-width:0;flex-wrap:wrap}
.ck-col-name{font:var(--font-weight-semibold) var(--text-base) var(--font-sans);color:var(--foreground)}
.ck-col-key{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.ck-col-key.is-link{color:var(--link);text-decoration:underline}
.ck-col-actions{display:flex;align-items:center;gap:var(--space-sm);flex:none}
/* Rename appears on approach, not at rest. A pencil on all eleven rows is
   eleven pieces of noise for an action taken once; :focus-within keeps it
   reachable from the keyboard (§ 14.3 check 31). */
.ck-col-actions > [data-ck-col-rename]{
  opacity:0;pointer-events:none;transition:opacity var(--duration-base)}
.ck-col-card:is(:hover,:focus-within,[data-force~="hover"]) > .ck-col-actions > [data-ck-col-rename]{
  opacity:1;pointer-events:auto}
/* Renaming happens in place. The card's own content is swapped out rather than
   overlaid, so the row keeps its height and the list does not jump. */
.ck-col-card.is-editing .ck-col-main,
.ck-col-card.is-editing .ck-col-actions{display:none}
.ck-col-edit{display:none;flex:1;min-width:0;align-items:center;gap:var(--space-sm)}
.ck-col-card.is-editing .ck-col-edit{display:flex}
.ck-col-edit > .ck-input{flex:1;min-width:0}
/* Drag. A 3px bar in --primary marks where the row would land — drawn on the
   card being passed, so there is exactly one indicator on screen at a time. */
.ck-col-card.is-dragging{opacity:var(--disabled-opacity);cursor:grabbing}
.ck-col-card.drop-before,.ck-col-card.drop-after{position:relative}
.ck-col-card.drop-before::before,.ck-col-card.drop-after::after{
  content:'';position:absolute;inset-inline:0;height:3px;
  background:var(--primary)/* pairing-exempt: a 3px drop indicator, carries no text */;
  border-radius:var(--radius-xs);pointer-events:none}
.ck-col-card.drop-before::before{top:-5px}
.ck-col-card.drop-after::after{bottom:-5px}
.ck-col-empty{
  padding:var(--space-xl) var(--space-base);text-align:center;
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground)}
/* 14px, rounded, drawn by the kit so it looks the same on every platform. */
/* ─── CHECKBOX (Atom) ──────────────────────────────────────────────────────
   shadcn semantics: --input border at rest, --primary fill with a
   --primary-foreground mark when checked, --ring for focus,
   --destructive for aria-invalid.

   16px to match .ck-radio and shadcn's size-4. It was 14px, which read as a
   misalignment wherever a checkbox and a radio shared a form.

   Spec: references/components/checkbox.md */
.ck-check{
  appearance:none;-webkit-appearance:none;
  width:16px;height:16px;flex:none;margin:0;cursor:pointer;
  border:1.5px solid var(--input);border-radius:var(--radius-xs);
  background:var(--background);position:relative;box-sizing:border-box;
  transition:background var(--duration-base),border-color var(--duration-base)
}
/* data-force alongside every state, so a spec sheet renders the matrix from
   the kit's OWN rules instead of re-declaring them (§ 12.1). The checkbox was
   the one control that never got the hook, so its hover and focus cells drew
   identically to rest and the documentation quietly said nothing. */
.ck-check:is(:hover,[data-force~="hover"]){border-color:var(--primary)}
.ck-check:is(:active,[data-force~="active"]){border-color:var(--primary);background:var(--hover-bg)}
.ck-check:checked{background:var(--primary);border-color:var(--primary)/* pairing-exempt: carries no text */}
/* Centred from the middle rather than offset from the corner, so the tick
   sits in the frame at any box size. Lifted off the geometric centre by
   --ck-tick-lift, because a rotated check reads low when its BOX is centred —
   see the derivation below. */
/* The tick is two borders rotated 45deg. border-radius rounds where they meet
   and both open ends, so the glyph gets the round joins and caps § 7c asks of
   every icon — a border cannot take stroke-linecap, and a data-URI SVG would
   hardcode a colour and stop following the theme.

   CENTRING THE BOX IS NOT CENTRING THE TICK, and that is the whole problem
   here. The element is a 3.5 x 7 rectangle, but the INK is only its right and
   bottom borders — an L sitting against two edges of that rectangle. So the
   ink's centre of mass is down-and-right of the rectangle's own centre, and
   rotating 45deg turns that pair of offsets into a purely VERTICAL drop. A
   plain translate(-50%,-50%) centres the rectangle perfectly and leaves the
   mark visibly low: measured +0.81px below the box centre.

   --ck-tick-lift takes it back, and the value is CALIBRATED AGAINST THE
   RENDER rather than derived on paper. The arithmetic predicts 0.86px, but
   the painted centroid only moves 0.56px for every 1px of lift — the response
   is linear and repeatable, so the zero crossing is at 1.4px, not 0.86px.
   Measured across the sweep: 0px -> +0.81, 0.8px -> +0.36, 1.3px -> +0.07,
   1.4px -> +0.009, 1.5px -> -0.05. Horizontal offset is +0.02px throughout
   and needs no correction.

   If the tick's width, height or border ever change, RE-MEASURE — this number
   does not follow from them by a formula you can reapply.

   The indeterminate minus needs none of this: it is a filled bar, so its ink
   and its box are the same rectangle. Measured +0.02px. */
.ck-check{--ck-tick-lift:1.4px}
.ck-check:checked::after{content:'';position:absolute;left:50%;top:50%;width:3.5px;height:7px;
  border:solid var(--primary-foreground);border-width:0 1.5px 1.5px 0;
  border-radius:0 0 1px 0;
  transform:translate(-50%,calc(-50% - var(--ck-tick-lift))) rotate(45deg)}
.ck-check:checked:is(:hover,[data-force~="hover"]){background:var(--primary-hover);border-color:var(--primary-hover)/* pairing-exempt: carries no text */}
.ck-check:checked:is(:active,[data-force~="active"]){background:var(--primary-active);border-color:var(--primary-active)/* pairing-exempt: carries no text */}
.ck-check:indeterminate{background:var(--primary);border-color:var(--primary)/* pairing-exempt: carries no text */}
/* The minus is drawn as a filled bar rather than a border, so it can take a
   radius on both ends — a border-top has square caps and cannot be rounded. */
.ck-check:indeterminate::after{content:'';position:absolute;left:50%;top:50%;
  width:7px;height:1.5px;
  background:var(--primary-foreground);border-radius:var(--radius-full);
  transform:translate(-50%,-50%)}

/* Invalid. shadcn pairs a --destructive border with a destructive-tinted ring;
   --focus-ring-error already exists for the second half. */
.ck-check[aria-invalid="true"]{border-color:var(--destructive)}
.ck-check[aria-invalid="true"]:is(:focus-visible,[data-force~="focus"]){box-shadow:var(--focus-ring-error)}

/* Disabled. Tokens rather than opacity, so the mark keeps its contrast
   instead of fading with the box (Rulebook §8). */
.ck-check:disabled,.ck-check[aria-disabled="true"]{
  background:var(--muted);border-color:var(--input);cursor:not-allowed;pointer-events:none
/* pairing-exempt: carries no text */}
.ck-check:disabled:checked,.ck-check:disabled:indeterminate{
  background:var(--input);border-color:var(--input)
/* pairing-exempt: carries no text */}
.ck-check:disabled:checked::after,.ck-check:disabled:indeterminate::after{
  border-color:var(--background)
/* pairing-exempt: carries no text */}

.ck-check:is(:focus-visible,[data-force~="focus"]){outline:0;box-shadow:var(--focus-ring)}
/* ─── PICK ROW (Molecule) ──────────────────────────────────────────────────
   A selectable row in a list — structurally a menu item that persists rather
   than firing and closing. Shares the menu item's focus treatment for the same
   reason: an outer ring is clipped by the list's padding.

   Spec: references/components/menu.md § Pick row */
.ck-pick{display:flex;align-items:center;gap:12px;width:100%;padding:9px 8px;
  border:0;background:0;border-radius:var(--radius-sm);cursor:pointer;text-align:start;
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground)}
.ck-pick:hover{background:var(--hover-bg)}
.ck-pick:active{background:var(--selected-bg)}
.ck-pick:focus-visible{outline:0;background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
.ck-pick[aria-selected="true"],.ck-pick.is-on{background:var(--selected-bg);color:var(--selected-fg)}
.ck-pick[aria-selected="true"]:hover,.ck-pick.is-on:hover{background:var(--hover-bg)}
.ck-pick:disabled,.ck-pick[aria-disabled="true"]{color:var(--input);cursor:not-allowed;pointer-events:none}

/* Wider dialog for two-column forms. */
.ck-field-label .ck-info{width:var(--icon-size);height:var(--icon-size);color:var(--muted-foreground);cursor:help;display:inline-flex}
.ck-dialog-note{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);line-height:1.55}

/* Controls stay white inside a teal tile so they keep their edge. */
.ck-settings-card .ck-input,.ck-settings-card .ck-select,.ck-settings-card .ck-textarea,
.ck-settings-card .ck-dd-trigger,.ck-settings-card .ck-table{background:var(--background)/* pairing-exempt: re-asserts the surface only; the base .ck-input rule owns the colour */}
.ck-settings-card .ck-table th{/* pairing-exempt: header band inside an --accent card; the base .ck-table th rule owns the colour */background:var(--accent)}
.ck-settings-card .ck-switch-list > .ck-switch-block + .ck-switch-block{border-top-color:var(--panel-border)}

/* Remove action — red stroked minus in a circle, 16px. */

/* ─── TOOLTIP (Molecule) ───────────────────────────────────────────────────
   Text-only help on hover AND focus. If it holds a control it is a popover.

   TWO variants x FOUR placements = eight tooltips, ONE size:
     default   --primary fill, --primary-foreground text. The product default.
     .is-light --popover fill, --popover-foreground text, --shadow-panel.
               For a tooltip over dark or busy content, where a primary-filled
               bubble would compete.

   There is no size scale. A tooltip is as wide as its content up to 320px and
   as tall as it needs — one standard shadow, one padding. A "large tooltip"
   is a popover.

   MULTILINE is supported: the text wraps, `white-space` is normal, and
   line-height is set for two or three lines to read properly.

   TRUNCATION: the same rule as everywhere else (§ 14.9). A tooltip whose own
   text is too long truncates with .ck-mid-trunc, and anything truncated
   elsewhere shows its full value in a tooltip of this style — the truncated
   element and its tooltip are the same component, so they cannot diverge.

   Spec: references/components/tooltip.md */
.ck-tip{
  position:fixed;z-index:calc(var(--z-toast) + 20);
  max-width:320px;padding:8px 10px;
  border-radius:var(--radius-2xl);
  background:var(--primary);color:var(--primary-foreground);
  border:1px solid var(--primary);
  /* NO shadow, ever. A tooltip is a transient label, not a surface: a shadow
     under it reads as a second panel and, stacked over a bar or a card that
     already casts one, the two collide and look like a rendering fault. Its
     own fill and border carry it. Universal rule — see the sanity bible. */
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);line-height:1.5;
  white-space:normal;overflow-wrap:anywhere;
  opacity:0;pointer-events:none;
  transition:opacity var(--duration-base)}
.ck-tip.open{opacity:1;pointer-events:auto}

/* Light variant — same geometry, same shadow, inverted surface. */
.ck-tip.is-light{
  background:var(--popover);color:var(--popover-foreground);
  border-color:var(--panel-border)}

/* ── Tail ──
   An 8px square rotated 45deg with half of it protruding from the edge that
   faces the anchor. Placement names follow Radix / shadcn, where the side is
   where the TOOLTIP sits: .is-top means the tooltip is ABOVE its anchor, so
   its tail is on the BOTTOM edge pointing down.

   Four placements x two variants = the eight tooltips. Both variants get the
   same tail; it inherits the bubble's fill and stroke, so a light tooltip's
   tail carries --panel-border and a default one's is invisible against its own
   --primary edge.

   Rotating a square moves its edges: after rotate(45deg) the top border draws
   the upper-RIGHT facet, right draws lower-right, bottom draws lower-left and
   left draws upper-left. So each placement keeps the two OUTWARD facets and
   zeroes the two facing the bubble — otherwise the stroke draws a line across
   the bubble it is attached to. box-sizing keeps the diamond 8px either way. */
.ck-tip::after{
  content:'';position:absolute;width:8px;height:8px;box-sizing:border-box;
  background:var(--primary);border:1px solid var(--primary);
  transform:rotate(45deg)}
.ck-tip.is-light::after{background:var(--popover);border-color:var(--panel-border)/* pairing-exempt: the tail carries no text; it inherits the bubble's fill and stroke */}
/* tail below — keeps right + bottom */
.ck-tip.is-top::after{
  inset-block-end:-4px;inset-inline-start:50%;margin-inline-start:-4px;
  border-block-start-width:0;border-inline-start-width:0}
/* tail above — keeps top + left */
.ck-tip.is-bottom::after{
  inset-block-start:-4px;inset-inline-start:50%;margin-inline-start:-4px;
  border-block-end-width:0;border-inline-end-width:0}
/* tail on the inline-end edge — keeps top + right */
.ck-tip.is-start::after{
  inset-inline-end:-4px;inset-block-start:50%;margin-block-start:-4px;
  border-block-end-width:0;border-inline-start-width:0}
/* tail on the inline-start edge — keeps bottom + left */
.ck-tip.is-end::after{
  inset-inline-start:-4px;inset-block-start:50%;margin-block-start:-4px;
  border-block-start-width:0;border-inline-end-width:0}

/* Multiline: a title line plus body reads better than one long run. */
.ck-tip-title{display:block;font:var(--font-weight-semibold) var(--text-base) var(--font-sans);margin-bottom:2px}
.ck-tip b{font-weight:600}
.ck-tip .ck-tip-eg{display:block;margin-top:6px;opacity:.82}

/* A truncated label's tooltip carries the full string, and its own text can
   truncate too — one line, middle-truncated, same style. */
.ck-tip.is-single-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.ck-tip code{display:block;margin-top:4px;padding:3px 6px;border-radius:var(--radius-xs);
  font:var(--font-weight-medium) var(--text-md) var(--font-mono);background:var(--tip-code-bg);white-space:pre-wrap}
/* ─── MENU SEARCH ─────────────────────────────────────────────────────────
   A menu long enough to scan is a menu worth filtering. Add .has-search to
   .ck-menu and put .ck-menu-search as its first child. */
.ck-menu.has-search{min-width:248px;padding:0}
/* The search row is the .ck-search MOLECULE, not a second one. It used to be
   a parallel implementation — its own input, its own magnifier at a different
   offset, its own spinner, and no clear button at all, which is why the cross
   never appeared once you typed. An atom or molecule used inside an organism
   brings its behaviour with it (§ 14 check 40); re-styling a copy is how the
   two drift until one of them is missing a control.

   All that belongs here is where it sits. */
.ck-menu-search{padding:8px;border-bottom:1px solid var(--border);flex:none}
.ck-menu-search > .ck-search{display:block}
.ck-menu.has-search .ck-menu-list{max-height:260px;overflow-y:auto;padding:4px}
.ck-menu.has-search .ck-menu-item mark{background:var(--highlight-bg);color:inherit;border-radius:var(--radius-xs);padding:0 1px}
.ck-menu-empty{padding:16px 10px;text-align:center;font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}.ck-remove:focus-visible{outline:0;box-shadow:var(--focus-ring-error)}

/* ─── ICON (Atom) ──────────────────────────────────────────────────────────
   Every icon in the product is Lucide: 24x24 viewBox, fill="none",
   stroke="currentColor", stroke-width 2, round caps and joins, no transforms
   and no explicit colours. https://lucide.dev

   ONE size: a 16x16 glyph centred in a 20x20 box, so the margin is 2px on
   every side and a column of icons lines up regardless of glyph shape. The box
   is what you lay out against; the glyph is what you see.

   Two colours only — default and destructive. A tone beyond those is a defect,
   not a variant.

   Spec: references/components/icon.md */
.ck-ico{
  display:inline-grid;place-items:center;flex:none;
  width:var(--icon-box);height:var(--icon-box);
  color:var(--icon-color);
  transition:color var(--duration-base),background var(--duration-base)}
.ck-ico svg{width:var(--icon-size);height:var(--icon-size);display:block;
  stroke-width:var(--icon-stroke)}
.ck-ico.is-destructive{color:var(--icon-color-destructive)}

/* Interactive icons. A bare .ck-ico is decorative and has no states; add
   .is-interactive, or use .ck-icon-btn when it is a real button. */
.ck-ico.is-interactive{cursor:pointer;border-radius:var(--radius-md)}
.ck-ico.is-interactive:hover{color:var(--foreground);background:var(--hover-bg)}
.ck-ico.is-interactive:active{background:var(--selected-bg)}
.ck-ico.is-interactive.is-selected{color:var(--primary);background:var(--selected-bg)}
.ck-ico.is-interactive:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-ico.is-destructive.is-interactive:hover{color:var(--destructive-soft-foreground);background:var(--destructive-bg)}
.ck-ico.is-destructive.is-interactive:active{background:var(--destructive);color:var(--destructive-foreground)}
.ck-ico.is-destructive.is-interactive.is-selected{color:var(--destructive-soft-foreground);background:var(--destructive-bg)}
.ck-ico.is-destructive.is-interactive:focus-visible{box-shadow:var(--focus-ring-error)}
.ck-ico.is-disabled,.ck-ico[aria-disabled="true"]{color:var(--input);cursor:not-allowed;pointer-events:none}

/* Every control that holds an icon uses the same 16px glyph and 2px stroke.
   The BOX varies with the control; the glyph does not. */
.ck-icon-btn svg,.ck-btn svg,.ck-menu-item svg,
.ck-dd-opt svg,.ck-pick svg,.ck-toast-icon svg,.ck-empty-icon svg{stroke-width:var(--icon-stroke)}

/* ─── EMPTY / LOADING / SKELETON (states) ─────────────────────────────────
   Three distinct answers to "there is nothing to show yet", and they must not
   be swapped:
     loading   a shimmer in the SHAPE of the content that is coming
     empty     a dashed outline saying there is none, plus a way to change that
     error     a destructive-tinted panel with a retry

   Spec: references/components/states.md */

/* Skeletons for each primitive, so a loading state can be built to the shape
   of the thing it replaces rather than as a grey rectangle. */
.ck-skeleton-avatar{width:var(--icon-box);height:var(--icon-box);border-radius:var(--radius-full)}
.ck-skeleton-ico{width:var(--icon-box);height:var(--icon-box);border-radius:var(--radius-sm)}
.ck-skeleton-image{width:100%;aspect-ratio:16/10;border-radius:var(--radius-2xl)}
.ck-skeleton-pill{width:72px;height:24px;border-radius:var(--radius-full)}
.ck-skeleton-btn{width:88px;height:36px;border-radius:var(--radius-md)}
.ck-skeleton-input{width:100%;height:36px;border-radius:var(--radius-md)}

/* A list of skeleton rows. --ck-skel-rows sets how many. */
.ck-skeleton-list{display:flex;flex-direction:column;gap:2px}
.ck-skeleton-list .ck-skeleton-row{padding:9px 10px}

/* Table loading: skeleton cells that keep the column widths, so the header
   does not jump when the real rows arrive. */
.ck-table.is-loading tbody td{padding:11px 14px}
/* nothing else: the loading row inherits --table-row-height from .ck-table, so
   it is the same height as a data row by construction rather than by luck. */
.ck-table.is-loading .ck-skeleton-text{height:12px}

/* Loading overlay for a panel that already has a size. Keeps the panel's own
   height so the page does not reflow when it resolves. */
.ck-loading{position:relative;min-height:120px}
.ck-loading-overlay{position:absolute;inset:0;display:grid;place-items:center;
  gap:10px;grid-auto-flow:row;justify-items:center;
  background:var(--card);color:var(--card-foreground);border-radius:inherit}
.ck-loading-label{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}

/* Image placeholder — a real element rather than a background, so alt text and
   a broken-image fallback both work. */
.ck-image{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;
  border-radius:var(--radius-2xl);background:var(--muted)/* pairing-exempt: carries no text */}
/* An unsized <svg> in a grid cell stretches to fill it, which is how the
   placeholder glyph rendered at full panel height. § 7c: every glyph is 16px
   regardless of what the markup carries. */
.ck-image-empty > svg{
  width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);display:block}
/* A placeholder ILLUSTRATION is not a glyph — it fills the frame. Use
   .ck-image with a src for that; this keeps an <img> inside .ck-image-empty
   behaving the same way if one is passed. */
.ck-image-empty > img{
  width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.ck-image-empty{display:grid;place-items:center;gap:6px;width:100%;aspect-ratio:16/10;
  border-radius:var(--radius-2xl);border:1px dashed var(--input);
  /* pairing-exempt: placeholder copy is deliberately de-emphasised; --muted-foreground on --background is 3.44:1, same as .ck-empty */
  background:var(--background);color:var(--muted-foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans)}

/* Error state — the third answer, and the one most often missing. */
.ck-error-state{display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:36px 16px;text-align:center;
  border-radius:var(--radius-2xl);border:1px solid var(--destructive-border);
  background:var(--destructive-bg);color:var(--destructive-soft-foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans)}
.ck-error-state .ck-ico{color:var(--icon-color-destructive)}
.ck-error-state-title{font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--destructive-soft-foreground)}

/* ═══════════════════════════════════════════════════════════════════════════
   v3.2 GAP CLOSURE — components the v2.0 kit shipped and this kit had not.
   Every rule below is tokens-only; no new token was minted, because the
   superset token set already carried a role for each value. Register rows in
   rulebook § 14.1, spec sheets in references/components/.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── DIVIDER (Atom) ───────────────────────────────────────────────────────
   A rule between regions. Four forms: solid, dashed, labelled, vertical.

   ONE colour for all of them: --panel-border, the § 5 "visible structural
   stroke". It was --border, which is 1.09:1 against the page — invisible by
   design, because § 5 scopes --border to hairlines INSIDE a surface (table
   rows, list separators, menu dividers), not to a rule that separates regions.
   A divider you cannot see is not doing its job. The old .is-strong variant
   existed only to reach this value, so it is retired: it is now the default and
   there is nothing to opt into.

   Retired with it: .is-accent (--primary) and .is-thick (2px). One divider,
   one colour, one weight — a rule that varies by emphasis invites a second
   decision at every call site for no gain.

   Note the ceiling: --panel-border measures 1.16:1 against the page (§ 14.5,
   open). Making a divider genuinely high-contrast means changing that token's
   VALUE, which moves every panel stroke in the product with it — a token-set
   decision, not a component one.

   .ck-menu-sep stays as it is; it is the menu's own scoped divider, is a
   hairline inside a surface, and correctly reads --border.

   Spec: references/components/divider.md */
.ck-divider{
  flex:none;border:0;height:1px;margin:0;
  background:var(--panel-border)/* pairing-exempt: carries no text */}
/* Dashed cannot be a background: it is a border style. Height goes to 0 and
   the stroke carries it, so both forms occupy the same 1px. */
.ck-divider.is-dashed{height:0;background:0;border-top:1px dashed var(--panel-border)}

.ck-divider.is-vertical{width:1px;height:auto;align-self:stretch;min-height:var(--space-base)}
.ck-divider.is-vertical.is-dashed{
  width:0;height:auto;border-top:0;border-inline-start:1px dashed var(--panel-border)}

/* Labelled — the "or" between two auth options. The rules are ::before and
   ::after so the label stays a single text node and centres itself. */
.ck-divider-label{
  display:flex;align-items:center;gap:var(--space-md);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground)}
.ck-divider-label::before,.ck-divider-label::after{
  content:'';flex:1;height:1px;background:var(--panel-border)}

/* ─── ALERT (Molecule) ─────────────────────────────────────────────────────
   A persistent inline banner: something the user should know while they work.
   NOT a toast (transient, self-dismissing, floats) and NOT .ck-error-state
   (a content state that replaces the content). All three exist and are not
   interchangeable — § 7d.

   Tones are the soft-semantic triplet (§ 3): --X-bg fill, --X-border stroke,
   --X-soft-foreground text. Never the solid --X as text on its own tint.

   The neutral default is a declared cross-pair: --foreground on --muted is
   15.87:1 where the nominal --muted-foreground partner is 3.16:1 and would
   fail AA for body copy. Same exemption .ck-table th and .ck-pill.is-neutral
   already carry.

   Spec: references/components/alert.md */
.ck-alert{/* pairing-exempt: --muted is an alert tint, not a muted-content surface; --foreground on it is 15.87:1 where the nominal --muted-foreground partner is 3.16:1 */
  display:flex;align-items:flex-start;gap:var(--space-md);box-sizing:border-box;
  padding:var(--space-md) var(--space-base);
  border:1px solid var(--border);border-radius:var(--radius-2xl);
  background:var(--muted);color:var(--foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans)}
.ck-alert.size-sm{padding:var(--space-sm) var(--space-md);gap:var(--space-sm)}
.ck-alert.size-lg{padding:var(--space-base) var(--space-lg)}

.ck-alert-icon{
  width:var(--icon-box);height:var(--icon-box);flex:none;
  display:inline-grid;place-items:center;color:var(--icon-color)}
.ck-alert-icon svg{
  width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);display:block}
.ck-alert-content{flex:1;min-width:0}
.ck-alert-title{font:var(--font-weight-semibold) var(--text-md) var(--font-sans);margin-bottom:var(--space-2xs)}
.ck-alert-msg{font:var(--font-weight-normal) var(--text-md) var(--font-sans);line-height:1.5}
.ck-alert-action{margin-top:var(--space-sm)}
/* The dismiss is a destructive icon and reads as one (§ 7c) — its tone is set
   with .ck-icon-btn.tone-danger above; this only pulls it into the padding. */
.ck-alert > .ck-icon-btn{margin-block-start:calc(-1 * var(--space-2xs))}

/* Tones — fill, stroke, text and icon are one family. */
.ck-alert.is-info{background:var(--info-bg);color:var(--info-soft-foreground);border-color:var(--info-border)}
.ck-alert.is-success{background:var(--success-bg);color:var(--success-soft-foreground);border-color:var(--success-border)}
.ck-alert.is-warning{background:var(--warning-bg);color:var(--warning-soft-foreground);border-color:var(--warning-border)}
.ck-alert.is-error{background:var(--destructive-bg);color:var(--destructive-soft-foreground);border-color:var(--destructive-border)}
.ck-alert.is-info .ck-alert-icon,
.ck-alert.is-success .ck-alert-icon,
.ck-alert.is-warning .ck-alert-icon,
.ck-alert.is-error .ck-alert-icon{color:inherit}

/* ─── PROGRESS (Atom) ─────────────────────────────────────────────────────
   Determinate by default; .is-indeterminate for work of unknown length.

   The track is --muted, a light grey; the FILL is --primary. § 9 defect 0
   names "a progress fill", not a progress track, and that is the right reading:
   the fill is what conveys the value and it clears 3:1 comfortably (12.01:1),
   while the track is only its container. An earlier pass put the track on
   --input by over-reading that rule, which made the unfilled remainder a mid
   grey heavy enough to compete with the fill.

   A progress bar therefore belongs on --card or --background. On --canvas
   directly the --muted track is nearly invisible, which is a placement
   mistake rather than a token one.

   Width is set inline (style="width:62%") or via --ck-prog-val, because the
   value is data, not style.

   Spec: references/components/progress.md */
.ck-progress{
  --ck-prog-h:8px;
  position:relative;width:100%;height:var(--ck-prog-h);box-sizing:border-box;
  border-radius:var(--radius-full);overflow:hidden;
  background:var(--track)/* pairing-exempt: a track carries no text */}
.ck-progress.size-sm{--ck-prog-h:4px}
.ck-progress.size-lg{--ck-prog-h:12px}
.ck-progress-bar{
  height:100%;width:var(--ck-prog-val,0);border-radius:var(--radius-full);
  background:var(--primary);
  transition:width var(--duration-moderate) var(--ease-out)/* pairing-exempt: carries no text */}
.ck-progress.is-success .ck-progress-bar{background:var(--success)/* pairing-exempt: carries no text */}
.ck-progress.is-warning .ck-progress-bar{background:var(--warning)/* pairing-exempt: carries no text */}
.ck-progress.is-error .ck-progress-bar{background:var(--destructive)/* pairing-exempt: carries no text */}

/* Indeterminate — a fixed-width fill sliding the length of the track. */
@keyframes ck-progress-slide{
  0%{transform:translateX(-100%)}
  100%{transform:translateX(350%)}}
.ck-progress.is-indeterminate .ck-progress-bar{
  width:30%;animation:ck-progress-slide 1.4s var(--ease-default) infinite}
@media (prefers-reduced-motion:reduce){
  .ck-progress.is-indeterminate .ck-progress-bar{animation-duration:3.6s}
  .ck-progress-bar{transition:none}}

/* ── Count variant ───────────────────────────────────────────────────────
   For work measured in THINGS, not percent: "3 of 12 files uploaded".

   The fill width is DERIVED from the two counts rather than passed in as a
   separate percentage, so the bar and the readout cannot disagree — the same
   reasoning as the switch's derived thumb travel. calc() divides by a unitless
   custom property, verified: 3/12 of a 400px track measures exactly 100px.

   A failed segment abuts the completed one on the same track, so the three
   quantities — done, failed, not-yet-attempted — read as one bar.

   aria-valuetext is REQUIRED here. Without it assistive tech computes a
   percentage from min/max and announces "25%", which is the wrong unit for
   the thing being measured. Spec: references/components/progress.md */
.ck-progress.is-count{
  --ck-prog-done:0;--ck-prog-total:1;--ck-prog-failed:0;
  display:flex;align-items:stretch}
.ck-progress.is-count .ck-progress-bar{
  width:calc(var(--ck-prog-done) / var(--ck-prog-total) * 100%)}
.ck-progress.is-count .ck-progress-fail{
  flex:none;height:100%;
  width:calc(var(--ck-prog-failed) / var(--ck-prog-total) * 100%);
  border-radius:var(--radius-full);
  background:var(--destructive)/* pairing-exempt: carries no text */}
/* Where both segments are present the inner edges square off, so the two read
   as one continuous bar; the track's own overflow clip rounds the outer ends. */
.ck-progress.is-count:has(.ck-progress-fail) .ck-progress-bar{
  border-start-end-radius:0;border-end-end-radius:0}
.ck-progress.is-count:has(.ck-progress-bar) .ck-progress-fail{
  border-start-start-radius:0;border-end-start-radius:0}

/* The count readout. The completed number carries the emphasis; the total and
   the noun stay quiet, so a glance lands on what changed. */
.ck-progress-count{
  font-variant-numeric:tabular-nums;color:var(--muted-foreground)}
.ck-progress-count > strong{
  font-weight:var(--font-weight-semibold);color:var(--foreground)}
.ck-progress-count > .is-failed{color:var(--destructive-soft-foreground)}

/* The value in text beside the bar. A bar alone is not a label. */
.ck-progress-row{display:flex;flex-direction:column;gap:var(--space-xs)}
.ck-progress-meta{
  display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-progress-val{font-variant-numeric:tabular-nums;color:var(--foreground)}

/* ─── SLIDER (Atom) ───────────────────────────────────────────────────────
   A real <input type="range">. § 14.9 check 11: the event belongs on the
   native control, or keyboard users get nothing — and range gives arrow keys,
   Home/End and PageUp/Down for free.

   The filled portion is a gradient on the track driven by --ck-slider-pct,
   which ckSlider() in clipper-kit.js keeps in sync with the value. WebKit has
   no ::-moz-range-progress equivalent, so the gradient is the only way to fill
   a native range without a token-breaking image.

   Rail is --muted for the same reason as Progress: the affordance is the THUMB
   and the filled portion, both on --primary at 12.01:1, so the unfilled
   remainder is a container rather than the thing that must be perceived. That
   is a declared deviation from § 9's "slider rail" wording, stated here so the
   next reader can weigh it rather than discover it.

   The thumb is 20px with a 2px ring — it fills --icon-box exactly, so the
   whole control height is the target, and it reads as a grabbable control
   rather than a glyph. Rail is 8px, the same as Progress's default track.

   Spec: references/components/slider.md */
.ck-slider{
  --ck-slider-pct:0%;
  appearance:none;-webkit-appearance:none;
  /* 20px is the slider's OWN height — a 20px thumb with a 2px ring, which is
     this control's identity rather than an icon box. It used to read
     --icon-box; when that grew to 24 the thumb would have stayed 20 and the
     rail centring (margin-top:-6px) would have drifted 2px. */
  width:100%;height:20px;margin:0;padding:0;
  background:0;cursor:pointer}

/* Track — WebKit / Blink */
.ck-slider::-webkit-slider-runnable-track{
  height:8px;border-radius:var(--radius-full);
  background:linear-gradient(to right,
    var(--primary) 0 var(--ck-slider-pct),
    var(--track) var(--ck-slider-pct) 100%)/* pairing-exempt: rail and thumb carry no text */}
.ck-slider::-webkit-slider-thumb{
  appearance:none;-webkit-appearance:none;box-sizing:border-box;
  width:20px;height:20px;margin-top:-6px;
  border:2px solid var(--primary);border-radius:var(--radius-full);
  background:var(--background);box-shadow:var(--shadow-raised);
  transition:border-color var(--duration-base)/* pairing-exempt: carries no text */}
/* Track — Gecko. ::-moz-range-progress paints the fill natively, so the rail
   stays flat and no gradient is needed. */
.ck-slider::-moz-range-track{
  height:8px;border-radius:var(--radius-full);
  background:var(--track)/* pairing-exempt: carries no text */}
.ck-slider::-moz-range-progress{
  height:8px;border-radius:var(--radius-full);
  background:var(--primary)/* pairing-exempt: carries no text */}
.ck-slider::-moz-range-thumb{
  box-sizing:border-box;width:20px;height:20px;
  border:2px solid var(--primary);border-radius:var(--radius-full);
  background:var(--background);box-shadow:var(--shadow-raised)/* pairing-exempt: carries no text */}

.ck-slider:hover::-webkit-slider-thumb{border-color:var(--primary-hover)}
.ck-slider:hover::-moz-range-thumb{border-color:var(--primary-hover)}
.ck-slider:active::-webkit-slider-thumb{border-color:var(--primary-active)}
.ck-slider:active::-moz-range-thumb{border-color:var(--primary-active)}
.ck-slider:focus-visible{outline:0}
.ck-slider:focus-visible::-webkit-slider-thumb{box-shadow:var(--focus-ring)}
.ck-slider:focus-visible::-moz-range-thumb{box-shadow:var(--focus-ring)}
.ck-slider[aria-invalid="true"]::-webkit-slider-thumb{border-color:var(--destructive)}
.ck-slider[aria-invalid="true"]:focus-visible::-webkit-slider-thumb{box-shadow:var(--focus-ring-error)}
.ck-slider:disabled{cursor:not-allowed}
.ck-slider:disabled::-webkit-slider-runnable-track{
  background:linear-gradient(to right,
    var(--input) 0 var(--ck-slider-pct),
    var(--track) var(--ck-slider-pct) 100%)/* pairing-exempt: carries no text */}
.ck-slider:disabled::-webkit-slider-thumb{
  border-color:var(--input);background:var(--muted)/* pairing-exempt: carries no text */}
.ck-slider:disabled::-moz-range-track{background:var(--track)/* pairing-exempt: carries no text */}
.ck-slider:disabled::-moz-range-thumb{border-color:var(--input);background:var(--muted)/* pairing-exempt: carries no text */}

.ck-slider-row{display:flex;align-items:center;gap:var(--space-md)}
.ck-slider-val{
  flex:none;min-width:var(--space-3xl);text-align:end;
  font:var(--font-weight-medium) var(--text-md) var(--font-mono);font-variant-numeric:tabular-nums;
  color:var(--foreground)}

/* ─── KBD (Atom) ──────────────────────────────────────────────────────────
   A keycap in running text. --secondary / --secondary-foreground rather than
   --muted / --muted-foreground: a keycap carries 11px text, and
   muted-foreground on muted is 3.16:1 (§ 9 defect 1). The secondary pair is a
   proper family and clears AA.

   Two literals, both this component's identity and recorded in its sheet: the
   2px bottom border that reads as a key's bevel, and the 20px cap that matches
   --icon-box so a keycap and an icon line up in the same row.

   Radius is --radius-sm, not the --radius-xs the § 7b mark tier gives inline
   code. A keycap is an object, not a code span; 2px on a 24px box reads as a
   rendering artefact.

   Spec: references/components/kbd.md */
.ck-kbd{
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  min-width:var(--icon-box);height:var(--icon-box);padding:0 var(--space-xs);
  border:1px solid var(--input);border-bottom-width:2px;border-radius:var(--radius-sm);
  background:var(--secondary);color:var(--secondary-foreground);
  font:var(--font-weight-medium) var(--text-sm) var(--font-mono);line-height:1;
  white-space:nowrap;vertical-align:middle}
.ck-kbd.size-sm{min-width:var(--space-base);height:var(--space-base);font-size:var(--text-xs)}
.ck-kbd.size-lg{min-width:var(--space-xl);height:var(--space-xl);padding:0 var(--space-sm);font-size:var(--text-md)}
/* A combination — Cmd + K. The joiner is text so it can be translated. */
.ck-kbd-combo{
  display:inline-flex;align-items:center;gap:var(--space-xs);
  font:var(--font-weight-normal) var(--text-sm) var(--font-sans);color:var(--muted-foreground)}

/* ─── TOGGLE (Atom) ───────────────────────────────────────────────────────
   A button that stays pressed. Distinct from .ck-switch: a switch commits an
   on/off setting immediately and announces as role="switch"; a toggle is a
   button whose pressed state is a mode (bold, a filter, a view). They are not
   substitutes for each other.

   On the § 7a control scale — 28 / 34 / 40 — because a toggle shares rows with
   buttons and icon buttons.

   State is driven by aria-pressed, not a class, so what is drawn cannot drift
   from what is announced (§ 14.3 check 12). Requires aria-pressed; a glyph-only
   toggle also requires aria-label.

   Spec: references/components/toggle.md */
.ck-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:var(--space-xs);
  height:36px;min-width:36px;padding:0 var(--space-md);box-sizing:border-box;
  border:1px solid transparent;border-radius:var(--radius-md);
  background:transparent;color:var(--foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);white-space:nowrap;cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base),border-color var(--duration-base)}
.ck-toggle svg{
  width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);flex:none;display:block}
.ck-toggle.size-sm{height:28px;min-width:28px;padding:0 var(--space-sm);gap:var(--space-2xs)}
.ck-toggle.size-lg{height:44px;min-width:44px;padding:0 var(--space-base);gap:var(--space-sm)}

.ck-toggle:hover{background:var(--hover-bg)}
.ck-toggle:active{background:var(--selected-bg)}
.ck-toggle[aria-pressed="true"]{
  background:var(--selected-bg);color:var(--selected-fg);border-color:var(--primary)}
.ck-toggle[aria-pressed="true"]:hover{background:var(--hover-bg);color:var(--selected-fg)}
.ck-toggle:disabled,.ck-toggle[aria-disabled="true"]{
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);
  cursor:not-allowed;pointer-events:none}
.ck-toggle:focus-visible{outline:0;box-shadow:var(--focus-ring)}

/* A segmented group. Nested radii step inward (§ 14.8 check 6): the group is
   --radius-md, so its children drop to --radius-sm. */
.ck-toggle-group{
  display:inline-flex;align-items:center;gap:var(--space-2xs);box-sizing:border-box;
  padding:var(--space-2xs);
  border:1px solid var(--input);border-radius:var(--radius-md);
  background:var(--background);color:var(--foreground)}
.ck-toggle-group .ck-toggle{border-radius:var(--radius-sm);border-color:transparent}
.ck-toggle-group .ck-toggle[aria-pressed="true"]{border-color:transparent}

/* ─── LINK BUTTON — .ck-btn.link (Atom variant) ───────────────────────────
   v2.0 shipped "Link Button" with sm / md / lg, i.e. a button-shaped link, so
   this is a fifth .ck-btn variant rather than a new component (§ 10 rule 1:
   try harder to reuse). It keeps the control height scale, so it still aligns
   in a dialog footer beside a filled button.

   Colour is --link, which exists precisely for this and is distinct from
   --primary. The underline carries the affordance, since there is no fill and
   no border. Declared after the .ck-btn base so it wins on source order.

   Spec: references/components/button.md § Link variant */
.ck-btn.link{
  background:transparent;color:var(--link);border-color:transparent;
  text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.ck-btn.link:is(:hover,[data-force~="hover"]){
  background:transparent;color:var(--link);text-decoration-thickness:2px}
.ck-btn.link:is(:active,[data-force~="active"]){background:var(--hover-bg);color:var(--link)}
.ck-btn.link:is(:disabled,.disabled,[aria-disabled="true"],[data-force~="disabled"]){
  background:transparent;color:var(--muted-foreground);border-color:transparent;
  text-decoration-color:var(--muted-foreground)}
.ck-btn.link:is(:focus-visible,[data-force~="focus"]){outline:0;box-shadow:var(--focus-ring)}

/* ─── PAGINATION (Organism) ───────────────────────────────────────────────
   Page list, prev/next, a gap marker, a row count, and a per-page chooser.

   The numeral buttons are on the control scale so the whole bar lines up with
   the toolbar above it; the size class goes on .ck-pag and cascades, which is
   the same placement rule as .ck-dd (§ 14.1: a size on the inner element is a
   defect). Prev/next are .ck-icon-btn and the per-page chooser is .ck-dd —
   neither is reimplemented here.

   The current page is --primary / --primary-foreground rather than the
   --selected-bg pair: it is the one unambiguous position marker in the bar and
   needs to outrank hover, which owns --hover-bg.

   Spec: references/components/pagination.md */
/* ─── PAGINATION — a table footer bar ──────────────────────────────────────
   Sequential nav only: first / previous / next / last, in .ck-pag-nav. There
   is no numbered page list, because the product pages through tables one step
   at a time. .ck-pag carries no size class — the controls inside bring their
   own. Spec: references/components/pagination.md */
.ck-pag{
  display:flex;align-items:center;gap:var(--space-lg);flex-wrap:wrap;
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground)}
.ck-pag-info{color:var(--muted-foreground);font-variant-numeric:tabular-nums}

/* ── Bar form — .ck-pag.is-bar ────────────────────────────────────────────
   A table footer rather than a run of page numbers: rows selected, total,
   rows-per-page, "Page X of Y", and first/prev/next/last. Ported from the
   v2.0 reference, re-expressed in v3.2 terms — its own version used dead
   token names (--bg, --fg, --border-strong), opacity for disabled, a
   scale(.95) press and off-scale 32px buttons, all of which the rulebook now
   forbids. Structure and behaviour are the reference's; the values are the
   kit's. Spec: references/components/pagination.md */
/* The bar keeps its shape when the panel gets narrow: the run scrolls
   sideways instead of stacking. Wrapping used to reflow the footer into two or
   three lines, which moved the buttons under the reader's cursor and changed
   the panel's height as the window resized. Scrolling keeps every control
   where the user last saw it. */
.ck-pag.is-bar{
  justify-content:space-between;flex-wrap:nowrap;gap:var(--space-base);width:100%;
  min-height:48px;padding:var(--space-sm) var(--space-md);box-sizing:border-box;
  border-top:1px solid var(--border);
  color:var(--muted-foreground);
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin}
.ck-pag.is-bar > *{flex:none}
/* Nothing selected and no count to show: the run collapses to the right. */
.ck-pag.is-bar.is-compact{justify-content:flex-end}
.ck-pag-total{white-space:nowrap;font-variant-numeric:tabular-nums}
.ck-pag-total > strong{
  margin-inline-start:var(--space-xs);
  font-weight:var(--font-weight-semibold);color:var(--foreground)}
.ck-pag-group{display:flex;align-items:center;gap:var(--space-lg);flex-wrap:nowrap}
.ck-pag-rpp{display:flex;align-items:center;gap:var(--space-sm);white-space:nowrap}
/* Fixed width, so stepping 9 -> 10 does not shift the buttons beside it. */
.ck-pag-page{
  white-space:nowrap;text-align:center;min-width:var(--space-7xl);
  font-variant-numeric:tabular-nums;color:var(--foreground)}
.ck-pag-nav{display:flex;align-items:center;gap:var(--space-sm)}

/* Narrow viewports tighten the spacing; they do NOT reflow the bar. The
   horizontal scroll above is what handles the squeeze. */
@media (max-width:768px){
  .ck-pag.is-bar{gap:var(--space-md);padding:var(--space-sm)}
  .ck-pag-group{gap:var(--space-md)}
}

/* ─── TABLE PANEL (Organism) ──────────────────────────────────────────────
   A table and its pagination footer in one bordered panel.

   The footer belongs to the PANEL, not to the last row. It sits on the panel's
   bottom edge whether the table holds two hundred rows, a single row, or is
   still loading — so it never floats up under a short table and the panel's
   height never jumps as rows arrive. The rows take the slack and scroll; the
   footer keeps its place.

   Spec: references/components/table.md § Panel */
.ck-table-panel{
  display:flex;flex-direction:column;width:100%;min-height:0;box-sizing:border-box;
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);
  overflow:hidden}
/* The rows scroll; belt and braces so the footer is last even with no wrap. */
.ck-table-panel > .ck-table-scroll{flex:1 1 auto;min-height:0;overflow:auto}
.ck-table-panel > .ck-pag{flex:none;margin-block-start:auto}
/* Given a height, the panel fills it and the footer rides the bottom edge. */
.ck-table-panel.is-filled{height:100%}

/* ── Multi-value field — .ck-multi-values ─────────────────────────────────
   The third form. Where the trigger form shows what is chosen and the picker
   form is a panel for choosing, this one lets a value be TYPED: one row per
   value, each a real input with its own remove, plus an add control.

   Use it where the set is open-ended — a document's alternate references, a
   list of email recipients — and the trigger/picker forms where the options
   are known. Ported from the v2.0 document-fields multi-value row.

   Spec: references/components/multi-select.md § Multi-value form */
.ck-multi-values{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}
.ck-multi-value{display:flex;align-items:center;gap:var(--space-xs);width:100%}
.ck-multi-value > .ck-input{flex:1;min-width:0}
/* The remove is the kit's own destructive icon button at the field's own
   height, so the row reads as one control rather than a field plus a button. */
.ck-multi-value > .ck-icon-btn{flex:none}
.ck-multi-add{align-self:flex-start}

/* ─── FULFILMENT STATUS — retired into the pill ────────────────────────────
   v2.0's four fulfilment states were briefly their own component. They are
   not: a count beside a label in a toned pill is the pill's OWN anatomy —
   .ck-pill-label plus .ck-pill-count, which already ships. A second set of
   classes for it was exactly the duplication § 14.6 check 12 forbids.

     fulfilled     .ck-pill.is-success      remaining      .ck-pill.is-info
     excess        .ck-pill.is-warning      not fulfilled  .ck-pill.is-error

   So there is no CSS here. Spec: references/components/pill.md § Fulfilment
   status; rename map in rulebook § 2. */

/* ─── LABELLED CHECKBOX ROW — .ck-inline-check (Atom addition) ────────────
   A checkbox with its label beside it. The kit had the box and it had the
   field label, but nothing joining them — so every flow that needed "tick this
   and here is what it means" invented its own row in page CSS, which is § 12.4
   exactly. The auth card was doing it with a `.ckx-inline` that lived in the
   demo chrome.

   It is a <label> wrapping the input, so the WHOLE ROW is the hit target and
   no `for`/`id` pair can go stale. align-items:flex-start, not center, because
   the label may wrap to two lines and the box belongs beside the first one.
   The 1px nudge is optical: a 16px box against a 20px line box sits high by
   about a pixel. */
/* ─── LABELLED CONTROLS — .ck-inline-check / .ck-inline-switch ────────────
   A checkbox or a switch with its label beside it, in every state the control
   has. The bare atoms carry no label at all, which is fine inside a table row
   or a menu where something else names them — but a control standing on its
   own in a form needs a name, and that name has to answer to the pointer.

   BOTH ARE A <label>, and that is the whole mechanism. The browser forwards a
   click on the text to the label's control, so the whole thing is one target
   with no script — and it works for the switch too, even though the switch is
   a <button role="switch"> rather than an input: a button is a labelable
   element, so `label.control` resolves to it. No handler to desync, and it
   satisfies check 38 (a row with a control is clickable across its width) by
   construction rather than by wiring.

   THE LABEL FOLLOWS THE CONTROL'S STATE. Disabled greys the text and takes the
   cursor with it; invalid turns it destructive. A control that reads as
   disabled next to a label that reads as normal is the state told half-way.

   Spec: references/components/checkbox.md and switcher.md */
.ck-inline-check,.ck-inline-switch{
  display:inline-flex;align-items:flex-start;gap:var(--space-sm);
  cursor:pointer;
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--foreground)}
.ck-inline-check > .ck-check{flex:none;margin-block-start:1px}
.ck-inline-switch > :is(.switch,.ck-switch){flex:none}
.ck-inline-check > span,.ck-inline-switch > span{min-width:0}
/* Disabled: the label goes with the control. */
.ck-inline-check:has(.ck-check:disabled),
.ck-inline-switch:has(:is(.switch,.ck-switch):is(:disabled,.is-disabled,[aria-disabled="true"],[data-force~="disabled"])){
  cursor:not-allowed;color:var(--muted-foreground)}
/* Invalid: so does the label. */
.ck-inline-check:has(.ck-check[aria-invalid="true"]),
.ck-inline-switch:has(:is(.switch,.ck-switch)[aria-invalid="true"]){color:var(--destructive)}
/* A hint under the label. It goes INSIDE the label's text span, not beside it:
   the wrapper is a flex row, so a third child would sit in a third column
   rather than under the text. Nested, it already starts at the label's own
   edge and needs no indent — the earlier rule added one on top of that and
   pushed the hint 24px past the label it belongs to. */
.ck-inline-check-hint,.ck-inline-hint{
  display:block;margin-block-start:var(--space-2xs);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-inline-check:has(.ck-check:disabled) .ck-inline-hint,
.ck-inline-switch:has(:is(.switch,.ck-switch):is(:disabled,.is-disabled,[aria-disabled="true"])) .ck-inline-hint{
  color:var(--input)}
/* Label first, control pushed to the trailing edge — the settings-row reading,
   where the eye scans a column of names and the controls line up on the right.
   The control still comes FIRST in the markup, so the label element keeps its
   control and nothing about the forwarding changes. */
.ck-inline-check.is-reversed,.ck-inline-switch.is-reversed{
  display:flex;align-items:center;width:100%;gap:var(--space-base)}
.ck-inline-check.is-reversed > :is(.ck-check),
.ck-inline-switch.is-reversed > :is(.switch,.ck-switch){order:2;margin-inline-start:auto}
.ck-inline-check.is-reversed > span,.ck-inline-switch.is-reversed > span{order:1}

/* ─── FIELD LABEL — required / optional (Atom addition) ───────────────────
   v2.0's Label atom had required and optional affordances; .ck-field-label
   had neither. The asterisk is a ::after because it is punctuation, not
   content; "optional" is a real span in the markup because it is a word and
   has to be translatable.

   Spec: references/components/input.md § Label */
.ck-field-label[data-required]::after{
  content:'*';margin-inline-start:var(--space-2xs);color:var(--destructive)}
.ck-field-optional{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}/* The container. It had no rule of its own, which is why it drew as a bare
   stack: no corners and no edge to say where it began or ended. A subtle
   stroke and the panel radius; overflow:hidden so the first and last rows are
   clipped to the corners instead of squaring them off. */
.ck-accordion{
  display:flex;flex-direction:column;box-sizing:border-box;
  border:1px solid var(--panel-stroke);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);
  overflow:hidden}
/* Two documents are two containers, not two rows of one: each has its own
   corners, its own edge and its own error state, and stacking them in a single
   box implies they share a fate. 8px between them. */
.ck-accordion + .ck-accordion{margin-top:var(--space-sm)}
.ck-accordion-stack{display:flex;flex-direction:column;gap:var(--space-sm)}
.ck-accordion-stack > .ck-accordion + .ck-accordion{margin-top:0}
.ck-accordion-item + .ck-accordion-item{border-top:1px solid var(--accordion-stroke)}
.ck-accordion-trigger{
  display:flex;align-items:center;gap:var(--space-md);width:100%;box-sizing:border-box;
  height:44px;padding:var(--space-md) var(--space-base);
  border:0;background:transparent;color:var(--card-foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);text-align:start;cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-accordion.size-sm .ck-accordion-trigger{height:36px;padding:var(--space-sm) var(--space-md);font-size:var(--text-base)}
.ck-accordion.size-lg .ck-accordion-trigger{height:52px;padding:var(--space-base) var(--space-lg)}
.ck-accordion-trigger:hover{background:var(--hover-bg)}
.ck-accordion-trigger:active{background:var(--selected-bg);color:var(--selected-fg)}
.ck-accordion-trigger[aria-expanded="true"]{color:var(--primary)}
.ck-accordion-trigger:disabled,.ck-accordion-trigger[aria-disabled="true"]{
  color:var(--input);cursor:not-allowed;pointer-events:none;background:transparent}
.ck-accordion-trigger:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-accordion-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* The glyph is chevron-DOWN at rest and turns UP when expanded — down means
   "there is more below", up means "collapse it". Expanding runs 0 -> 180deg,
   collapsing 180 -> 360deg rather than back through 0, so it turns CLOCKWISE
   both ways (§ 14.9 checks 5-7). A single transform would interpolate 180 -> 0
   and read as counter-clockwise, which is the defect that rule catches.
   These are ck-chev-open / ck-chev-close, the SAME keyframes ClipperDropdown
   uses, so the two disclosures animate identically. ckAccordion() carries
   .is-collapsing for the animation's duration. */
.ck-accordion-chev{
  width:var(--icon-size);height:var(--icon-size);flex:none;
  display:inline-grid;place-items:center;color:var(--muted-foreground);
  transform:rotate(0deg)}
.ck-accordion-chev svg{
  width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);display:block}
.ck-accordion-trigger[aria-expanded="true"] .ck-accordion-chev{
  animation:ck-chev-open var(--duration-moderate) var(--ease-default) forwards}
.ck-accordion-item.is-collapsing .ck-accordion-chev{
  animation:ck-chev-close var(--duration-moderate) var(--ease-default) forwards}
/* Errored item — the soft-semantic triplet, so the row reads as a problem
   without the panel becoming a wall of red. The tone is redundancy: the
   trigger must still say what is wrong in words. */
/* ── ONE RULE FOR EVERY ROW'S SURFACE ──
   A row rests on WHITE — closed or open, errored or not — and tints only
   while the pointer is on it.

   OPENING IS NOT A STATE THE SURFACE REPORTS. The panel below is already the
   answer, and tinting the header as well leaves hover nothing to say: the row
   would be at its loudest before you had touched it.

   The TONE decides which tint arrives — --hover-bg for an ordinary row,
   --destructive-bg for an errored one. An errored row also carries a
   --destructive stroke AT ALL TIMES, which is what states the problem at rest
   now that the fill no longer does. Same rules in .is-document. */
.ck-accordion-item.is-error{background:var(--card);color:var(--destructive-soft-foreground)/* pairing-exempt: an errored row keeps the card surface and speaks in the destructive tone — that cross-pair IS the state. 5.29:1 on --card at rest and 4.58:1 on the --destructive-bg tint it takes on hover, both over the 4.5:1 body floor */}
.ck-accordion-item.is-error:is(:hover,[data-force~="hover"]){background:var(--destructive-bg)}
.ck-accordion-item.is-error + .ck-accordion-item,
.ck-accordion-item.is-error{border-color:var(--destructive)}
/* The container an errored document sits in wears the stroke too, or the red
   stops at the row and the tile still reads as an ordinary one. */
.ck-accordion:has(> .ck-accordion-item.is-error){border-color:var(--destructive)}
.ck-accordion-item.is-error .ck-accordion-trigger{color:var(--destructive-soft-foreground)}
.ck-accordion-item.is-error .ck-accordion-trigger[aria-expanded="true"]{
  color:var(--destructive-soft-foreground)}
.ck-accordion-item.is-error .ck-accordion-chev{color:var(--destructive-soft-foreground)}
.ck-accordion-item.is-error .ck-accordion-trigger:is(:hover,[data-force~="hover"]){
  background:transparent}
.ck-accordion-item.is-error .ck-accordion-trigger:is(:focus-visible,[data-force~="focus"]){
  box-shadow:var(--focus-ring-error)}
/* Disabled item — tokens, not opacity, so the label keeps its contrast. */
.ck-accordion-item.is-disabled{background:var(--muted);color:var(--muted-foreground)}
.ck-accordion-item.is-disabled .ck-accordion-trigger,
.ck-accordion-item.is-disabled .ck-accordion-chev{
  color:var(--muted-foreground);cursor:not-allowed;pointer-events:none}

.ck-accordion-panel{
  padding:var(--space-md) var(--space-base) var(--space-base);
  background:var(--accordion-bg);color:var(--card-foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans)}
.ck-accordion.size-sm .ck-accordion-panel{padding:var(--space-sm) var(--space-md) var(--space-md)}
@media (prefers-reduced-motion:reduce){
  /* Shortened, not removed: dropping the animation would leave the chevron
     pointing the wrong way (§ 14.9 check 8). */
  .ck-accordion-trigger[aria-expanded="true"] .ck-accordion-chev,
  .ck-accordion-item.is-collapsing .ck-accordion-chev{animation-duration:1ms}}

/* ─── DOCUMENT ACCORDION (Organism) — .ck-accordion.is-document ────────────
   The Document Editor's split/page list, generalised. A file row that expands
   into a grid of page thumbnails, with a run of actions in the title area and
   a per-file error state.

   THE STRUCTURAL RULE: the actions are SIBLINGS of the trigger, never children
   of it. A <button> cannot contain other buttons — it is invalid HTML, and a
   screen reader announces one control where there are five. So the head is a
   row: the toggle is a button covering the chevron, icon, name and meta, and
   .ck-doc-actions sits beside it. This is the same restructuring member-card
   needs when a card becomes clickable.

   Spec: references/components/accordion.md § Document accordion */
/* ORDER: file icon, name, meta — all packed LEFT — then the actions, then the
   chevron LAST. The chevron is the rightmost thing in the row because it acts
   on the row as a whole; an action that acts on the file sits inboard of it.
   The name and meta pack left together so the eye reads one run of
   information rather than a name at one edge and its size at the other.

   The chevron is a SIBLING of the trigger, and it is aria-hidden with
   tabindex="-1": a pointer affordance only. The trigger already gives keyboard
   users the disclosure, and two controls in the accessibility tree for one
   action is noise, not redundancy. */
/* HOVER IS THE ROW'S, NOT THE TRIGGER'S. In this variant the actions and the
   chevron are SIBLINGS of the trigger, so tinting the trigger left the right
   end of the row — the whole icon run — untinted, and the accent stopped in
   mid-air. The head takes the tint and the trigger goes transparent, so the
   accent covers the row edge to edge, icons included. */
/* 16px on every side, and the padding is the HEAD's. The trigger used to
   bring its own 44px height and 12/16px padding, which sat inside the row on
   top of whatever the head had — so the checkbox ended up flush against the
   container edge while the filename started 24px after it. One box owns the
   inset now; the trigger just fills it. */
.ck-accordion.is-document .ck-doc-head{
  display:flex;align-items:center;gap:var(--space-sm);
  padding:var(--space-base);cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-accordion.is-document .ck-doc-head:is(:hover,[data-force~="hover"]){background:var(--hover-bg)}
/* An errored document row follows the same rule, in its own tone. */
.ck-accordion-item.is-error .ck-doc-head:is(:hover,[data-force~="hover"]){
  background:var(--destructive-bg);color:var(--destructive-soft-foreground)}

.ck-accordion.is-document .ck-doc-head:has(.ck-accordion-trigger:focus-visible){
  box-shadow:inset 0 0 0 2px var(--ring)}
/* The trigger no longer paints anything: the row does. */
.ck-accordion.is-document .ck-accordion-trigger{
  flex:1;min-width:0;height:auto;padding:0;background:transparent}
.ck-accordion.is-document .ck-accordion-trigger:is(:hover,:active,:focus-visible){
  background:transparent;box-shadow:none}
/* The name takes the slack so the meta ends up beside it, not across the row. */
.ck-accordion.is-document .ck-accordion-label{flex:none;max-width:100%}
.ck-accordion.is-document .ck-doc-spacer{flex:1;min-width:var(--space-sm)}
/* Sits after .ck-doc-actions in the markup, so it is last in the row. */
.ck-doc-chev{
  flex:none;order:99;
  width:var(--icon-size);height:var(--icon-size);display:grid;place-items:center;
  border:0;background:0;padding:0;cursor:pointer;
  color:var(--muted-foreground);transform:rotate(0deg)}
.ck-doc-chev svg{width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-accordion-item[aria-expanded="true"] .ck-doc-chev,
.ck-doc-head[aria-expanded="true"] .ck-doc-chev{
  animation:ck-chev-open var(--duration-moderate) var(--ease-default) forwards}
.ck-accordion-item.is-collapsing .ck-doc-chev{
  animation:ck-chev-close var(--duration-moderate) var(--ease-default) forwards}
/* The leading slot is a CHECKBOX, not a file glyph. Every row in this list is
   a file, so a file icon on each one said nothing; a checkbox says which files
   you are acting on, which is what the row is for.

   It is the .ck-check atom and sizes nothing itself, and it is a SIBLING of
   the trigger, never inside it — a button may not contain an input (§ 14
   check 39). Clicking it selects the file and must NOT expand the row;
   ckDocAccordion() treats it as its own control, the way it treats the
   action buttons. */
.ck-doc-check{flex:none;margin:0}
.ck-doc-meta{
  flex:none;color:var(--muted-foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  font-variant-numeric:tabular-nums;white-space:nowrap}
/* Revealed on hover AND focus-within — hover alone is invisible to a keyboard
   (§ 14.4 check 4). They stay in the tab order either way, so they must never
   be hidden with opacity alone. */
.ck-doc-actions{
  display:flex;align-items:center;gap:var(--space-2xs);flex:none;
  opacity:0;transition:opacity var(--duration-base)}
.ck-doc-head:hover .ck-doc-actions,
.ck-doc-head:focus-within .ck-doc-actions,
.ck-doc-head[data-force~="hover"] .ck-doc-actions{opacity:1}
.ck-accordion-item.is-error .ck-doc-actions{opacity:1}

/* ── Page thumbnails ── */
.ck-thumb-grid{
  display:grid;grid-template-columns:repeat(auto-fill,120px);
  gap:var(--space-md);justify-content:start}
/* ONE STROKE WEIGHT, AND IT IS 1px — rest, hover, focus, selected,
   previewing, errored, all of them. Colour is what says which state a page is
   in; the stroke only has to be visible, and varying its weight as well made
   the grid read as though some pages mattered more than others.

   box-sizing:border-box is kept regardless, so a tile can never move in the
   grid if a state ever does change the border. */
.ck-thumb{
  position:relative;overflow:hidden;aspect-ratio:3 / 4;min-width:0;box-sizing:border-box;
  border:1px solid var(--input);border-radius:var(--radius-md);
  background:var(--background);color:var(--foreground);cursor:pointer;
  transition:border-color var(--duration-base),box-shadow var(--duration-base)}
.ck-thumb:is(:hover,[data-force~="hover"]){border-color:var(--primary);box-shadow:var(--shadow-raised)}
.ck-thumb:focus-within{border-color:var(--primary);box-shadow:var(--focus-ring)}
.ck-thumb.is-selected{border-color:var(--primary);box-shadow:none}
/* A toned tile carries its state in the STROKE and keeps the page white, so
   the thumbnail still reads as a page rather than as a coloured card. The
   tint is the response to hover or selection — the tone tells you what kind
   of state, the fill tells you that you are on it. */
.ck-thumb.is-error{border-color:var(--destructive)}
.ck-thumb.is-error:is(:hover,[data-force~="hover"]),
.ck-thumb.is-error.is-selected{background:var(--destructive-bg)}
/* ── PREVIEWING — .ck-thumb.is-previewing ──
   The page currently open in the preview pane. Amber, because it is neither
   selection (--primary) nor a problem (--destructive): it is "you are looking
   at this one", a third orthogonal state that has to be told apart from both.

   The stroke goes 2px so the ring is unmistakable at 120px wide, and the page
   badge turns amber with it — the state is carried TWICE, which matters
   because --warning against a white page is 2.05:1 and would be a weak
   signal on its own. The badge's own numeral is 7.38:1 on that fill, so the
   legible half of the pair is the half that carries meaning.

   Selection and previewing can both be true: a page can be ticked and open. */
.ck-thumb.is-previewing{border-color:var(--warning);box-shadow:none}
.ck-thumb.is-previewing:is(:hover,[data-force~="hover"]),
.ck-thumb.is-previewing.is-selected{background:var(--warning-bg)}
/* Selected AND previewing: amber wins the stroke, because "you are looking at
   this one" is the more perishable fact; the tick still shows selection. */
.ck-thumb.is-selected.is-previewing{border-color:var(--warning)}
.ck-thumb.is-previewing > .ck-thumb-badge{
  background:var(--warning);color:var(--warning-foreground)}
.ck-thumb-img{
  width:100%;height:100%;object-fit:cover;object-position:top center;display:block}
/* The scrim over a page image, so the preview control reads on any document.

   Two layers, because they animate to different places: the LAYER fades 0 -> 1
   so the control arrives at full strength, and the TINT lives on ::before at
   --scrim-opacity so the page behind it dims. One layer could not do both —
   fading the container to 0.45 took the preview button down with it, and a
   45%-opaque control on a document page is exactly the thing the scrim exists
   to prevent. */
.ck-thumb-overlay{
  position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity var(--duration-base);pointer-events:none}
.ck-thumb-overlay::before{
  content:'';position:absolute;inset:0;
  background:var(--scrim);opacity:var(--scrim-opacity)/* pairing-exempt: carries no text */}
.ck-thumb:hover .ck-thumb-overlay,
.ck-thumb:focus-within .ck-thumb-overlay,
.ck-thumb[data-force~="hover"] .ck-thumb-overlay{opacity:1}
.ck-thumb-overlay > *{position:relative;z-index:1;pointer-events:auto}
/* The preview control. 28px is the dense step of the control scale. */
.ck-thumb-eye{
  display:inline-grid;place-items:center;flex:none;box-sizing:border-box;
  width:28px;height:28px;padding:0;border:0;border-radius:var(--radius-md);
  /* pairing-exempt: the outline pattern — --primary on --background at
     12.01:1, the same declared exemption .ck-member-av carries. The glyph must
     read as the brand action against a scrimmed page image, and --foreground
     would make it look like part of the document. */
  background:var(--background);color:var(--primary);cursor:pointer;
  transition:background var(--duration-base)}
.ck-thumb-eye:hover{background:var(--hover-bg)}
.ck-thumb-eye:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-thumb-eye svg{width:var(--icon-size);height:var(--icon-size);display:block}
/* Selection sits above the overlay so it stays clickable while previewing. */
.ck-thumb-check{
  position:absolute;top:var(--space-xs);left:var(--space-xs);z-index:2;margin:0}
/* The page number reads over an image, so a SELECTED page takes the
   dark-toolbar family — minted for exactly this: chrome on content whose
   colour we do not control.

   AN UNSELECTED PAGE'S NUMBER IS QUIETER. A grid of near-black badges reads
   as fifteen selected pages; the badge should only shout when the page is
   actually chosen. So unselected drops to the muted pair on a --muted chip.
   That measures 3.16:1, which is under the 4.5:1 text floor — a deliberate
   trade, made because the number is a positional label the user is scanning
   rather than content they must read, and because the selected and previewing
   states both raise it back to full contrast. If it has to clear AA, the fill
   stays and the numeral becomes --foreground at 14.56:1. */
.ck-thumb-badge{
  position:absolute;bottom:var(--space-xs);right:var(--space-xs);z-index:2;
  display:inline-grid;place-items:center;min-width:20px;height:20px;
  padding:0 var(--space-xs);border-radius:var(--radius-full);
  background:var(--muted);color:var(--muted-foreground);
  font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);
  font-variant-numeric:tabular-nums}
/* A MIDTONE, not the darkest ink in the set. --toolbar-dark is the colour of
   a dark toolbar chrome; on a small badge over a white page it read as a hole
   punched in the thumbnail. --primary-active is the midtone of the primary
   ramp and still carries a white numeral at 6.51:1. */
.ck-thumb.is-selected > .ck-thumb-badge{
  background:var(--primary-active);color:var(--primary-foreground)}
.ck-thumb.is-error > .ck-thumb-badge{
  background:var(--destructive);color:var(--destructive-foreground)}

/* ─── TOOLTIP HOST — .ck-tip-host ─────────────────────────────────────────
   Wrap an icon control in this and its .ck-tip child appears on hover AND on
   keyboard focus, with no JS. The kit had the bubble but no wiring, so every
   flow was inventing its own — which is why icons shipped without tooltips
   despite the rule requiring them.

   Focus-within, not just hover: a tooltip that only appears on hover is
   invisible to a keyboard and fails WCAG 2.1.1 — the most common tooltip
   defect there is.

   The bubble is position:fixed on its own, so inside a host it switches to
   absolute and the host becomes the containing block. Placement classes keep
   working: the tail geometry is unchanged, only the offset is set here.

   Spec: references/components/tooltip.md § Attaching one */
/* A tooltip host anchors a tip and must not change how its element lays out.
   The display below is wrapped in :where() so it carries ZERO specificity: a
   bare <span class="ck-tip-host"> still gets a box to anchor against, while
   any component that brings its own layout keeps it.

   Without that guard this rule sat at 0-1-0 and, being later in the file, beat
   .ck-icon-btn's own display:inline-grid;place-items:center — so every icon
   button carrying a tooltip laid its glyph out flex-start and drew it left of
   centre. That was 20 buttons across the kit, not one. */
.ck-tip-host{position:relative}
:where(.ck-tip-host){display:inline-flex;align-items:center}
/* Lifted out of a clipping ancestor. A tip inside a scroll container is cut
   off by it — overflow-y:auto makes the OTHER axis clip too, so no amount of
   z-index or side-switching rescues it. ckTipLift() switches these to fixed
   and positions them against the host's box. */
.ck-tip-host > .ck-tip{
  position:absolute;opacity:0;pointer-events:none;
  transition:opacity var(--duration-base) var(--ease-default);
  white-space:nowrap}
.ck-tip-host:hover > .ck-tip,
.ck-tip-host:focus-within > .ck-tip,
.ck-tip-host[data-force~="hover"] > .ck-tip{opacity:1}
/* Offsets per placement. 8px clears the tail, which protrudes 4px. */
.ck-tip-host > .ck-tip.is-top{
  inset-block-end:calc(100% + var(--space-sm));inset-inline-start:50%;
  transform:translateX(-50%)}
.ck-tip-host > .ck-tip.is-bottom{
  inset-block-start:calc(100% + var(--space-sm));inset-inline-start:50%;
  transform:translateX(-50%)}
.ck-tip-host > .ck-tip.is-start{
  inset-inline-end:calc(100% + var(--space-sm));inset-block-start:50%;
  transform:translateY(-50%)}
.ck-tip-host > .ck-tip.is-end{
  inset-inline-start:calc(100% + var(--space-sm));inset-block-start:50%;
  transform:translateY(-50%)}
.ck-tip-host > .ck-tip.is-lifted{
  position:fixed;z-index:var(--z-tooltip);margin:0;transform:none;
  inset-block:auto;inset-inline:auto}

/* ─── ACTION BAR (Organism) ───────────────────────────────────────────────
   A floating run of icon actions over content — a document preview's tools, a
   selection's bulk actions. Two grounds:

     default   --card, for a bar over the page
     .on-dark  --toolbar-dark, for a bar over a document or an image, where a
               light bar would compete with the content. That is exactly what
               the --toolbar-dark family exists for.

   Buttons inside are .ck-icon-btn; .on-dark retunes their hover pair rather
   than restyling them, the same way .ck-icon-btn.on-dark already does.

   Spec: references/components/action-bar.md */
/* Spacing carries the grouping. 4px between icons inside a cluster, 12px
   between clusters, and a divider adds 4px either side — so a related run
   reads as one object and the next run reads as a different one. Proximity
   does the work; the divider only confirms it.

   The bar rests ON the page, so it casts nothing. Only .is-floating lifts. */
.ck-action-bar{
  display:inline-flex;align-items:center;gap:var(--space-md);box-sizing:border-box;
  padding:var(--space-sm);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground)}
.ck-action-bar.size-sm{padding:var(--space-xs);gap:var(--space-sm)}
.ck-action-bar.size-sm .ck-action-bar-group{gap:var(--space-2xs)}
/* Three-column split: leading run, a centred group, trailing run. A flex row
   cannot hold the middle group centred once the two sides differ in width —
   it drifts. The grid pins it regardless. */
.ck-action-bar.is-split{
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:var(--space-md);width:100%}
.ck-action-bar-group{display:flex;align-items:center;gap:var(--space-xs);min-width:0}
.ck-action-bar-group.is-center{justify-content:center}
.ck-action-bar-group.is-end{justify-content:flex-end}
/* A bordered slot on the bar — a read-out like the zoom percentage, or a real
   input like the page number. One class for both, because they are the same
   thing: a value the user reads, and sometimes types into. 32px sits inside
   the bar's own 36px controls without touching them. */
.ck-action-bar-field{
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  height:32px;min-width:56px;padding:0 var(--space-md);
  border:1px solid var(--input);border-radius:var(--radius-md);
  background:transparent;color:var(--foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  font-variant-numeric:tabular-nums;white-space:nowrap}
input.ck-action-bar-field{width:48px;min-width:0;text-align:center;padding:0 var(--space-xs)}
input.ck-action-bar-field:focus{outline:0;border-color:var(--primary);box-shadow:var(--focus-ring)}
.ck-action-bar.on-dark .ck-action-bar-field{
  border-color:var(--toolbar-dark-sep);color:var(--toolbar-dark-foreground)}
.ck-action-bar.on-dark input.ck-action-bar-field:focus{
  border-color:var(--toolbar-dark-foreground);box-shadow:none}
/* On the dark bar the separator takes the family's own rule colour, or it
   disappears into the surface. */
.ck-action-bar.on-dark .ck-divider.is-vertical{background:var(--toolbar-dark-sep)}
/* Floating — lifted off the page, not resting on it. --shadow-raised is the
   whole lift: x 0, y 1, blur 3. A deep multi-layer shadow made the bar read as
   a modal panel hovering over the page rather than a control attached to it. */
.ck-action-bar.is-floating{
  position:fixed;left:50%;transform:translateX(-50%);
  inset-block-end:var(--space-xl);z-index:var(--z-sticky);
  box-shadow:var(--shadow-raised)}
.ck-action-bar .ck-divider.is-vertical{
  min-height:var(--space-lg);margin-inline:var(--space-xs)}
.ck-action-bar-label{
  padding-inline:var(--space-sm);font:var(--font-weight-medium) var(--text-md) var(--font-sans);
  color:var(--muted-foreground);white-space:nowrap}

.ck-action-bar.on-dark{
  background:var(--toolbar-dark);color:var(--toolbar-dark-foreground);
  border-color:var(--toolbar-dark-sep)}
.ck-action-bar.on-dark .ck-action-bar-label{color:var(--toolbar-dark-muted)}
.ck-action-bar.on-dark .ck-icon-btn{
  color:var(--toolbar-dark-muted);
  --ck-icon-hover:var(--toolbar-dark-hover);
  --ck-icon-hover-fg:var(--toolbar-dark-foreground)}
.ck-action-bar.on-dark .ck-icon-btn.is-selected{
  background:var(--toolbar-dark-active);color:var(--toolbar-dark-foreground)}
.ck-action-bar.on-dark .ck-divider.is-vertical{
  background:var(--toolbar-dark-sep)/* pairing-exempt: carries no text */}

/* ─── AUTH CARD (Organism) ────────────────────────────────────────────────
   Sign-in / sign-up / reset. A --card panel centred on the page ground, at a
   fixed 400px because a login form wider than that reads as a settings page;
   that width is this component's identity and is recorded in its sheet.

   Everything inside is existing kit: .ck-field, .ck-input, .ck-btn.primary,
   .ck-btn.link, .ck-divider-label, .ck-alert for a failed attempt. The only
   rules here are the frame and its rhythm.

   The primary action is .size-lg — § 7a's stated case for it: a touch-first
   surface whose action is the only one on the screen.

   Spec: references/components/auth-card.md */
.ck-auth-shell{
  display:grid;place-items:center;min-height:100vh;padding:var(--space-xl);
  background:var(--background);color:var(--foreground)}
.ck-auth{
  width:100%;max-width:400px;box-sizing:border-box;
  display:flex;flex-direction:column;gap:var(--space-base);
  padding:var(--space-2xl);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground)}
.ck-auth.size-sm{max-width:340px;padding:var(--space-lg)}
.ck-auth.size-lg{max-width:480px}
.ck-auth-brand{display:flex;align-items:center;gap:var(--space-sm)}
.ck-auth-head{display:flex;flex-direction:column;gap:var(--space-2xs)}
.ck-auth-title{font:var(--font-weight-semibold) var(--text-3xl) var(--font-sans);color:var(--card-foreground)}
.ck-auth-sub{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);line-height:1.5}
.ck-auth-form{display:flex;flex-direction:column;gap:var(--space-md)}
.ck-auth-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm)}
.ck-auth-actions{display:flex;flex-direction:column;gap:var(--space-sm)}
.ck-auth-foot{
  text-align:center;font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}

/* ─── CONNECTOR CARD (Organism) ───────────────────────────────────────────
   One integration: its mark, its name, what it does, whether it is connected,
   and the action that changes that.

   The mark sits on --secondary rather than --background so a white vendor
   logo still has a plate under it in dark theme. Connection state is a
   .ck-pill tone plus the button's label — never the tone alone (§ 14.6
   check 13).

   Spec: references/components/connector-card.md */
.ck-connector-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:var(--space-md)}
.ck-connector{
  display:flex;flex-direction:column;gap:var(--space-md);box-sizing:border-box;
  padding:var(--space-base);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);
  transition:background var(--duration-base),border-color var(--duration-base)}
.ck-connector:hover{border-color:var(--input)}
.ck-connector.is-connected{border-color:var(--success-border)}
.ck-connector-top{display:flex;align-items:flex-start;gap:var(--space-md)}
.ck-connector-mark{
  width:var(--space-3xl);height:var(--space-3xl);flex:none;box-sizing:border-box;
  display:grid;place-items:center;
  border:1px solid var(--panel-border);border-radius:var(--radius-md);
  background:var(--secondary);color:var(--secondary-foreground)}
.ck-connector-mark img{max-width:var(--space-xl);max-height:var(--space-xl);display:block}
.ck-connector-mark svg{
  width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-connector-main{flex:1;min-width:0}
.ck-connector-name{
  font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--card-foreground);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-connector-meta{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);margin-top:var(--space-2xs)}
.ck-connector-desc{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);line-height:1.5;flex:1}
.ck-connector-foot{
  display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm)}

/* ─── FEATURE / SUPPORT CARD (Organism) ───────────────────────────────────
   A capability and how well it is supported. The icon plate reads --accent so
   the card has a focal point without a second surface level, and the support
   level is a .ck-pill tone with its word in the label.

   Spec: references/components/feature-card.md */
.ck-feature-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:var(--space-md)}
.ck-feature{
  display:flex;flex-direction:column;gap:var(--space-sm);box-sizing:border-box;
  padding:var(--space-base);
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground)}
.ck-feature-icon{
  width:var(--space-2xl);height:var(--space-2xl);flex:none;
  display:grid;place-items:center;
  border-radius:var(--radius-md);
  background:var(--accent);color:var(--accent-foreground)}
.ck-feature-icon svg{
  width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-feature-title{
  display:flex;align-items:center;gap:var(--space-sm);
  font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--card-foreground)}
.ck-feature-title .ck-pill{flex:none}
.ck-feature-desc{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);line-height:1.5}
.ck-feature-list{
  display:flex;flex-direction:column;gap:var(--space-xs);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-feature-list-item{display:flex;align-items:flex-start;gap:var(--space-sm)}
.ck-feature-list-item .ck-ico{flex:none}

/* ─── FILE UPLOAD / DROPZONE (Organism) ───────────────────────────────────
   A drop target, then a list of what was dropped.

   The dashed --input outline is the same treatment .ck-empty uses, and for the
   same reason: an outline says "there is nothing here yet" where a filled
   shimmer would say "it is coming" (§ 7d). On drag-over the target commits to
   --accent with a solid --primary edge, so the state is carried by more than
   a colour shift.

   Rows reuse .ck-progress for the transfer and .ck-icon-btn.tone-danger
   .size-xs for the remove — that control is 24px, which the old
   .dropzone-file-remove was not.

   Spec: references/components/file-upload.md */
.ck-dropzone{
  display:flex;flex-direction:column;align-items:center;gap:var(--space-sm);
  box-sizing:border-box;padding:var(--space-2xl) var(--space-base);
  text-align:center;cursor:pointer;
  border:1px dotted var(--input);border-radius:var(--radius-2xl);
  background:var(--background);color:var(--muted-foreground);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  transition:background var(--duration-base),border-color var(--duration-base),color var(--duration-base)}
.ck-dropzone.size-sm{padding:var(--space-base) var(--space-md);gap:var(--space-xs)}
.ck-dropzone.size-lg{padding:var(--space-4xl) var(--space-xl)}
.ck-dropzone:hover{border-color:var(--input-border-hover)}
.ck-dropzone.is-dragover{
  border-style:solid;border-color:var(--primary);
  background:var(--accent);color:var(--accent-foreground)}
.ck-dropzone[aria-invalid="true"]{border-color:var(--destructive);color:var(--destructive-soft-foreground)}
.ck-dropzone:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-dropzone.is-disabled,.ck-dropzone[aria-disabled="true"]{
  background:var(--muted);color:var(--muted-foreground);border-color:var(--input);
  cursor:not-allowed;pointer-events:none}
.ck-dropzone-icon{width:var(--space-2xl);height:var(--space-2xl);color:var(--input)}
.ck-dropzone-icon svg{
  width:var(--space-2xl);height:var(--space-2xl);
  stroke-width:var(--icon-stroke);display:block}
.ck-dropzone-title{font:var(--font-weight-semibold) var(--text-lg) var(--font-sans);color:var(--foreground)}
.ck-dropzone-hint{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}

.ck-file-list{display:flex;flex-direction:column;gap:var(--space-sm);margin-top:var(--space-md)}
.ck-file{
  display:flex;align-items:center;gap:var(--space-md);box-sizing:border-box;
  padding:var(--space-sm) var(--space-md);
  border:1px solid var(--panel-border);border-radius:var(--radius-md);
  background:var(--card);color:var(--card-foreground)}
.ck-file-icon{width:var(--icon-box);height:var(--icon-box);flex:none;
  display:inline-grid;place-items:center;color:var(--icon-color)}
.ck-file-icon svg{
  width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-file-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-2xs)}
.ck-file-name{font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--card-foreground)}
.ck-file-meta{
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}
.ck-file.is-error{border-color:var(--destructive-border);background:var(--destructive-bg);color:var(--destructive-soft-foreground)}
.ck-file.is-error .ck-file-name,.ck-file.is-error .ck-file-meta{color:inherit}
.ck-file.is-error .ck-file-icon{color:var(--icon-color-destructive)}
.ck-file.is-done{border-color:var(--success-border)}

/* ─── DOCUMENT FIELDS PANEL (Organism) ────────────────────────────────────
   Extracted fields beside the document they came from: a confidence dot, the
   label, the value, and per-row tools.

   This is what the --dfp-* tokens were minted for, and the only component
   entitled to them:

     --dfp-ok         extracted, nothing to check
     --dfp-confirmed  a person has confirmed it
     --dfp-matched    matched against another document
     --dfp-warn       needs a look

   Those four are a confidence scale, not the semantic state family, which is
   why they are their own tokens and why Fulfilment Status does NOT borrow
   them. The dot is redundancy: every row also carries its state in text or in
   its tooltip (§ 14.3 check 12).

   Spec: references/components/doc-fields-panel.md */
.ck-dfp{
  display:flex;flex-direction:column;min-height:0;box-sizing:border-box;
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);overflow:hidden}
.ck-dfp-head{
  display:flex;align-items:center;gap:var(--space-sm);flex:none;
  padding:var(--space-md) var(--space-base);
  border-bottom:1px solid var(--border)}
.ck-dfp-title{
  flex:1;min-width:0;font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);color:var(--card-foreground);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-dfp-body{flex:1;min-height:0;overflow-y:auto;padding:var(--space-sm)}
.ck-dfp-group{display:flex;flex-direction:column}
.ck-dfp-group-label{
  padding:var(--space-sm) var(--space-sm) var(--space-xs);
  font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);color:var(--muted-foreground);
  text-transform:uppercase;letter-spacing:.07em}
.ck-dfp-row{
  display:flex;align-items:flex-start;gap:var(--space-sm);
  padding:var(--space-sm);border-radius:var(--radius-sm);
  transition:background var(--duration-base)}
.ck-dfp-row:hover{background:var(--hover-bg)}
.ck-dfp-row[aria-selected="true"],.ck-dfp-row.is-selected{
  background:var(--selected-bg);color:var(--selected-fg)}
.ck-dfp-dot{
  width:var(--space-sm);height:var(--space-sm);flex:none;margin-top:var(--space-xs);
  border-radius:var(--radius-full);
  background:var(--muted-foreground)/* pairing-exempt: carries no text */}
.ck-dfp-row.is-ok .ck-dfp-dot{background:var(--dfp-ok)/* pairing-exempt: carries no text */}
.ck-dfp-row.is-confirmed .ck-dfp-dot{background:var(--dfp-confirmed)/* pairing-exempt: carries no text */}
.ck-dfp-row.is-matched .ck-dfp-dot{background:var(--dfp-matched)/* pairing-exempt: carries no text */}
.ck-dfp-row.is-warn .ck-dfp-dot{background:var(--dfp-warn)/* pairing-exempt: carries no text */}
.ck-dfp-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-2xs)}
.ck-dfp-label{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-dfp-value{
  font:var(--font-weight-medium) var(--text-base) var(--font-sans);color:var(--foreground);
  overflow-wrap:anywhere}
.ck-dfp-value.is-empty{color:var(--muted-foreground)}
.ck-dfp-value.is-mono{font-family:var(--font-mono)}
/* Tools appear on hover AND focus-within, or a keyboard user cannot reach
   them (§ 14.4). */
.ck-dfp-tools{display:flex;align-items:center;gap:var(--space-2xs);flex:none;opacity:0;
  transition:opacity var(--duration-base)}
.ck-dfp-row:hover .ck-dfp-tools,.ck-dfp-row:focus-within .ck-dfp-tools{opacity:1}
/* Multi-value fields carry one chip per value. */
.ck-dfp-multi{display:flex;flex-wrap:wrap;gap:var(--space-xs)}


/* ─── NOTIFICATION PANEL (Organism) ───────────────────────────────────────
   An anchored list of what happened. --popover, because it floats out of flow
   (§ 4) — the v2.0 panel read --background, which is invisible in light theme
   and wrong in dark.

   Unread is carried by a dot AND the row's fill, so it survives a
   colour-blind reading. An empty panel uses .ck-empty; a loading one uses
   .ck-skeleton-row (§ 7d).

   Spec: references/components/notification-panel.md */
.ck-notif-panel{
  display:flex;flex-direction:column;box-sizing:border-box;
  width:380px;max-height:calc(100vh - var(--space-8xl));overflow:hidden;
  border:1px solid var(--panel-border);border-radius:var(--radius-2xl);
  background:var(--popover);color:var(--popover-foreground);
  box-shadow:var(--shadow-panel)}
.ck-notif-panel.size-sm{width:320px}
.ck-notif-panel.size-lg{width:440px}
.ck-notif-head{
  display:flex;align-items:center;gap:var(--space-sm);flex:none;
  padding:var(--space-md) var(--space-base);
  border-bottom:1px solid var(--border)}
.ck-notif-title{flex:1;font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);color:var(--popover-foreground)}
.ck-notif-list{flex:1;min-height:0;overflow-y:auto;padding:var(--space-xs)}
.ck-notif{
  display:flex;align-items:flex-start;gap:var(--space-md);width:100%;box-sizing:border-box;
  padding:var(--space-md);border:0;background:0;border-radius:var(--radius-sm);
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);color:var(--popover-foreground);
  text-align:start;cursor:pointer;
  transition:background var(--duration-base)}
.ck-notif:hover{background:var(--hover-bg)}
.ck-notif:active{background:var(--selected-bg);color:var(--selected-fg)}
.ck-notif:focus-visible{outline:0;background:var(--hover-bg);box-shadow:inset 2px 0 0 var(--primary)}
.ck-notif.is-unread{background:var(--hover-bg)}
.ck-notif-dot{
  width:var(--space-sm);height:var(--space-sm);flex:none;margin-top:var(--space-xs);
  border-radius:var(--radius-full);background:transparent}
.ck-notif.is-unread .ck-notif-dot{background:var(--info)/* pairing-exempt: carries no text */}
.ck-notif-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-2xs)}
.ck-notif-text{line-height:1.5}
.ck-notif-text b{font-weight:600}
.ck-notif-time{font:var(--font-weight-normal) var(--text-md) var(--font-sans);color:var(--muted-foreground)}
.ck-notif-actions{display:flex;align-items:center;gap:var(--space-sm);margin-top:var(--space-2xs)}
.ck-notif-foot{
  flex:none;padding:var(--space-sm);border-top:1px solid var(--border);
  display:flex;justify-content:center}

/* ─── SIDEBAR NAV (Organism) ──────────────────────────────────────────────
   The app's primary icon rail, with a flyout that opens on hover and can be
   pinned. It is the one component entitled to the --sidebar-* family, which
   is why those tokens exist as their own set rather than as aliases.

   The rail is icons only, so every item needs an aria-label AND a tooltip
   (§ 7c) — the flyout label is not a substitute, because it is not there when
   the flyout is shut. Hover-open also opens on :focus-within, or the flyout
   is unreachable by keyboard (§ 14.9 check 13).

   Spec: references/components/sidebar-nav.md */
/* ─── MAIN LEFT NAVIGATION — .ck-sidebar ──────────────────────────────────
   ONE VARIANT. This is the shipped rail from sidebar-nav.html and there is no
   other: no round/square switch, no expanded mode, no size scale. A product
   has exactly one main navigation, so a component with options here only
   invites two screens to disagree about what the app's edge looks like.

   Geometry is the reference's exactly: a 56px column, 16px/8px padding, 12px
   between blocks, 4px between the buttons inside a block, 40px round buttons
   holding a 20px glyph.

   The 12/4 split is the whole grouping mechanism (§ 14.3 check 12): buttons in
   one run sit 4px apart, runs sit 12px apart with a hairline between. That is
   why no run needs a label in a rail this narrow.

   TWO KINDS OF BUTTON, and the difference is in the markup, not a class:
     a plain button           a destination. Hovering shows its tooltip.
     data-section="Name"      opens the flyout with that section's pages.
   A section button shows no tooltip while its flyout is open — the flyout
   already names it, and two labels for one thing is noise.

   Spec: references/components/sidebar-nav.md */
.ck-sidebar{
  display:flex;flex-direction:column;align-items:center;gap:var(--space-md);
  box-sizing:border-box;width:56px;flex:none;
  padding:var(--space-base) var(--space-sm);
  border-inline-end:1px solid var(--sidebar-border);
  background:var(--sidebar);color:var(--sidebar-foreground);
  position:relative;z-index:var(--z-sticky)}
.ck-sidebar-logo{
  width:40px;height:40px;flex:none;
  display:grid;place-items:center;overflow:hidden;cursor:pointer;
  border:0;border-radius:var(--radius-md);
  background:var(--sidebar-primary);color:var(--sidebar-primary-foreground);
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans)}
.ck-sidebar-logo svg{width:20px;height:20px;display:block}
.ck-sidebar-logo:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* Full-width hairline between runs. */
.ck-sidebar-sep{
  width:100%;height:1px;flex:none;
  background:var(--sidebar-border)/* pairing-exempt: a rule, carries no text */}
.ck-sidebar-items{
  display:flex;flex-direction:column;align-items:center;gap:var(--space-xs);width:100%}
/* Round, because that is what ships. The button is a .ck-tip-host so the
   kit's own tooltip hangs off it — no bespoke bubble here (§ 14.3 check 18). */
.ck-sidebar-item{
  position:relative;
  width:40px;height:40px;flex:none;box-sizing:border-box;
  display:grid;place-items:center;
  border:0;border-radius:var(--radius-full);
  background:transparent;color:var(--muted-foreground);cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-sidebar-item > svg{width:20px;height:20px;stroke-width:var(--icon-stroke);display:block}
/* --hover-bg, never --muted. The reference hovers to grey; the kit's protocol
   is that NOTHING hovers to grey (§ 14.3 check 24), and --hover-bg is the same
   tint the active state uses, so hover reads as "on the way to selected". */
.ck-sidebar-item:is(:hover,[data-force~="hover"]){
  background:var(--hover-bg);color:var(--sidebar-accent-foreground)}
.ck-sidebar-item[aria-current="page"],.ck-sidebar-item.is-active{
  background:var(--selected-bg);color:var(--sidebar-accent-foreground)}
.ck-sidebar-item:disabled,.ck-sidebar-item[aria-disabled="true"]{
  background:transparent;color:var(--input);cursor:not-allowed;pointer-events:none}
.ck-sidebar-item:focus-visible{outline:0;box-shadow:var(--focus-ring)}
/* The tooltip is the kit's .ck-tip in its .is-end placement, hung off the
   button as a .ck-tip-host — which brings :focus-within with it, so a keyboard
   gets the label too. It is suppressed while the flyout is open. */
.ck-sidebar.has-flyout .ck-sidebar-item > .ck-tip{opacity:0}
/* Bottom block — the tenant's own logo, pushed to the foot. */
.ck-sidebar-foot{
  margin-block-start:auto;flex:none;
  display:flex;flex-direction:column;align-items:center;gap:var(--space-xs);width:100%}
.ck-sidebar-foot > .ck-sidebar-sep{margin-block-end:var(--space-xs)}
/* An image we do not control, so it clips to a plate and takes NO tone of its
   own — a customer's brand colour is not ours to put on a semantic surface. */
.ck-sidebar-brand{
  width:40px;height:40px;flex:none;box-sizing:border-box;
  display:grid;place-items:center;overflow:hidden;cursor:pointer;
  border:0;border-radius:var(--radius-md);
  background:var(--muted);color:var(--foreground)/* pairing-exempt: a plate for an image we do not control, not muted content; --foreground on --muted is 14.56:1 where the nominal --muted-foreground partner is 3.16:1 */}
.ck-sidebar-brand > img,.ck-sidebar-brand > svg{width:28px;height:28px;display:block}
.ck-sidebar-brand:focus-visible{outline:0;box-shadow:var(--focus-ring)}

/* ─── FLYOUT PANEL — .ck-sidebar-flyout ───────────────────────────────────
   A full-height 200px panel beside the rail, holding the section's pages. It
   is NOT a popover: it can be PINNED, and pinning changes its layout mode from
   floating to in-flow, so the workspace resizes around it instead of being
   covered. That is the whole point of the pattern — browse by hovering, commit
   by pinning.

   Floating it sits at left:57px (the rail plus its 1px edge) with a shadow;
   locked it goes position:relative;left:0 and drops the shadow, because a
   panel that is part of the layout is not floating over anything. */
.ck-sidebar-flyout{
  position:absolute;inset-inline-start:57px;inset-block:0;z-index:var(--z-dropdown);
  width:200px;box-sizing:border-box;padding:14px 0 0;
  display:flex;flex-direction:column;
  border-inline-end:1px solid var(--border);
  background:var(--background);color:var(--foreground);
  box-shadow:var(--shadow-md);
  opacity:0;visibility:hidden;transform:translateX(-8px);
  transition:opacity var(--duration-moderate) var(--ease-default),
             visibility 0s linear var(--duration-moderate),
             transform var(--duration-moderate) var(--ease-default)}
.ck-sidebar-flyout.is-visible{
  opacity:1;visibility:visible;transform:translateX(0);
  transition:opacity var(--duration-moderate) var(--ease-default),
             transform var(--duration-moderate) var(--ease-default)}
.ck-sidebar-flyout.is-locked{
  position:relative;inset-inline-start:0;
  box-shadow:none;opacity:1;visibility:visible;transform:none}
.ck-sidebar-flyout-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:0 14px 10px;margin-block-end:var(--space-sm);
  border-bottom:1px solid var(--border)}
.ck-sidebar-flyout-title{
  font:var(--font-weight-semibold) var(--text-xs) var(--font-sans);
  color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.12em}
.ck-sidebar-pin{
  width:22px;height:22px;flex:none;
  display:grid;place-items:center;
  border:0;border-radius:var(--radius-md);
  background:transparent;color:var(--muted-foreground);cursor:pointer;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-sidebar-pin svg{width:12px;height:12px;display:block}
.ck-sidebar-pin:hover{background:var(--hover-bg);color:var(--primary)}
.ck-sidebar-pin:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-sidebar-pin[aria-pressed="true"]{color:var(--info);background:var(--selected-bg)}
.ck-sidebar-flyout-items{flex:1;overflow-y:auto}
.ck-sidebar-flyout-item{
  display:flex;align-items:center;gap:10px;width:calc(100% - 12px);
  box-sizing:border-box;
  padding:7px 14px;margin:1px 6px;
  border:0;border-radius:var(--radius-md);
  background:transparent;color:var(--foreground);cursor:pointer;text-align:start;
  font:var(--font-weight-normal) var(--text-base) var(--font-sans);
  text-decoration:none;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-sidebar-flyout-item svg{width:13px;height:13px;flex:none;opacity:.7}
.ck-sidebar-flyout-item:is(:hover,[data-force~="hover"]){background:var(--hover-bg);color:var(--primary)}
.ck-sidebar-flyout-item:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-sidebar-flyout-item[aria-current="page"],.ck-sidebar-flyout-item.is-active{
  background:var(--primary);color:var(--primary-foreground)}
.ck-sidebar-flyout-item:is([aria-current="page"],.is-active) svg{opacity:1}
.ck-sidebar-flyout-foot{
  margin-block-start:auto;
  display:flex;align-items:center;gap:var(--space-xs);
  padding:10px 14px;border-top:1px solid var(--border);
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground)}
.ck-sidebar-flyout-foot svg{width:11px;height:11px;flex:none}
.ck-sidebar-flyout-foot.is-locked{color:var(--primary);font-weight:var(--font-weight-medium)}
@media (prefers-reduced-motion:reduce){
  .ck-sidebar-flyout{transition-duration:1ms}}

/* Two things used to live here and both are gone. A popover-style flyout — a
   220px floating card whose min-width was still quietly beating the real
   panel's width:200px, which is exactly what a leftover duplicate does. And
   .ck-sidebar-group, which existed only to group items in the expanded rail;
   with one variant there is nothing to group. */

/* ─── CANVAS (Foundation) ──────────────────────────────────────────────────
   The app ground. A fourth surface level above the three in § 4, because
   "the page an app sits on" and "the default surface a control sits in" are
   different roles that shadcn happens to give the same value.

     --canvas      the page the app sits on          (light #eef1f3)
     --background  the default surface in it         (light #ffffff)
     --card        elevated but in flow              (light #ffffff)
     --popover     floating out of flow              (light #ffffff)

   Only light diverges. Dark and high contrast already separate the ground
   from --card, so --canvas equals --background there.

   .ck-canvas is the shell: put it on the element that owns the viewport, not
   on a panel. A panel on --canvas is a defect — it would read as a hole in
   the page rather than a surface on it.

   Spec: references/components/canvas.md */
.ck-canvas{
  min-height:100vh;box-sizing:border-box;
  background:var(--canvas);color:var(--canvas-foreground)}
/* The inset variant, for a region that sits back from the surface around it —
   a preview well, an empty column. Not for a panel. */
.ck-canvas-inset{
  box-sizing:border-box;border-radius:var(--radius-2xl);
  background:var(--canvas);color:var(--canvas-foreground)}

/* ─── WORKING PANEL — .ck-panel ────────────────────────────────────────────
   The blank white panel a screen's content actually lives in, laid on the
   canvas. Everything else on a page is inside one of these.

   It is NOT .ck-card. A card is a discrete object in a list of objects, with
   a title and a purpose of its own; a panel is a REGION of the screen. Same
   surface, different job — and the difference shows in the rules below, which
   are all about how panels sit next to each other rather than what they hold.

     No shadow            it rests on the page (§ 14.3 check 21). Only an
                          overlay lifts, and a panel is not an overlay.
     --panel-stroke edge  1.63:1 against the fill, 1.44:1 against the canvas.
                          --panel-border is 1.02:1 on the canvas, which is no
                          edge at all — see the token's own note.
     --card fill          white in light, and the elevated surface in dark.
                          Hardcoding white would black out in dark theme.

   Spec: references/components/canvas.md § Working panel */
.ck-panel{
  box-sizing:border-box;min-width:0;min-height:0;
  background:var(--card);color:var(--card-foreground);
  border:1px solid var(--panel-stroke);border-radius:var(--radius-2xl);
  overflow:hidden}
/* A panel that scrolls its own content while the page frame stays put. */
.ck-panel.is-scroll{display:flex;flex-direction:column}
.ck-panel.is-scroll > .ck-panel-body{flex:1;min-height:0;overflow:auto}

/* ─── CANVAS LAYOUT — .ck-canvas-area ─────────────────────────────────────
   Where the panels sit, and the four spacing rules that govern them. They are
   stated once here rather than per screen, because a screen that invents its
   own gutters is how two pages of the same product stop looking related.

     16px BETWEEN panels, always, whenever more than one is on screen.
     0 at the TOP. The first row of panels meets the header bar with no gap —
       the header is the page's own edge, not a floating object above it, and
       a strip of canvas between the two reads as a rendering gap.
     16px at the BOTTOM, above the base footer.
     16px at the SIDES, so the gutter matches the gap between panels and the
       rhythm is one number everywhere.

   The asymmetry at the top is deliberate and is the rule most likely to be
   "corrected" by someone tidying up. It is not a mistake. */
.ck-canvas-area{
  --ck-panel-gap:var(--space-base);
  flex:1;min-height:0;box-sizing:border-box;
  display:flex;gap:var(--ck-panel-gap);
  padding:0 var(--ck-panel-gap) var(--ck-panel-gap);
  background:var(--canvas);color:var(--canvas-foreground)}
/* Panels stacked down the page instead of across it. */
.ck-canvas-area.is-stacked{flex-direction:column}
/* Every direct child is a panel and shares the space unless it says otherwise;
   a panel with its own width simply keeps it. */
.ck-canvas-area > .ck-panel{flex:1}
.ck-canvas-area > .ck-panel.is-fixed{flex:none}

/* ─── APP SHELL — .ck-shell ───────────────────────────────────────────────
   Header bar across the top, main navigation down the left, canvas filling
   the rest. THE HEADER AND THE LEFT NAV ARE ALWAYS PRESENT unless a screen
   has an explicit reason to hide them.

   .is-immersive is that explicit reason: a screen whose whole job is one
   document — the reconciliation detail page — hides both and brings them back
   on hover from the top and the left edge. It is a deliberate mode a screen
   opts into, never a layout that happens by accident, and the chrome must
   still be reachable by keyboard, so the reveal is :focus-within as well as
   :hover. */
.ck-shell{
  display:grid;grid-template-columns:auto minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);
  min-height:100vh;box-sizing:border-box;
  background:var(--canvas);color:var(--canvas-foreground)}
/* THE NAV RUNS THE FULL HEIGHT — top to bottom, with the header bar starting
   to its right. The rail is the app's fixed edge; the header belongs to the
   PAGE inside it and changes as you navigate, so a header that crossed over
   the rail would imply the rail was part of the page. */
.ck-shell > .ck-sidebar{grid-column:1;grid-row:1 / -1}
.ck-shell > .header-bar{grid-column:2;grid-row:1}
.ck-shell > .ck-canvas-area{grid-column:2;grid-row:2}
/* No background override needed here: .header-bar is transparent in every
   mode, so the canvas already runs behind it. */
/* A footer, when the screen has one. The 16px above it belongs to the canvas
   area, not to the footer, so a screen without one loses no spacing. */
.ck-shell > .ck-shell-foot{
  grid-column:1 / -1;grid-row:3;
  display:flex;align-items:center;gap:var(--space-md);
  padding:var(--space-sm) var(--space-base);box-sizing:border-box;
  border-top:1px solid var(--panel-stroke);
  background:var(--background);color:var(--foreground)}

/* Immersive: the chrome retracts and returns on approach. */
.ck-shell.is-immersive > .header-bar,
.ck-shell.is-immersive > .ck-sidebar{
  position:fixed;z-index:var(--z-sticky);
  transition:transform var(--duration-moderate) var(--ease-default)}
.ck-shell.is-immersive > .header-bar{
  inset-block-start:0;inset-inline:0;transform:translateY(-100%)}
.ck-shell.is-immersive > .ck-sidebar{
  inset-block:0;inset-inline-start:0;transform:translateX(-100%)}
.ck-shell.is-immersive > .header-bar:is(:hover,:focus-within),
.ck-shell.is-immersive > .header-bar[data-force~="hover"]{transform:translateY(0)}
.ck-shell.is-immersive > .ck-sidebar:is(:hover,:focus-within),
.ck-shell.is-immersive > .ck-sidebar[data-force~="hover"]{transform:translateX(0)}
/* The strips that catch the pointer at the two edges while the chrome is away.
   Without them the only way back is to guess where the hidden bar is. */
.ck-shell.is-immersive{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.ck-shell.is-immersive > .ck-canvas-area{grid-column:1;grid-row:1;padding-block-start:var(--ck-panel-gap)}
@media (prefers-reduced-motion:reduce){
  .ck-shell.is-immersive > :is(.header-bar,.ck-sidebar){transition-duration:1ms}}

/* ─── FOLDER NAVIGATOR (Organism) — .ck-folder-nav ────────────────────────
   A folder tree in a panel. Rebuilt from the two shipped versions: the
   document editor (document-editor-vercel) and the folder listing used by
   integrations, folder settings and the reconciliation flows.

   TWO VARIANTS, and the difference is real rather than decorative:

     .ck-folder-nav              Folders only, TWO levels. Counts are `orange`.
                                 A group heading shows no count — the number
                                 belongs to the folders inside it, not to the
                                 heading. Used everywhere except the editor.

     .ck-folder-nav.is-document  THREE levels: folder, subfolder, documents.
                                 Counts are `blue`. Every document row carries
                                 a checkbox, because the editor's tree is a
                                 multi-select of what is open in the workspace.

   Amber against blue is the product's own distinction and it is worth keeping:
   in the editor a count is "pages loaded here"; in a listing it is "folders
   needing attention". Two different facts should not wear one colour.

   EVERY PART IS AN EXISTING ATOM. The search row is .ck-search with a
   .ck-input, the document checkbox is .ck-check, the head actions are
   .ck-icon-btn carrying .ck-tip-host, and the count is .ck-counter with a
   palette tone. The tree contributes layout and nothing else. The two
   references had drifted into three different search inputs and two checkbox
   sizes between them; pointing the tree at the atoms is what stops that
   recurring.

   IT IS AN ARIA TREEVIEW, not a stack of buttons. The row is a
   div[role="treeitem"] with a roving tabindex, so the chevron and the row
   controls can be real <button>s — a button nested inside a button is invalid
   and the parser lifts it straight out of its parent, which is the same trap
   .ck-dd-clear fell into. Enter and Space are wired in JS because that is the
   cost of not using a <button> for the row itself.

   Spec: references/components/folder-nav.md */
.ck-folder-nav{
  /* Declared on the panel, not the row, because .ck-folder-children needs it
     to work out the indent. */
  --ck-row-gap:7px;
  display:flex;flex-direction:column;min-height:0;box-sizing:border-box;
  width:300px;flex:none;
  border:1px solid var(--panel-stroke);border-radius:var(--radius-2xl);
  background:var(--card);color:var(--card-foreground);
  overflow:hidden;
  transition:width var(--duration-moderate) var(--ease-default),
             opacity var(--duration-base) var(--ease-default)}
/* Collapsible, for a listing that hands the width back to its table. The
   panel stays mounted and its width animates, so the table reflows once
   instead of twice. */
.ck-folder-nav.is-closed{
  width:0;min-width:0;padding:0;border-width:0;
  opacity:0;pointer-events:none}
@media (prefers-reduced-motion:reduce){.ck-folder-nav{transition-duration:1ms}}

/* ── Head ── */
.ck-folder-head{
  display:flex;flex-direction:column;gap:var(--space-sm);flex:none;
  padding:var(--space-base) var(--space-base) var(--space-md)}
.ck-folder-head-top{display:flex;align-items:center;gap:var(--space-sm)}
.ck-folder-title{
  flex:1;min-width:0;
  font:var(--font-weight-semibold) var(--text-xl) var(--font-sans);color:var(--foreground);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ck-folder-actions{display:flex;align-items:center;gap:var(--space-sm);flex:none}
/* The one round button in the head is the primary add. Round because it is the
   head's single affirmative action and a pill reads as "new"; sort, settings
   and refresh stay plain .ck-icon-btn on the control radius. */
.ck-folder-actions > .ck-icon-btn.is-add{
  border-radius:var(--radius-full);
  background:var(--primary);color:var(--primary-foreground)}
.ck-folder-actions > .ck-icon-btn.is-add:is(:hover,[data-force~="hover"]){
  background:var(--primary-hover);color:var(--primary-foreground)}

/* ── Tree ── */
.ck-folder-tree{
  flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;
  padding:var(--space-xs) var(--space-sm) var(--space-base)}
/* One row definition for all three levels. Weight carries the level, not a
   different box: a folder is semibold, anything nested is regular. */
.ck-folder-row{
  display:flex;align-items:center;gap:var(--ck-row-gap);
  box-sizing:border-box;width:100%;
  padding:var(--space-sm);
  border-radius:var(--radius-md);
  background:transparent;color:var(--foreground);cursor:pointer;
  font:var(--font-weight-semibold) var(--text-base) var(--font-sans);
  user-select:none;
  transition:background var(--duration-base),color var(--duration-base)}
.ck-folder-row:is(:hover,[data-force~="hover"]){background:var(--hover-bg)}
.ck-folder-row:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-folder-row:is([aria-selected="true"],.is-selected){
  background:var(--selected-bg);color:var(--selected-fg)}

/* ── Where the highlight starts ──
   A row with no children still reserves the chevron's lane, or the folder
   column goes crooked. But that lane is EMPTY, and painting the highlight
   across it leaves a band of colour in front of the row with nothing in it —
   the highlight starts 23px before the first thing the reader can see.

   So the highlight begins at the row's leftmost icon instead. It cannot be
   done by moving the row: the row's edge IS the highlight's edge, so shifting
   it right would carry the icon with it and break the column. The paint is
   moved onto a pseudo-element instead, which lets the background start
   wherever we like while every child stays exactly where it was.

   The inset is one chevron plus one gap — derived, so it follows if either
   changes. What is left in front of the icon is the row's own padding, the
   same 8px every other row has before its first ink, so all the highlights
   share one rhythm. */
.ck-folder-row:has(> .ck-folder-chev.is-empty){position:relative;background:transparent}
.ck-folder-row:has(> .ck-folder-chev.is-empty)::before{
  content:'';position:absolute;inset-block:0;inset-inline-end:0;
  inset-inline-start:calc(var(--icon-size) + var(--ck-row-gap));
  border-radius:var(--radius-md);background:transparent;
  transition:background var(--duration-base)}
/* The row's children are positioned so they paint over the pseudo-element;
   without this the highlight covers the label. */
.ck-folder-row:has(> .ck-folder-chev.is-empty) > *{position:relative}
.ck-folder-row:has(> .ck-folder-chev.is-empty):is(:hover,[data-force~="hover"])::before{
  background:var(--hover-bg)}
.ck-folder-row:has(> .ck-folder-chev.is-empty):is([aria-selected="true"],.is-selected)::before{
  background:var(--selected-bg)}
/* The focus ring follows the highlight, or a keyboard user sees a ring around
   a box the selection does not fill. */
.ck-folder-row:has(> .ck-folder-chev.is-empty):focus-visible{box-shadow:none}
.ck-folder-row:has(> .ck-folder-chev.is-empty):focus-visible::before{
  box-shadow:var(--focus-ring)}
.ck-folder-row[aria-disabled="true"]{
  background:transparent;color:var(--input);cursor:not-allowed;pointer-events:none}
/* Nested rows: regular weight, indented one step. */
/* A nested row begins exactly under its parent's FOLDER ICON, not under its
   chevron — so the indent is one chevron plus one gap, derived rather than
   guessed. A flat 20px left every level a few pixels adrift of the glyph
   above it. */
.ck-folder-children{display:none;padding-inline-start:calc(var(--icon-size) + var(--ck-row-gap))}
.ck-folder-group.is-open > .ck-folder-children{display:block}
.ck-folder-children .ck-folder-row{font-weight:var(--font-weight-normal)}
.ck-folder-children .ck-folder-row:is([aria-selected="true"],.is-selected){
  font-weight:var(--font-weight-semibold)}

/* Chevron. CLOCKWISE, both directions — 0deg closed, 90deg open, and closing
   runs 90 -> 180 rather than rewinding. The integrations reference collapses
   with rotate(-90deg), which turns the opposite way to every other disclosure
   in the kit; § 14.9 check 7 calls that a defect, so it was not carried over.
   The state is .is-open on the group; the animation only decorates it. */
.ck-folder-chev{
  width:var(--icon-size);height:var(--icon-size);flex:none;padding:0;
  display:grid;place-items:center;
  border:0;background:0;cursor:pointer;
  color:var(--muted-foreground);transform:rotate(0deg)}
.ck-folder-chev svg{width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-folder-chev:focus-visible{outline:0;box-shadow:var(--focus-ring);border-radius:var(--radius-xs)}
.ck-folder-group.is-open > .ck-folder-row > .ck-folder-chev{
  animation:ck-chev-quarter-open var(--duration-moderate) var(--ease-default) forwards}
.ck-folder-group.is-closing > .ck-folder-row > .ck-folder-chev{
  animation:ck-chev-quarter-close var(--duration-moderate) var(--ease-default) forwards}
/* A QUARTER turn, not the 180deg ck-chev-open the accordion and the dropdown
   share. Those start from a chevron already pointing down and flip it; a tree
   chevron points right when closed, so it travels 0 -> 90 -> 180. Same
   clockwise-both-ways rule, different arc — which is why this is its own pair
   of keyframes and not a duplicate of theirs. */
@keyframes ck-chev-quarter-open{from{transform:rotate(0deg)}to{transform:rotate(90deg)}}
@keyframes ck-chev-quarter-close{from{transform:rotate(90deg)}to{transform:rotate(180deg)}}
@media (prefers-reduced-motion:reduce){
  /* Shortened, not removed: dropping the animation would leave the chevron
     pointing the wrong way (§ 14.9 check 8). */
  .ck-folder-group.is-open > .ck-folder-row > .ck-folder-chev,
  .ck-folder-group.is-closing > .ck-folder-row > .ck-folder-chev{animation-duration:1ms}}
/* A row with no children still reserves the chevron's lane, or its label
   starts 16px left of its siblings' and the column goes crooked. */
.ck-folder-chev.is-empty{visibility:hidden;cursor:default}

/* Folder glyph. The two icons crossfade rather than one being swapped, so the
   row's width never changes between states. */
.ck-folder-glyph{
  position:relative;width:var(--icon-size);height:var(--icon-size);flex:none;
  display:inline-grid;place-items:center;color:var(--muted-foreground)}
.ck-folder-glyph svg{
  position:absolute;width:var(--icon-size);height:var(--icon-size);
  stroke-width:var(--icon-stroke);
  transition:opacity var(--duration-base)}
.ck-folder-glyph .ck-folder-open{opacity:0}
/* A WORKSPACE never changes glyph. The first level of the tree is a
   workspace, not a folder, and a workspace does not open — the folders inside
   it do. It carries a single stacked-folders icon and keeps it in every state,
   so the level a row belongs to stays readable no matter what is selected or
   expanded. The rules below are scoped :not(.is-workspace) for that reason. */
.ck-folder-glyph.is-workspace svg{position:static;opacity:1}

/* Open OR selected shows the open glyph. Selected matters on its own: a leaf
   folder has nothing to expand, so without this rule the row a reader is
   actually looking at is the one drawn shut. */
.ck-folder-group.is-open > .ck-folder-row > .ck-folder-glyph:not(.is-workspace) .ck-folder-open,
.ck-folder-row:is([aria-selected="true"],.is-selected) > .ck-folder-glyph:not(.is-workspace) .ck-folder-open{opacity:1}
.ck-folder-group.is-open > .ck-folder-row > .ck-folder-glyph:not(.is-workspace) .ck-folder-shut,
.ck-folder-row:is([aria-selected="true"],.is-selected) > .ck-folder-glyph:not(.is-workspace) .ck-folder-shut{opacity:0}

.ck-folder-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── Count ──
   This is the .ck-counter atom, not a copy of it: the markup is
   <span class="ck-counter blue"> in the editor and <span class="ck-counter
   orange"> in a listing. Both tones already exist in the palette, so the tree
   mints nothing.

   The count is INFORMATION, not an action, so it is always present and it
   holds the trailing edge. The controls sit BEFORE it in the markup and the
   count takes the auto margin, so the gap opens ahead of the count and the
   count itself does not move when a row is hovered. Put the controls after it
   instead and every count in the tree jogs sideways under the pointer. */
.ck-folder-row > .ck-counter{margin-inline-start:auto}
/* A group heading's number belongs to the folders inside it, not to the
   heading, so the standard variant hides it there. */
.ck-folder-nav .ck-folder-group > .ck-folder-row > .ck-counter{display:none}

/* ── Row controls, revealed on approach ──
   Width animates from 0 so the count slides rather than the row reflowing, and
   they reveal on :focus-within as well as :hover — a control a keyboard cannot
   reach is a control § 14.3 check 31 does not allow.

   NO overflow:hidden here, deliberately. opacity:0 already hides the glyph,
   and a clipping box would cut off the tooltip every icon-only control owes
   the reader (check 18). */
.ck-folder-tool{
  position:relative;
  width:0;min-width:0;height:24px;flex:none;padding:0;
  display:grid;place-items:center;
  border:0;background:0;border-radius:var(--radius-sm);
  color:var(--muted-foreground);cursor:pointer;
  opacity:0;pointer-events:none;
  margin-inline-start:calc(-1 * var(--ck-row-gap));
  transition:width var(--duration-base) var(--ease-default),
             opacity var(--duration-base) var(--ease-default),
             margin var(--duration-base) var(--ease-default)}
.ck-folder-tool svg{width:var(--icon-size);height:var(--icon-size);stroke-width:var(--icon-stroke);display:block}
.ck-folder-tool:is(:hover,[data-force~="hover"]){background:var(--hover-bg);color:var(--foreground)}
.ck-folder-tool:focus-visible{outline:0;box-shadow:var(--focus-ring)}
.ck-folder-row:is(:hover,:focus-within,[data-force~="hover"]) > .ck-folder-tool,
.ck-folder-row:is([aria-selected="true"],.is-selected) > .ck-folder-tool{
  opacity:1;pointer-events:auto;width:24px;
  margin-inline-start:calc(var(--space-xs) - var(--ck-row-gap))}
/* "New folder inside" belongs to a workspace row and only in the standard
   variant. The document editor's tree is a picture of what is open in the
   workspace, not a place to build one, so it offers no creation at all. */
.ck-folder-nav.is-document .ck-folder-tool.is-newfolder{display:none}
/* Refresh spins while it works, on the kit's one spin keyframe. */
.ck-folder-tool.is-spinning svg{animation:ck-spin .8s linear infinite}

/* ── Document level — .ck-folder-nav.is-document ──
   Blue counts, and a checkbox on every document row. The checkbox governs
   what is OPEN in the workspace; it never deletes anything, which is why it is
   a checkbox and not a dismiss. */
/* In the editor a folder's count IS a fact about the folder — the pages loaded
   under it — so the standard variant's hiding rule is lifted. */
.ck-folder-nav.is-document .ck-folder-group > .ck-folder-row > .ck-counter{display:inline-grid}
/* A document reserves NO chevron lane. A folder keeps its empty lane because
   that is what aligns it with the siblings that do expand; a document can
   never expand, so the lane is 23px of nothing in front of every row — and
   the selection highlight draws that emptiness.

   Dropping it also lands the checkbox exactly under the parent folder's icon,
   which is the indent rule stated above: children indent 46px + row padding
   8px = 54px, the same x as the glyph on the folder holding them. */
.ck-folder-doc > .ck-folder-chev{display:none}
.ck-folder-doc{font-weight:var(--font-weight-normal)}
.ck-folder-doc > .ck-check{flex:none;margin:0}
.ck-folder-doc:has(> .ck-check:checked){font-weight:var(--font-weight-medium)}
/* Documents sit one step deeper than the subfolder holding them. */
.ck-folder-children .ck-folder-children{padding-inline-start:calc(var(--icon-size) + var(--ck-row-gap))}

/* ── Empty and filtered states ── */
.ck-folder-empty{
  padding:var(--space-base) var(--space-sm);text-align:center;
  font:var(--font-weight-normal) var(--text-md) var(--font-sans);
  color:var(--muted-foreground)}
.ck-folder-row[hidden],.ck-folder-group[hidden]{display:none}


/* ===========================================================================
   ANIMATED ALPHA RAMPS  ·  § 2a
   ---------------------------------------------------------------------------
   § 2 requires every colour to be 6-digit hex, and offers a companion
   --*-opacity token wherever alpha is genuinely needed. A ring that FADES
   cannot use either escape on its own: pre-composing the trough against the
   page ground yields an opaque ring that expands and then sits there, and
   box-shadow has no opacity channel of its own.

   So the ramp rides a ::after ring. The colour is a token; the alpha is a
   --pulse-*-opacity token; the trough is always 0. Four roles, named for what
   the pulse MEANS, never for how strong it looks:

     attention  destructive  this needs action
     activity   info         this just changed
     input      primary      this is waiting for entry
     guide      background   the guided-tour spotlight

   A host needs position:relative and its own border-radius; the ring inherits
   both. Respects prefers-reduced-motion.
   =========================================================================== */
.ck-pulse{position:relative}
.ck-pulse::after{
  content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
}
.ck-pulse.is-attention::after{
  box-shadow:0 0 0 0 var(--destructive);opacity:var(--pulse-attention-opacity);
  animation:ck-pulse-attention 1.4s ease-in-out infinite;
}
.ck-pulse.is-activity::after{
  box-shadow:0 0 0 0 var(--info);opacity:var(--pulse-activity-opacity);
  animation:ck-pulse-activity 1.1s ease-out infinite;
}
.ck-pulse.is-input::after{
  box-shadow:0 0 0 0 var(--primary);opacity:0;
  animation:ck-pulse-input 1.2s ease-in-out infinite;
}
.ck-pulse.is-guide::after{
  box-shadow:0 0 0 2px var(--background);opacity:var(--pulse-guide-opacity);
  animation:ck-pulse-guide 2.2s ease-in-out infinite;
}
@keyframes ck-pulse-attention{
  0%,100%{box-shadow:0 0 0 0 var(--destructive);opacity:var(--pulse-attention-opacity)}
  50%    {box-shadow:0 0 0 6px var(--destructive);opacity:0}
}
@keyframes ck-pulse-activity{
  0%,100%{box-shadow:0 0 0 0 var(--info);opacity:var(--pulse-activity-opacity)}
  50%    {box-shadow:0 0 0 5px var(--info);opacity:0}
}
@keyframes ck-pulse-input{
  0%,100%{box-shadow:0 0 0 0 var(--primary);opacity:0}
  50%    {box-shadow:0 0 0 4px var(--primary);opacity:var(--pulse-input-opacity)}
}
@keyframes ck-pulse-guide{
  0%,100%{box-shadow:0 0 0 2px var(--background);opacity:var(--pulse-guide-opacity)}
  50%    {box-shadow:0 0 0 6px var(--background);opacity:calc(var(--pulse-guide-opacity) * .4)}
}
@media (prefers-reduced-motion:reduce){
  .ck-pulse::after{animation:none}
}
