/* ==========================================================================
   Sassly UI — base: reset, browser surfaces, shared primitives
   Requires tokens.css. Every component stylesheet builds on these classes.
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--sx-line-strong) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  font-family: var(--sx-font);
  font-size: var(--sx-fs-base);
  line-height: var(--sx-lh);
  color: var(--sx-ink);
  background: var(--sx-shell);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: var(--sx-heading-weight);
  letter-spacing: var(--sx-heading-tracking);
  line-height: var(--sx-lh-tight);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

:where(ul, ol)[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

[hidden] {
  display: none !important;
}

/* ---------- Browser surfaces ---------- */
::selection {
  background: var(--sx-selection);
  color: inherit;
}

input,
textarea,
[contenteditable] {
  caret-color: var(--sx-accent);
}

::placeholder {
  color: var(--sx-muted);
  opacity: 1;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--sx-focus);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--sx-line-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Utilities ---------- */
.sx-tabular {
  font-variant-numeric: tabular-nums;
}

.sx-mono {
  font-family: var(--sx-font-mono);
  font-size: 0.94em;
  letter-spacing: 0;
}

.sx-muted {
  color: var(--sx-muted);
}

.sx-truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sx-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sx-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--sx-line-strong) transparent;
}

/* ---------- Icon ---------- */
.sx-icon {
  width: var(--sx-icon-size, 1em);
  height: var(--sx-icon-size, 1em);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--sx-icon-stroke, 1.75);
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* ---------- Card: the standard component container ---------- */
.sx-card {
  position: relative;
  background: var(--sx-card-bg);
  color: var(--sx-ink);
  border-radius: var(--sx-card-radius);
  box-shadow: var(--sx-card-shadow);
  transition: box-shadow var(--sx-dur-3) var(--sx-ease-out), background-color var(--sx-dur-3) var(--sx-ease-out);
}

/* ---------- Button ----------
   The .sx-btn family.
   <button type="button" class="sx-btn sx-btn--primary"><span>Publish</span></button>

   Variants  (none) secondary, --primary, --ghost, --accent, --danger
   Sizes     --sm, (none), --lg   (heights from --sx-h-sm / md / lg: 28, 34, 40px)
   Shapes    --icon square, icon only (give it an aria-label); --pill; --block full width
   Icons     <svg class="sx-icon"> before or after the label <span>
   States    :hover, :active or [data-pressed], :focus-visible,
             :disabled or [aria-disabled="true"],
             [aria-busy="true"]: the label fades and a .sx-spinner child spins
   Neutral tints are mixed from the label colour, so outline and ghost buttons follow
   every theme and mode without extra tokens. */

.sx-btn {
  /* Geometry, set per size */
  --_h: var(--sx-h-md, 34px);
  --_px: 13px;
  --_fs: var(--sx-fs-base, 13px);
  --_gap: 6px;
  --_icon: 15px;
  --_spin: 14px;
  --_r: var(--sx-r-md, 8px);

  /* Colour, set per variant. These base values are the secondary (outline) button. */
  --_bg: transparent;
  --_bg-hover: color-mix(in srgb, currentColor 4%, transparent);
  --_bg-active: color-mix(in srgb, currentColor 7%, transparent);
  --_border: var(--sx-line, color-mix(in srgb, currentColor 14%, transparent));
  --_border-hover: color-mix(in srgb, currentColor 24%, transparent);
  --_shadow: 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --_ring: var(--sx-focus, var(--sx-accent, #5b48e0));

  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--_gap);
  box-sizing: border-box;
  height: var(--_h);
  margin: 0;
  padding: 0 var(--_px);
  border: 1px solid var(--_border);
  border-radius: var(--_r);
  outline: 2px solid transparent;
  outline-offset: 2px;
  background-color: var(--_bg);
  box-shadow: var(--_shadow);
  color: inherit;
  font: inherit;
  font-size: var(--_fs);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  appearance: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    outline-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.12s ease;
}

/* States */
@media (hover: hover) {
  .sx-btn:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
    background-color: var(--_bg-hover);
    border-color: var(--_border-hover);
  }
}

.sx-btn:is(:active, [data-pressed]):not(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
  background-color: var(--_bg-active);
  transform: scale(0.98);
}

