/* ============================================================================
   Cortex DS v4 — component layer

   THIS FILE IS THE POINT. The v3 design system shipped tokens and no
   components: shared/ds/styles.css is a 20-line @import manifest with zero
   rules, which is why spacing/weight/motion had ZERO consumers while colour
   had ~700 (a lint required colour and nothing required the rest).

   Rule for this layer: a DS component NEVER carries a Tailwind utility, and a
   Tailwind utility never sets a value a token owns. Tailwind stays legal for
   layout one-offs OUTSIDE these components.

   Everything here reads tokens.css. No raw hex, no raw px for anything a
   token owns.
   ========================================================================= */

/* ── base ──────────────────────────────────────────────────────────────── */
.cx-root {
  font-family: var(--cx-font);
  background: var(--cx-ground);
  color: var(--cx-ink);
  font-size: var(--cx-body);
  line-height: var(--cx-lh-normal);
  font-variant-numeric: tabular-nums;   /* every figure aligns, no mono needed */
}
.cx-icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cx-icon--sm { width: 15px; height: 15px; }
.cx-icon--lg { width: 26px; height: 26px; }
:where(.cx-root) :focus-visible { outline: none; box-shadow: var(--cx-focus-ring); }

/* ── shell ─────────────────────────────────────────────────────────────── */
.cx-app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.cx-app[data-rail="collapsed"] { grid-template-columns: 64px 1fr; }
.cx-stage { padding: var(--cx-s3) var(--cx-s4) var(--cx-s8); display: grid;
  gap: var(--cx-s3); align-content: start; min-width: 0; }
/* the panel row. The third panel is CONTEXTUAL — absent until an item opens. */
.cx-stage[data-panel="open"] { grid-template-columns: 1fr 372px; align-items: start; }
.cx-stage-main { display: grid; gap: var(--cx-s3); min-width: 0; }

/* ── rail ──────────────────────────────────────────────────────────────── */
.cx-rail { display: flex; flex-direction: column; padding: var(--cx-s3) var(--cx-s3);
  position: sticky; top: 0; height: 100vh; }
.cx-rail-top { display: flex; align-items: center; gap: var(--cx-s2);
  padding: var(--cx-s1) var(--cx-s2) var(--cx-s3); }
.cx-rail-mark { width: 26px; height: 26px; border-radius: var(--cx-radius-sm);
  background: var(--cx-accent); color: var(--cx-ink-on-accent); display: grid;
  place-items: center; font-weight: var(--cx-w-bold); font-size: var(--cx-sm); flex: none; }
.cx-rail-name { font-size: var(--cx-h3); font-weight: var(--cx-w-semi); }
.cx-rail-name span { color: var(--cx-ink-3); font-weight: var(--cx-w-regular); }
.cx-rail-collapse { margin-left: auto; color: var(--cx-ink-3); background: none;
  border: 0; cursor: pointer; display: flex; padding: 2px; border-radius: var(--cx-radius-sm); }
.cx-rail-search { display: flex; align-items: center; gap: var(--cx-s2);
  padding: var(--cx-s2) 11px; border-radius: var(--cx-radius-md); background: var(--cx-panel);
  border: 1px solid var(--cx-line); color: var(--cx-ink-3); font-size: var(--cx-body); cursor: text; }
.cx-rail-group { font-size: var(--cx-xs); font-weight: var(--cx-w-semi);
  letter-spacing: var(--cx-tr-wide); text-transform: uppercase; color: var(--cx-ink-3);
  padding: 0 var(--cx-s2); margin: var(--cx-s4) 0 var(--cx-s1); }
.cx-rail-item { display: flex; align-items: center; gap: var(--cx-s2) ;
  padding: var(--cx-s2) 9px; border-radius: var(--cx-radius-md); color: var(--cx-ink-2);
  text-decoration: none; font-size: var(--cx-body); }
.cx-rail-item:hover { background: var(--cx-panel); }
.cx-rail-item[aria-current] { background: var(--cx-accent-wash);
  color: var(--cx-accent-quiet); font-weight: var(--cx-w-semi); }
.cx-rail-item__count { margin-left: auto; font-size: var(--cx-sm);
  font-weight: var(--cx-w-semi); color: var(--cx-accent); }
/* in-production: present, not hidden, not fake. Never opens onto a stub. */
.cx-rail-item[aria-disabled="true"] { color: var(--cx-ink-3); cursor: default; }
.cx-rail-item[aria-disabled="true"]:hover { background: none; }
.cx-rail-item[aria-disabled="true"] .cx-icon { opacity: .55; }
.cx-rail-soon { margin-left: auto; font-size: 10px; font-weight: var(--cx-w-semi);
  letter-spacing: .05em; text-transform: uppercase; color: var(--cx-ink-3);
  border: 1px solid var(--cx-line); padding: 1px 6px; border-radius: var(--cx-radius-pill); }
/* Connections is NOT a department — it is the other half of Inputs. */
.cx-rail-foot { margin-top: auto; padding-top: var(--cx-s3); border-top: 1px solid var(--cx-line-2); }
.cx-rail-stack { display: flex; margin-left: auto; }
.cx-rail-stack > * { width: 20px; height: 20px; border-radius: var(--cx-radius-sm);
  border: 1.5px solid var(--cx-ground); margin-left: -6px; display: grid; place-items: center;
  font-size: 8.5px; font-weight: var(--cx-w-bold); color: #fff; }
.cx-rail-stack > *:first-child { margin-left: 0; }

/* ── panel ─────────────────────────────────────────────────────────────── */
.cx-panel { background: var(--cx-panel); border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-panel); }
.cx-panel__hd { display: flex; align-items: center; gap: var(--cx-s2);
  padding: 13px var(--cx-s4); border-bottom: 1px solid var(--cx-line-2); }
.cx-panel__hd h2 { margin: 0; font-size: var(--cx-h3); font-weight: var(--cx-w-semi);
  letter-spacing: var(--cx-tr-heading); }
/* every panel carries its OWN affordance — collapse, refresh, scope, more */
.cx-panel__aff { margin-left: auto; display: flex; align-items: center; gap: var(--cx-s3);
  color: var(--cx-ink-3); font-size: var(--cx-sm); }
.cx-panel__bd { padding: var(--cx-s4); }
.cx-panel__kicker { padding: 0 var(--cx-s4); margin-top: -4px;
  font-size: var(--cx-sm); color: var(--cx-ink-3); }
.cx-panel--sticky { position: sticky; top: var(--cx-s3); }

/* ── buttons ───────────────────────────────────────────────────────────── */
.cx-btn { font: inherit; font-size: var(--cx-body); font-weight: var(--cx-w-semi);
  padding: 7px 15px; border-radius: var(--cx-radius-pill); border: 1px solid var(--cx-line);
  background: var(--cx-panel); color: var(--cx-ink); cursor: pointer;
  transition: background-color var(--cx-dur) var(--cx-ease), border-color var(--cx-dur) var(--cx-ease); }
.cx-btn:hover { border-color: var(--cx-line-strong); }
.cx-btn--primary { background: var(--cx-accent); border-color: var(--cx-accent);
  color: var(--cx-ink-on-accent); }
.cx-btn--primary:hover { background: var(--cx-accent-hover); border-color: var(--cx-accent-hover); }
.cx-btn--quiet { font-size: var(--cx-sm); padding: 3px 9px; border-radius: var(--cx-radius-sm);
  color: var(--cx-ink-2); background: var(--cx-ground); }
.cx-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── input ─────────────────────────────────────────────────────────────── */
.cx-input { width: 100%; padding: var(--cx-s2) 11px; border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-md); font: inherit; font-size: var(--cx-body);
  color: var(--cx-ink); background: var(--cx-panel); }
.cx-input::placeholder { color: var(--cx-ink-3); }
.cx-input[aria-invalid="true"] { border-color: var(--cx-error); }