.sx-btn:focus-visible {
  outline-color: var(--_ring);
}

.sx-btn:is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

/* Loading: the content keeps its width but fades, the spinner takes its place. */
.sx-btn[aria-busy="true"] {
  cursor: progress;
}

.sx-btn > * {
  transition: opacity 0.16s ease;
}

.sx-btn[aria-busy="true"] > :not(.sx-spinner) {
  opacity: 0;
}

.sx-btn > .sx-spinner {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: var(--_spin);
  height: var(--_spin);
  margin: auto;
  border: 1.5px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: sx-btn-spin 0.7s linear infinite;
}

.sx-btn[aria-busy="true"] > .sx-spinner {
  opacity: 1;
}

@keyframes sx-btn-spin {
  to {
    transform: rotate(1turn);
  }
}

/* Icons */
.sx-btn > .sx-icon {
  flex: none;
  width: var(--_icon);
  height: var(--_icon);
  stroke-width: 1.75;
}

/* An icon at the edge reads as more padding than text does, so trim 2px there. */
.sx-btn:not(.sx-btn--icon):has(> .sx-icon:first-child) {
  padding-inline-start: calc(var(--_px) - 2px);
}

.sx-btn:not(.sx-btn--icon):has(> .sx-icon:last-child) {
  padding-inline-end: calc(var(--_px) - 2px);
}

/* Sizes and shapes */
.sx-btn--sm {
  --_h: var(--sx-h-sm, 28px);
  --_px: 10px;
  --_fs: var(--sx-fs-sm, 12px);
  --_gap: 5px;
  --_icon: 14px;
  --_spin: 12px;
  --_r: var(--sx-r-sm, 7px);
}

.sx-btn--lg {
  --_h: var(--sx-h-lg, 40px);
  --_px: 16px;
  --_fs: var(--sx-fs-md, 14px);
  --_gap: 7px;
  --_icon: 16px;
  --_spin: 16px;
  --_r: var(--sx-r-lg, 10px);
}

.sx-btn--icon {
  width: var(--_h);
  padding: 0;
}

.sx-btn--pill {
  --_r: 999px;
}

.sx-btn--pill:not(.sx-btn--icon) {
  padding-inline: calc(var(--_px) + 3px);
}

.sx-btn--block {
  display: flex;
  width: 100%;
}

/* Variants */