/* ── segmented control ─────────────────────────────────────────────────── */
.cx-seg { display: inline-flex; background: var(--cx-ground); border-radius: var(--cx-radius-md); padding: 2px; }
.cx-seg button { font: inherit; font-size: var(--cx-sm); padding: 4px 12px; border: 0;
  background: none; color: var(--cx-ink-2); border-radius: var(--cx-radius-sm); cursor: pointer; }
.cx-seg button[aria-pressed="true"] { background: var(--cx-panel); color: var(--cx-ink);
  font-weight: var(--cx-w-semi); }

/* ── status pill — ALWAYS mark + word, never colour alone ──────────────── */
.cx-pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--cx-sm);
  font-weight: var(--cx-w-medium); padding: 3px 9px; border-radius: var(--cx-radius-pill); }
.cx-pill .cx-icon { width: 13px; height: 13px; }
.cx-pill--canon   { background: var(--cx-canon-wash);   color: var(--cx-canon); }
.cx-pill--working { background: var(--cx-working-wash); color: var(--cx-ink-2); }
.cx-pill--ok      { background: var(--cx-ok-wash);      color: var(--cx-ok); }
.cx-pill--warn    { background: var(--cx-warn-wash);    color: var(--cx-warn); }
.cx-pill--error   { background: var(--cx-error-wash);   color: var(--cx-error); }

/* ── reading — machine output ────────────────────────────────────────────
   THE AI-SIGNAL RULE:
     panel-level (cross-item) readings live INSIDE the panel they describe;
     item-level readings live in the contextual third panel with the item.
   Chat is NOT here. Chat stays in the pop-out companion. */
.cx-reading { background: var(--cx-ai); border: 1px solid var(--cx-ai-line);
  border-radius: var(--cx-radius-lg); padding: 13px 15px; }
.cx-reading__hd { display: flex; align-items: center; gap: 7px; font-size: var(--cx-sm);
  font-weight: var(--cx-w-semi); color: var(--cx-ai-ink); margin-bottom: 6px; }
.cx-reading__hd .cx-icon { width: 14px; height: 14px; }
.cx-reading p { margin: 0; font-size: var(--cx-h3); line-height: var(--cx-lh-normal); }
.cx-reading__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.cx-reading__chips > * { font-size: var(--cx-sm); padding: 4px 10px;
  border-radius: var(--cx-radius-pill); background: var(--cx-panel);
  border: 1px solid var(--cx-ai-line); color: var(--cx-ai-ink); }

/* ── honest absence — the product's best writing gets its own component ── */
.cx-absent { border: 1px dashed var(--cx-line); border-radius: var(--cx-radius-lg);
  padding: 13px 15px; }
.cx-absent h4 { margin: 0 0 5px; font-size: var(--cx-body); font-weight: var(--cx-w-semi); }
.cx-absent p { margin: 0; font-size: var(--cx-sm); line-height: var(--cx-lh-snug); color: var(--cx-ink-2); }

/* ── the reading — hero figure ─────────────────────────────────────────── */
.cx-read { display: flex; align-items: flex-end; gap: var(--cx-s5); flex-wrap: wrap; }
.cx-read__value { font-size: 66px; font-weight: var(--cx-w-semi); line-height: .92;
  letter-spacing: -.04em; }
.cx-read__value small { font-size: 22px; font-weight: var(--cx-w-medium); color: var(--cx-ink-3); margin-left: 5px; }
.cx-read__delta { padding-bottom: var(--cx-s2); }
.cx-read__delta b { display: block; font-size: 22px; font-weight: var(--cx-w-semi);
  color: var(--cx-accent); letter-spacing: -.02em; }
.cx-read__delta span { font-size: var(--cx-sm); color: var(--cx-ink-3); }
/* the tare line — the baseline every figure is measured against */
.cx-tare { display: flex; align-items: center; gap: 9px; font-size: var(--cx-sm); color: var(--cx-ink-3); }

/* ── stat tile — when the answer is a number, not a chart ─────────────── */
.cx-tile { border: 1px solid var(--cx-line-2); border-radius: var(--cx-radius-lg); padding: 14px 16px; }
.cx-tile dt { font-size: var(--cx-sm); color: var(--cx-ink-3); }
.cx-tile dd { margin: 3px 0 0; font-size: 30px; font-weight: var(--cx-w-semi); letter-spacing: -.03em; }
.cx-tile dd em { font-style: normal; font-size: var(--cx-h3); font-weight: var(--cx-w-semi);
  color: var(--cx-accent); margin-left: var(--cx-s2); }
.cx-tile small { display: block; font-size: var(--cx-sm); color: var(--cx-ink-3); margin-top: 3px; }

/* ── data row — the product's dominant primitive. There is no table. ───── */
.cx-rows { display: grid; }
.cx-row { display: grid; grid-template-columns: 14px 1fr 92px 120px 72px; gap: var(--cx-s3);
  align-items: center; padding: 11px var(--cx-s2); margin: 0 calc(var(--cx-s2) * -1);
  border-bottom: 1px solid var(--cx-line-2); border-radius: var(--cx-radius-md); cursor: pointer; }
.cx-row:last-child { border-bottom: 0; }
.cx-row:hover { background: var(--cx-ground); }
.cx-row[aria-selected="true"] { background: var(--cx-accent-wash);
  box-shadow: inset 2px 0 0 var(--cx-accent); }
.cx-row__name { font-size: var(--cx-h3); font-weight: var(--cx-w-medium); }
.cx-row__name small { display: block; font-size: var(--cx-sm); font-weight: var(--cx-w-regular);
  color: var(--cx-ink-3); margin-top: 1px; }
.cx-row__qty { font-size: var(--cx-body); text-align: right; color: var(--cx-ink-2); }
.cx-row__move { font-size: var(--cx-sm); font-weight: var(--cx-w-semi); text-align: right; color: var(--cx-accent); }
.cx-row__move--flat { color: var(--cx-ink-3); font-weight: var(--cx-w-medium); }
/* the dot: an item has a reading waiting behind the click.
   OPEN RULE — the dot only signals while readings are scarce. If a normal day
   marks most rows it becomes texture. Cap it or let the legend count carry it. */
.cx-row__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cx-ai-ink); margin-left: 3px; }
.cx-row__dot--none { background: transparent; }
.cx-rows__legend { padding: 11px 0 0; font-size: var(--cx-sm); color: var(--cx-ink-3);
  display: flex; align-items: center; gap: 7px; }

/* ── attention row — a flagged line with its one action ────────────────── */
.cx-attn__group, .cx-attn__row { list-style: none; }
.cx-attn__group { padding-top: var(--cx-s3); }
.cx-attn__group:first-child { padding-top: 0; }
.cx-attn__hd { display: flex; align-items: baseline; font-size: var(--cx-body); font-weight: var(--cx-w-semi); }
.cx-attn__count { margin-left: auto; font-size: var(--cx-sm); font-weight: var(--cx-w-regular); color: var(--cx-ink-3); }
.cx-attn__why { font-size: var(--cx-sm); color: var(--cx-ink-3); margin: 1px 0 4px; }
.cx-attn__row { display: flex; align-items: center; gap: var(--cx-s2); padding: var(--cx-s2) 0;
  border-bottom: 1px solid var(--cx-line-2); }
.cx-attn__row:last-child { border-bottom: 0; }
.cx-attn__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--cx-warn); }
.cx-attn__dot--err { background: var(--cx-error); }
.cx-attn__line { flex: 1; font-size: var(--cx-body); }
.cx-attn__act { font-size: var(--cx-sm); color: var(--cx-accent); background: none; border: 0;
  cursor: pointer; padding: 0; font-weight: var(--cx-w-medium); }
.cx-attn__act:hover { text-decoration: underline; }

/* ── quiet note — an honest-absence or degraded line inside a panel ─────── */
.cx-note { font-size: var(--cx-body); color: var(--cx-ink-3); padding: var(--cx-s2) 0; }