/* Solid ink for the main action. Hover moves the fill toward the label colour. */
.sx-btn--primary {
  --_tone: var(--sx-primary, #1b1b21);
  --_on: var(--sx-on-primary, #fbfbfc);
  --_bg: var(--_tone);
  --_bg-hover: color-mix(in oklab, var(--_tone), var(--_on) 9%);
  --_bg-active: color-mix(in oklab, var(--_tone), black 8%);
  --_border: transparent;
  --_border-hover: transparent;
  --_shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 1px 2px rgb(0 0 0 / 0.14);
  color: var(--_on);
}

/* The one coloured action, kept for upgrades and moments that need pull. */
.sx-btn--accent {
  --_tone: var(--sx-accent, #5b48e0);
  --_on: var(--sx-on-accent, #ffffff);
  --_bg: var(--_tone);
  --_bg-hover: color-mix(in oklab, var(--_tone), var(--_on) 10%);
  --_bg-active: color-mix(in oklab, var(--_tone), black 8%);
  --_border: transparent;
  --_border-hover: transparent;
  --_shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.14),
    0 1px 2px color-mix(in srgb, var(--_tone) 40%, transparent);
  color: var(--_on);
}

/* Text only until hovered; the label steps up from muted to full colour. */
.sx-btn--ghost {
  --_bg: transparent;
  --_bg-hover: color-mix(in srgb, currentColor 6%, transparent);
  --_bg-active: color-mix(in srgb, currentColor 9%, transparent);
  --_border: transparent;
  --_border-hover: transparent;
  --_shadow: none;
  color: var(--sx-muted, color-mix(in srgb, currentColor 62%, transparent));
}

@media (hover: hover) {
  .sx-btn--ghost:hover:not(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
    color: var(--sx-ink, inherit);
  }
}

.sx-btn--ghost:is(:active, [data-pressed]):not(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
  color: var(--sx-ink, inherit);
}

/* Soft red: tinted fill, hairline and label. The label is mixed with the text
   colour so it stays readable on both light and dark surfaces. */
.sx-btn--danger {
  --_tone: var(--sx-danger, #d93a3a);
  --_bg: color-mix(in srgb, var(--_tone) 6%, transparent);
  --_bg-hover: color-mix(in srgb, var(--_tone) 11%, transparent);
  --_bg-active: color-mix(in srgb, var(--_tone) 15%, transparent);
  --_border: var(--sx-danger-line, color-mix(in srgb, var(--_tone) 28%, transparent));
  --_border-hover: color-mix(in srgb, var(--_tone) 44%, transparent);
  --_shadow: none;
  color: color-mix(in oklab, var(--_tone) 78%, var(--sx-ink, currentColor));
}

/* Preferences */
@media (prefers-reduced-motion: reduce) {
  .sx-btn {
    transition-property: background-color, border-color, color, box-shadow, outline-color, opacity;
  }

  .sx-btn:is(:active, [data-pressed]):not(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
    transform: none;
  }

  .sx-btn > .sx-spinner {
    animation-duration: 1.6s;
  }
}

/* Filled buttons have transparent borders; give every button an edge in high-contrast mode. */
@media (forced-colors: active) {
  .sx-btn {
    border-color: ButtonBorder;
  }

  .sx-btn:focus-visible {
    outline-color: Highlight;
  }
}

/* ---------- Chip / badge ---------- */
.sx-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--sx-r-pill);
  font-size: var(--sx-fs-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: var(--sx-ink-2);
  background: var(--sx-raised);
  box-shadow: inset 0 0 0 1px var(--sx-line);
}

.sx-chip > .sx-icon {
  --sx-icon-size: 12px;
}

.sx-chip--soft {
  background: var(--sx-fill);
  box-shadow: none;
}

.sx-chip--accent {
  color: var(--sx-accent-ink);
  background: var(--sx-accent-soft);
  box-shadow: inset 0 0 0 1px var(--sx-accent-line);
}

.sx-chip--mark {
  color: var(--sx-mark-ink);
  background: var(--sx-mark-soft);
  box-shadow: inset 0 0 0 1px var(--sx-mark-line);
}

.sx-chip--success {
  color: var(--sx-success-ink);
  background: var(--sx-success-soft);
  box-shadow: inset 0 0 0 1px var(--sx-success-line);
}

.sx-chip--warning {
  color: var(--sx-warning-ink);
  background: var(--sx-warning-soft);
  box-shadow: inset 0 0 0 1px var(--sx-warning-line);
}

.sx-chip--danger {
  color: var(--sx-danger-ink);
  background: var(--sx-danger-soft);
  box-shadow: inset 0 0 0 1px var(--sx-danger-line);
}

.sx-chip--info {
  color: var(--sx-info-ink);
  background: var(--sx-info-soft);
  box-shadow: inset 0 0 0 1px var(--sx-info-line);
}

.sx-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.sx-dot--live {
  animation: sx-pulse 1.8s var(--sx-ease-in-out) infinite;
}

.sx-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--sx-r-pill);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sx-on-accent);
  background: var(--sx-accent);
}

/* ---------- Keyboard hint ---------- */
.sx-kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--sx-r-xs);
  font: 500 var(--sx-fs-2xs) / 1 var(--sx-font);
  color: var(--sx-muted);
  background: var(--sx-raised);
  box-shadow: var(--sx-shadow-1);
}

/* ---------- Avatar ---------- */
.sx-avatar {
  --sx-avatar-size: 24px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--sx-avatar-size);
  height: var(--sx-avatar-size);
  flex: none;
  border-radius: 50%;
  font-size: calc(var(--sx-avatar-size) * 0.4);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--sx-avatar-ink, var(--sx-ink-2));
  background: var(--sx-avatar-bg, var(--sx-surface-3));
  box-shadow: inset 0 0 0 1px var(--sx-line);
  user-select: none;
}

.sx-avatar--sm {
  --sx-avatar-size: 20px;
}