/* ── labelled field — plain-case label over its input ───────────────────── */
.cx-field { display: block; margin-top: var(--cx-s3); font-size: var(--cx-sm); color: var(--cx-ink-2); }
.cx-field > .cx-input { margin-top: var(--cx-s1); width: 100%; }

/* ── inline checkbox control ─────────────────────────────────────────────── */
.cx-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--cx-sm);
  color: var(--cx-ink-3); cursor: pointer; user-select: none; margin-left: auto; }

/* ── subgroup — a plain-titled group inside a panel body ────────────────── */
.cx-subgroup { margin-top: var(--cx-s4); }
.cx-subgroup:first-child { margin-top: 0; }
.cx-subgroup__bd { margin-top: var(--cx-s2); }

.cx-drop__name { font-size: var(--cx-sm); color: var(--cx-ink-3); margin-top: var(--cx-s1); }

/* ── gauge — value against its target ──────────────────────────────────── */
.cx-gauge { height: 5px; border-radius: 3px; background: var(--cx-line-2); position: relative; overflow: hidden; }
.cx-gauge > i { position: absolute; inset: 0 auto 0 0; background: var(--cx-accent); border-radius: 3px; }
.cx-gauge--ok > i { background: var(--cx-line-strong); }
.cx-gauge > b { position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--cx-ink); border-radius: 1px; }   /* the target mark */

/* ── progress timeline — Capture's ingestion, stage by stage ───────────── */
.cx-steps { display: grid; }
.cx-step { display: grid; grid-template-columns: 22px 1fr auto; gap: 11px;
  align-items: start; padding: var(--cx-s2) 0; font-size: var(--cx-body); }
.cx-step__mark { display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: var(--cx-radius-pill); border: 1.5px solid var(--cx-line);
  color: var(--cx-ink-3); font-size: 11px; }
.cx-step[data-state="done"] .cx-step__mark { border-color: var(--cx-canon); color: var(--cx-canon); }
.cx-step[data-state="now"]  .cx-step__mark { border-color: var(--cx-accent); color: var(--cx-accent); }
.cx-step small { display: block; color: var(--cx-ink-3); font-size: var(--cx-sm);
  margin-top: 1px; line-height: var(--cx-lh-snug); }
.cx-step time { font-size: var(--cx-sm); color: var(--cx-ink-3); }

/* ── skeleton ──────────────────────────────────────────────────────────── */
.cx-skeleton { display: grid; gap: 9px; }
.cx-skeleton > i { display: block; height: 11px; border-radius: var(--cx-radius-sm);
  background: linear-gradient(90deg, var(--cx-line-2) 25%, var(--cx-line) 37%, var(--cx-line-2) 63%);
  background-size: 340% 100%; animation: cx-shimmer 1.5s var(--cx-ease-in-out) infinite; }
@keyframes cx-shimmer { from { background-position: 120% 0 } to { background-position: -120% 0 } }
@media (prefers-reduced-motion: reduce) { .cx-skeleton > i { animation: none } }

/* ── advisory — the authored error model ─────────────────────────────────
   Neither Cortex nor ANY of the 13 corpus references authored error or
   permission-denied. These are invented. The rule that matters:
   ON A PARTIAL FAILURE THE PRIMARY ACTION STAYS ENABLED. */
.cx-advisory { border-radius: var(--cx-radius-lg); padding: 13px 15px;
  display: grid; grid-template-columns: 20px 1fr; gap: 11px; }
.cx-advisory .cx-icon { width: 18px; height: 18px; margin-top: 1px; }
.cx-advisory b { display: block; font-size: var(--cx-h3); font-weight: var(--cx-w-semi); margin-bottom: 3px; }
.cx-advisory p { margin: 0; font-size: var(--cx-body); line-height: var(--cx-lh-snug); color: var(--cx-ink-2); }
.cx-advisory--warn  { background: var(--cx-warn-wash);
  border: 1px solid color-mix(in oklab, var(--cx-warn) 25%, transparent); color: var(--cx-warn); }
.cx-advisory--error { background: var(--cx-error-wash);
  border: 1px solid color-mix(in oklab, var(--cx-error) 25%, transparent); color: var(--cx-error); }

/* ── empty — ONE register, held everywhere: name what is missing and why ── */
.cx-empty { padding: var(--cx-s7) var(--cx-s5); text-align: center; }
.cx-empty .cx-icon { color: var(--cx-ink-3); margin-bottom: var(--cx-s2); }
.cx-empty b { display: block; font-size: var(--cx-h3); font-weight: var(--cx-w-semi); margin-bottom: 5px; }
.cx-empty p { margin: 0 auto var(--cx-s3); font-size: var(--cx-body);
  color: var(--cx-ink-2); line-height: var(--cx-lh-snug); max-width: 400px; }

/* ── drop target ───────────────────────────────────────────────────────── */
.cx-drop { border: 1.5px dashed var(--cx-line); border-radius: 14px;
  padding: 30px var(--cx-s5); text-align: center; }
/* block-display svg resets (Tailwind preflight) would pin it left */
.cx-drop > .cx-icon { margin: 0 auto var(--cx-s1); }
.cx-drop[data-dragover="true"] { border-color: var(--cx-accent); background: var(--cx-accent-wash); }
.cx-drop b { display: block; font-size: 15px; font-weight: var(--cx-w-semi); margin-bottom: 4px; }
.cx-drop p { margin: 0 auto var(--cx-s3); font-size: var(--cx-body);
  color: var(--cx-ink-2); max-width: 400px; line-height: var(--cx-lh-snug); }
/* A FILE INPUT MUST EXIST. Import was paste-only in v3 — zero type="file"
   anywhere in the repo — against a demo that opens on a POS upload. */
.cx-drop__alts { display: flex; gap: 9px; justify-content: center; align-items: center; }

/* ── modal — blurred scrim, commit bar OUTSIDE the scrolling body ──────── */
.cx-scrim { position: fixed; inset: 0; background: var(--cx-scrim);
  backdrop-filter: blur(var(--cx-scrim-blur)); z-index: 40; }
.cx-modal { position: fixed; z-index: 41; top: 56px; left: 50%; transform: translateX(-50%);
  width: 620px; max-width: calc(100vw - 40px); max-height: calc(100vh - 112px);
  background: var(--cx-panel); border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius-modal); box-shadow: var(--cx-shadow-modal);
  display: flex; flex-direction: column; overflow: hidden; }
.cx-modal__hd { padding: var(--cx-s4) var(--cx-s5) var(--cx-s3); }
.cx-modal__hd h3 { margin: 0; font-size: 17px; font-weight: var(--cx-w-semi);
  letter-spacing: var(--cx-tr-heading); }
.cx-modal__hd p { margin: 4px 0 0; font-size: var(--cx-body); color: var(--cx-ink-3); }
.cx-modal__bd { padding: 4px var(--cx-s5) var(--cx-s4); overflow: auto; }
.cx-modal__ft { padding: 13px var(--cx-s5); border-top: 1px solid var(--cx-line-2);
  display: flex; align-items: center; gap: var(--cx-s2); background: var(--cx-panel); }
.cx-modal__ft .cx-modal__note { font-size: var(--cx-sm); color: var(--cx-ink-3); margin-right: auto; }

/* ── home ──────────────────────────────────────────────────────────────── */
.cx-home { max-width: 780px; margin: 0 auto; padding: 64px var(--cx-s4) var(--cx-s8); text-align: center; }
/* the ONLY use of the display face anywhere in the product */
.cx-wordmark { font-family: var(--cx-font-display); font-variation-settings: "wdth" 100, "opsz" 72;
  font-weight: var(--cx-w-bold); font-size: var(--cx-display); line-height: var(--cx-lh-display);
  letter-spacing: var(--cx-tr-display); color: var(--cx-accent); margin: 0; }