.sx-avatar--lg {
  --sx-avatar-size: 32px;
}

.sx-avatar-stack {
  display: inline-flex;
}

.sx-avatar-stack > .sx-avatar {
  box-shadow: 0 0 0 2px var(--sx-card-bg), inset 0 0 0 1px var(--sx-line);
}

.sx-avatar-stack > .sx-avatar + .sx-avatar {
  margin-left: -6px;
}

/* ---------- Form controls ---------- */
.sx-field {
  display: grid;
  gap: 6px;
}

.sx-label {
  font-size: var(--sx-fs-sm);
  font-weight: 500;
  color: var(--sx-ink-2);
}

.sx-hint {
  font-size: var(--sx-fs-sm);
  color: var(--sx-muted);
}

.sx-error-text {
  font-size: var(--sx-fs-sm);
  color: var(--sx-danger-ink);
}

.sx-input {
  width: 100%;
  height: var(--sx-h-md);
  padding: 0 10px;
  border: 0;
  border-radius: var(--sx-r-md);
  font-size: var(--sx-fs-base);
  color: var(--sx-ink);
  background: var(--sx-surface);
  box-shadow: inset 0 0 0 1px var(--sx-line-strong);
  transition: box-shadow var(--sx-dur-2) var(--sx-ease-out), background-color var(--sx-dur-2) var(--sx-ease-out);
}

textarea.sx-input {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
  line-height: var(--sx-lh);
}

.sx-input:hover {
  box-shadow: inset 0 0 0 1px var(--sx-faint);
}

.sx-input:focus,
.sx-input:focus-visible {
  outline: none;
  box-shadow: var(--sx-focus-ring);
}

.sx-input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1px var(--sx-danger), 0 0 0 3px var(--sx-danger-soft);
}

.sx-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Checkbox: <label class="sx-check"><input type="checkbox"><span class="sx-check__box"><svg class="sx-icon">check</svg></span> Label</label> */
.sx-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.sx-check > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.sx-check__box {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 5px;
  color: var(--sx-on-primary);
  background: var(--sx-raised);
  box-shadow: inset 0 0 0 1px var(--sx-line-strong);
  transition: background-color var(--sx-dur-1) var(--sx-ease-out), box-shadow var(--sx-dur-1) var(--sx-ease-out);
}

.sx-check__box > .sx-icon {
  --sx-icon-size: 12px;
  --sx-icon-stroke: 3;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--sx-dur-1) var(--sx-ease-out), transform var(--sx-dur-3) var(--sx-ease-spring);
}

.sx-check > input:checked + .sx-check__box,
.sx-check > input:indeterminate + .sx-check__box {
  background: var(--sx-primary);
  box-shadow: none;
}

.sx-check > input:checked + .sx-check__box > .sx-icon {
  opacity: 1;
  transform: scale(1);
}

.sx-check__box {
  position: relative;
}

.sx-check__box::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--sx-on-primary);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity var(--sx-dur-1) var(--sx-ease-out), transform var(--sx-dur-3) var(--sx-ease-spring);
}

.sx-check > input:indeterminate + .sx-check__box::after {
  opacity: 1;
  transform: none;
}

.sx-check > input:indeterminate + .sx-check__box > .sx-icon {
  opacity: 0;
}

.sx-check > input:focus-visible + .sx-check__box {
  box-shadow: var(--sx-focus-ring);
}

/* Switch: <button class="sx-switch" role="switch" aria-checked="false"></button> */
.sx-switch {
  --sx-switch-w: 28px;
  --sx-switch-h: 16px;
  position: relative;
  width: var(--sx-switch-w);
  height: var(--sx-switch-h);
  flex: none;
  border-radius: var(--sx-r-pill);
  background: var(--sx-fill-strong);
  box-shadow: inset 0 0 0 1px var(--sx-line);
  transition: background-color var(--sx-dur-2) var(--sx-ease-out);
}

.sx-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(var(--sx-switch-h) - 4px);
  height: calc(var(--sx-switch-h) - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  transition: transform var(--sx-dur-3) var(--sx-ease-spring);
}

.sx-switch[aria-checked="true"] {
  background: var(--sx-accent);
}