.cx-home__logo { display: block; width: min(20rem, 70%); height: auto; margin: 0 auto; }
.cx-home__greet { margin: var(--cx-s3) 0 0; font-size: 15px; color: var(--cx-ink-2); }
.cx-eyebrow { font-size: var(--cx-xs); font-weight: var(--cx-w-semi); letter-spacing: var(--cx-tr-wide);
  text-transform: uppercase; color: var(--cx-ink-3); margin: 46px 0 var(--cx-s2); text-align: left; }
.cx-ctas { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: var(--cx-s3); text-align: left; }
.cx-cta { background: var(--cx-panel); border: 1px solid var(--cx-line); border-radius: 14px;
  padding: 15px 16px; cursor: pointer; text-align: left; font: inherit; color: var(--cx-ink);
  transition: border-color var(--cx-dur) var(--cx-ease), box-shadow var(--cx-dur) var(--cx-ease); }
.cx-cta:hover { border-color: var(--cx-accent); box-shadow: var(--cx-shadow-hover); }
.cx-cta__v { font-size: 25px; font-weight: var(--cx-w-semi); letter-spacing: -.03em; }
.cx-cta__v em { font-style: normal; font-size: var(--cx-body); font-weight: var(--cx-w-semi);
  color: var(--cx-accent); margin-left: 7px; }
.cx-cta__l { font-size: var(--cx-h3); margin-top: 2px; }
.cx-cta__s { font-size: var(--cx-sm); color: var(--cx-ink-3); margin-top: 3px; }
/* Home's readings — the same readings, shrunk. Home decides nothing. */
.cx-mini { display: grid; gap: 9px; text-align: left; }
.cx-mini > a { display: grid; grid-template-columns: 16px 1fr auto; gap: 11px; align-items: start;
  padding: var(--cx-s3) 14px; border-radius: var(--cx-radius-lg); background: var(--cx-ai);
  border: 1px solid var(--cx-ai-line); text-decoration: none; color: var(--cx-ink); }
.cx-mini > a .cx-icon { width: 15px; height: 15px; color: var(--cx-ai-ink); margin-top: 1px; }
.cx-mini p { margin: 0; font-size: var(--cx-h3); line-height: var(--cx-lh-snug); }
.cx-mini span { font-size: var(--cx-sm); color: var(--cx-ink-3); white-space: nowrap; padding-top: 2px; }

/* ── connection tile ───────────────────────────────────────────────────── */
.cx-conns { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--cx-s2); }
.cx-conn { display: flex; align-items: center; gap: var(--cx-s3); padding: 13px 14px;
  border: 1px solid var(--cx-line); border-radius: 13px; background: var(--cx-panel); }
.cx-conn__logo { width: 34px; height: 34px; border-radius: var(--cx-radius-md);
  display: grid; place-items: center; font-weight: var(--cx-w-bold); font-size: var(--cx-sm);
  color: #fff; flex: none; }
.cx-conn b { display: block; font-size: var(--cx-h3); font-weight: var(--cx-w-semi); }
.cx-conn small { display: block; font-size: var(--cx-sm); color: var(--cx-ink-3); margin-top: 1px; }
.cx-conn--off { border-style: dashed; }
.cx-conn--off .cx-conn__logo { filter: grayscale(1); opacity: .5; }

/* ── chat launcher — the persistent companion affordance ────────────────
   Owner ruling 2026-08-03 (round 3, R7; supersedes the round-2 removal): a
   floating launcher on EVERY surface, accent-derived — the client accent,
   never violet — DS radius/elevation, sparkle mark; opens the pop-out
   companion. One obvious click opens chat. */
.cx-chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 48px; height: 48px; border-radius: var(--cx-radius-pill);
  background: var(--cx-accent); color: var(--cx-ink-on-accent);
  border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--cx-shadow-popover);
  transition: transform var(--cx-dur) var(--cx-ease), box-shadow var(--cx-dur) var(--cx-ease); }
.cx-chat-fab:hover { transform: translateY(-1px); box-shadow: var(--cx-shadow-hover), var(--cx-shadow-popover); }
.cx-chat-fab .cx-icon { width: 22px; height: 22px; }
.cx-chat-fab--busy { animation: cx-fab-breathe 1.6s ease-in-out infinite; }
@keyframes cx-fab-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .cx-chat-fab { transition: none; }
  .cx-chat-fab--busy { animation: none; }
}

/* ── advisory footer — stays on every advisory surface ─────────────────── */
.cx-footnote { text-align: center; font-size: var(--cx-sm); color: var(--cx-ink-3); padding-top: var(--cx-s1); }

/* ── narrow width. The corpus has NO answer below ~900px; this is authored.
   Rail becomes an overlay; the contextual panel becomes a full-width sheet. */
@media (max-width: 900px) {
  .cx-app, .cx-app[data-rail="collapsed"] { grid-template-columns: 1fr; }
  .cx-rail { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 42;
    background: var(--cx-ground); border-right: 1px solid var(--cx-line);
    transform: translateX(-100%); transition: transform var(--cx-dur-slow) var(--cx-ease); }
  .cx-app[data-rail="open"] .cx-rail { transform: none; }
  .cx-stage[data-panel="open"] { grid-template-columns: 1fr; }
  .cx-panel--sticky { position: static; }
  .cx-read__value { font-size: 46px; }
  .cx-row { grid-template-columns: 14px 1fr 84px; }
  .cx-row .cx-gauge, .cx-row__qty { display: none; }
  .cx-wordmark { font-size: 40px; }
}

/* ── Section tabs ────────────────────────────────────────────────────────────
   A department's sub-navigation. Lives in the DS rather than beside its first
   consumer because it is shared by construction: Spaces uses it now, Membership
   and Concierge are built against it, and a copy per department is how four
   sub-navs end up looking like four different products.

   TWO STATES, ONE OF WHICH IS THE POINT. A `--soon` tab is a screen that will
   exist and does not yet. It is deliberately still legible — dimmed, not
   ghosted — because its whole job is to be read. Hiding unbuilt screens makes a
   half-finished department look finished, which is the more expensive lie. */
.cx-tabs { display: flex; align-items: stretch; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--cx-line); margin-bottom: var(--cx-s4); }
.cx-tab { appearance: none; border: 0; background: none; font: inherit;
  font-size: var(--cx-sm); font-weight: var(--cx-w-medium); color: var(--cx-ink-2);
  padding: 10px 12px; min-height: 44px; cursor: pointer; position: relative;
  border-radius: var(--cx-radius-sm) var(--cx-radius-sm) 0 0; white-space: nowrap; }
.cx-tab:hover { color: var(--cx-text); background: var(--cx-surface-1); }
/* The selected rail sits ON the container's bottom border rather than above it,
   so the tab reads as attached to the panel it controls. */
.cx-tab[aria-selected="true"] { color: var(--cx-accent); font-weight: var(--cx-w-semi); }
.cx-tab[aria-selected="true"]::after { content: ""; position: absolute;
  left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--cx-accent);
  border-radius: 2px 2px 0 0; }
.cx-tab:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: -2px; }
/* not-allowed, not `disabled`: the element stays in the accessibility tree and
   in the Tab order so the screen it names can still be discovered. */
.cx-tab--soon { color: var(--cx-text-muted); cursor: not-allowed; }
.cx-tab--soon:hover { background: none; color: var(--cx-text-muted); }
.cx-tab__soon { margin-left: 6px; font-size: 10px; font-weight: var(--cx-w-semi);
  letter-spacing: .06em; text-transform: uppercase; color: var(--cx-text-muted);
  border: 1px solid var(--cx-line-2); border-radius: 3px; padding: 1px 4px;
  vertical-align: 1px; }
@media (max-width: 900px) {
  .cx-tabs { flex-wrap: nowrap; overflow-x: auto; }
}