[data-theme="onix"] .sx-switch[aria-checked="true"],
.sx-switch[aria-checked="true"][data-tone="primary"] {
  background: var(--sx-primary);
}

.sx-switch[aria-checked="true"]::after {
  transform: translateX(calc(var(--sx-switch-w) - var(--sx-switch-h)));
}

/* ---------- Spinner ---------- */
.sx-spinner {
  width: var(--sx-spinner-size, 14px);
  height: var(--sx-spinner-size, 14px);
  flex: none;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  border-top-color: transparent;
  border-right-color: transparent;
  animation: sx-spin 0.7s linear infinite;
}

/* ---------- Progress ---------- */
.sx-progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: var(--sx-r-pill);
  background: var(--sx-c-track);
}

.sx-progress__bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--sx-progress-color, var(--sx-accent));
  transform-origin: left center;
  transform: scaleX(var(--sx-progress, 0));
  transition: transform var(--sx-dur-4) var(--sx-ease-out), background-color var(--sx-dur-2) var(--sx-ease-out);
}

/* ---------- Menu / popover ---------- */
.sx-menu {
  min-width: 180px;
  padding: 4px;
  border-radius: var(--sx-r-lg);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-pop);
  color: var(--sx-ink);
}

.sx-menu__label {
  padding: 8px 8px 4px;
  font-size: var(--sx-fs-2xs);
  font-weight: 500;
  color: var(--sx-muted);
}

.sx-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border-radius: var(--sx-r-sm);
  font-size: var(--sx-fs-base);
  text-align: left;
  color: var(--sx-ink-2);
  cursor: pointer;
  transition: background-color var(--sx-dur-1) var(--sx-ease-out), color var(--sx-dur-1) var(--sx-ease-out);
}

.sx-menu__item > .sx-icon {
  --sx-icon-size: 15px;
  color: var(--sx-muted);
}

.sx-menu__item:hover,
.sx-menu__item[data-active="true"] {
  background: var(--sx-fill);
  color: var(--sx-ink);
}

.sx-menu__item[aria-selected="true"],
.sx-menu__item[aria-checked="true"] {
  color: var(--sx-ink);
}

.sx-menu__sep {
  height: 1px;
  margin: 4px -4px;
  background: var(--sx-line-soft);
}

/* Pop: shared enter/exit for menus, popovers, panels. Toggle data-state="open". */
.sx-pop {
  transform-origin: var(--sx-pop-origin, top center);
  transition:
    opacity var(--sx-dur-2) var(--sx-ease-out),
    transform var(--sx-dur-3) var(--sx-ease-out),
    visibility 0s linear var(--sx-dur-3);
}

.sx-pop:not([data-state="open"]) {
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  visibility: hidden;
  pointer-events: none;
}

.sx-pop[data-state="open"] {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

/* ---------- Text shimmer (in-progress status labels only) ---------- */
.sx-shimmer-text {
  color: transparent;
  background: linear-gradient(90deg, var(--sx-muted) 0%, var(--sx-muted) 35%, var(--sx-ink) 50%, var(--sx-muted) 65%, var(--sx-muted) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sx-shimmer 1.8s linear infinite;
}

/* ---------- Skeleton ---------- */
.sx-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--sx-r-sm);
  background: var(--sx-fill);
}

.sx-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--sx-fill-strong), transparent);
  animation: sx-sweep 1.4s var(--sx-ease-in-out) infinite;
}

/* ---------- Keyframes ---------- */
@keyframes sx-spin {
  to { transform: rotate(360deg); }
}

@keyframes sx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes sx-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

@keyframes sx-sweep {
  to { transform: translateX(100%); }
}

@keyframes sx-fade-in {
  from { opacity: 0; }
}

@keyframes sx-rise-in {
  from { opacity: 0; transform: translateY(6px); }
}

@keyframes sx-pop-in {
  from { opacity: 0; transform: scale(0.94); }
}

@keyframes sx-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@keyframes sx-blink {
  0%, 45% { opacity: 1; }
  55%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sx-dot--live,
  .sx-skeleton::after {
    animation: none;
  }

  .sx-shimmer-text {
    animation-duration: 4s;
  }
}
