/* ==========================================================================
   NEXUS OS — COMPONENT LIBRARY
   Complete reusable UI component system built on design tokens
   Depends on: themes/*.css for --nexus-* custom properties
   ========================================================================== */

@layer components;

@layer components {

/* ==========================================================================
   §1  FOUNDATIONS — Resets & Base
   ========================================================================== */

.nexus-button-group,
.nexus-input-group,
.nexus-card,
.nexus-list,
.nexus-table,
.nexus-tabs,
.nexus-accordion,
.nexus-breadcrumb,
.nexus-pagination,
.nexus-avatar,
.nexus-badge,
.nexus-tag,
.nexus-tooltip,
.nexus-popover,
.nexus-drawer,
.nexus-sheet,
.nexus-toolbar,
.nexus-sidebar,
.nexus-split-view,
.nexus-file-drop,
.nexus-color-picker,
.nexus-slider-group,
.nexus-meter,
.nexus-timeline,
.nexus-stepper,
.nexus-spinner,
.nexus-skeleton,
.nexus-toast,
.nexus-dialog,
.nexus-menu,
.nexus-context-menu {
  box-sizing: border-box;
  font-family: var(--nexus-font-sans);
  color: var(--nexus-text-primary);
  margin: 0;
  padding: 0;
}


/* ==========================================================================
   §2  BUTTON GROUP
   ========================================================================== */

.nexus-button-group {
  display: inline-flex;
  align-items: stretch;
}

.nexus-button-group > * {
  border-radius: 0;
  margin-left: -1px;
}

.nexus-button-group > *:first-child {
  border-radius: var(--nexus-radius-sm) 0 0 var(--nexus-radius-sm);
  margin-left: 0;
}

.nexus-button-group > *:last-child {
  border-radius: 0 var(--nexus-radius-sm) var(--nexus-radius-sm) 0;
}

.nexus-button-group > *:only-child {
  border-radius: var(--nexus-radius-sm);
}

.nexus-button-group--vertical {
  flex-direction: column;
}

.nexus-button-group--vertical > * {
  margin-left: 0;
  margin-top: -1px;
}

.nexus-button-group--vertical > *:first-child {
  border-radius: var(--nexus-radius-sm) var(--nexus-radius-sm) 0 0;
  margin-top: 0;
}

.nexus-button-group--vertical > *:last-child {
  border-radius: 0 0 var(--nexus-radius-sm) var(--nexus-radius-sm);
}

.nexus-button-group--sm > * { padding: 6px 12px; font-size: var(--nexus-font-size-xs); }
.nexus-button-group--lg > * { padding: 14px 28px; font-size: var(--nexus-font-size-base); }


/* ==========================================================================
   §3  INPUT GROUP
   ========================================================================== */

.nexus-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-xs);
}

.nexus-input-group__label {
  font-size: var(--nexus-font-size-sm);
  font-weight: 500;
  color: var(--nexus-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nexus-input-group--required .nexus-input-group__label::after {
  content: '*';
  color: var(--nexus-danger);
  font-weight: 700;
}

.nexus-input-group__input {
  position: relative;
}

.nexus-input-group__helper {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-dim);
  line-height: 1.4;
}

.nexus-input-group__error {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-danger);
  line-height: 1.4;
  display: none;
  animation: void-slide-up 0.2s ease-out;
}

.nexus-input-group--error .nexus-input-group__error {
  display: block;
}

.nexus-input-group--error .nexus-input-group__helper {
  display: none;
}

.nexus-input-group--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Inline layout (horizontal label + input) ── */
.nexus-input-group--inline {
  flex-direction: row;
  align-items: center;
  gap: var(--nexus-space-md);
}

.nexus-input-group--inline .nexus-input-group__label {
  min-width: 120px;
  flex-shrink: 0;
}

.nexus-input-group--inline .nexus-input-group__input {
  flex: 1;
}

/* ── Prefix / Suffix addons ── */
.nexus-input-group__prefix,
.nexus-input-group__suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-dim);
  background: rgba(20, 0, 10, 0.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  white-space: nowrap;
}

.nexus-input-group__prefix {
  border-right: none;
  border-radius: var(--nexus-radius-sm) 0 0 var(--nexus-radius-sm);
}

.nexus-input-group__suffix {
  border-left: none;
  border-radius: 0 var(--nexus-radius-sm) var(--nexus-radius-sm) 0;
}

.nexus-input-group__input:has(.nexus-input-group__prefix) .input-glass {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.nexus-input-group__input:has(.nexus-input-group__suffix) .input-glass {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}


/* ==========================================================================
   §4  CARD
   ========================================================================== */

.nexus-card {
  position: relative;
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur));
  -webkit-backdrop-filter: blur(var(--nexus-blur));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
  box-shadow: var(--nexus-shadow-depth);
  overflow: hidden;
  transition: all var(--nexus-transition);
  display: flex;
  flex-direction: column;
}

.nexus-card__header {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nexus-space-md);
}

.nexus-card__title {
  font-family: var(--nexus-font-display, var(--nexus-font-sans));
  font-size: var(--nexus-font-size-lg);
  font-weight: 700;
  color: var(--nexus-text-primary);
  margin: 0;
}

.nexus-card__subtitle {
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  margin-top: 2px;
}

.nexus-card__body {
  padding: var(--nexus-space-lg);
  flex: 1;
}

.nexus-card__footer {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--nexus-space-sm);
}

.nexus-card__image {
  width: 100%;
  overflow: hidden;
}

.nexus-card__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.nexus-card__image--top { order: -1; }
.nexus-card__image--bottom { order: 99; }

.nexus-card__actions {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
}

/* ── Interactive card ── */
.nexus-card--interactive {
  cursor: pointer;
}

.nexus-card--interactive:hover {
  border-color: var(--nexus-glass-border-hover);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  transform: translateY(-2px);
}

.nexus-card--interactive:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ── Horizontal card (side-by-side image + content) ── */
.nexus-card--horizontal {
  flex-direction: row;
}

.nexus-card--horizontal .nexus-card__image {
  width: 200px;
  flex-shrink: 0;
}

.nexus-card--horizontal .nexus-card__image img {
  height: 100%;
  object-fit: cover;
}

/* ── Compact ── */
.nexus-card--compact .nexus-card__header { padding: var(--nexus-space-sm) var(--nexus-space-md); }
.nexus-card--compact .nexus-card__body { padding: var(--nexus-space-md); }
.nexus-card--compact .nexus-card__footer { padding: var(--nexus-space-sm) var(--nexus-space-md); }

/* ── Featured ── */
.nexus-card--featured {
  border-color: var(--nexus-glass-border-hover);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon);
}

.nexus-card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--nexus-gradient-neon);
  box-shadow: 0 2px 15px var(--nexus-neon-glow);
  z-index: 1;
}

/* ── Loading (skeleton) ── */
.nexus-card--loading .nexus-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-sm);
}

.nexus-card--loading .nexus-card__body::before {
  content: '';
  display: block;
  height: 16px;
  width: 70%;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: nexus-card-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--nexus-radius-sm);
}

.nexus-card--loading .nexus-card__body::after {
  content: '';
  display: block;
  height: 12px;
  width: 90%;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: nexus-card-shimmer 1.5s ease-in-out infinite 0.15s;
  border-radius: var(--nexus-radius-sm);
}

@keyframes nexus-card-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Container query responsive ── */
.nexus-card {
  container-type: inline-size;
}

@container (max-width: 300px) {
  .nexus-card--horizontal {
    flex-direction: column;
  }
  .nexus-card--horizontal .nexus-card__image {
    width: 100%;
    height: 140px;
  }
}


/* ==========================================================================
   §5  LIST
   ========================================================================== */

.nexus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.nexus-list__item {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-md);
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  transition: background var(--nexus-transition-fast);
  border-bottom: 1px solid transparent;
}

.nexus-list__item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--nexus-text-dim);
  font-size: 16px;
}

.nexus-list__item-content {
  flex: 1;
  min-width: 0;
}

.nexus-list__item-content > *:first-child {
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-list__item-meta {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.nexus-list__item-action {
  flex-shrink: 0;
  color: var(--nexus-text-dim);
  font-size: 14px;
  transition: color var(--nexus-transition-fast);
}

/* ── Divided ── */
.nexus-list--divided .nexus-list__item {
  border-bottom-color: rgba(255, 20, 80, 0.06);
}

.nexus-list--divided .nexus-list__item:last-child {
  border-bottom-color: transparent;
}

/* ── Interactive ── */
.nexus-list--interactive .nexus-list__item {
  cursor: pointer;
  border-radius: var(--nexus-radius-sm);
}

.nexus-list--interactive .nexus-list__item:hover {
  background: rgba(255, 0, 64, 0.05);
}

.nexus-list--interactive .nexus-list__item:hover .nexus-list__item-action {
  color: var(--nexus-neon-primary);
}

/* ── Selectable ── */
.nexus-list--selectable .nexus-list__item {
  cursor: pointer;
}

.nexus-list--selectable .nexus-list__item--selected {
  background: rgba(255, 0, 64, 0.08);
  border-left: 2px solid var(--nexus-neon-primary);
  padding-left: calc(var(--nexus-space-md) - 2px);
}

/* ── Compact ── */
.nexus-list--compact .nexus-list__item {
  padding: var(--nexus-space-xs) var(--nexus-space-sm);
}

/* ── Group ── */
.nexus-list__group {
  display: flex;
  flex-direction: column;
}

.nexus-list__group-header {
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  font-size: var(--nexus-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nexus-text-dim);
  background: rgba(255, 255, 255, 0.015);
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(var(--nexus-blur-light));
  -webkit-backdrop-filter: blur(var(--nexus-blur-light));
}

.nexus-list__group-items {
  display: flex;
  flex-direction: column;
}

/* ── Empty state ── */
.nexus-list__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--nexus-space-2xl);
  text-align: center;
  color: var(--nexus-text-dim);
}

.nexus-list__empty-icon {
  font-size: 48px;
  margin-bottom: var(--nexus-space-md);
  opacity: 0.3;
}

.nexus-list__empty-text {
  font-size: var(--nexus-font-size-sm);
}


/* ==========================================================================
   §6  TABLE
   ========================================================================== */

.nexus-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur-light));
  -webkit-backdrop-filter: blur(var(--nexus-blur-light));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
  overflow: hidden;
  container-type: inline-size;
}

.nexus-table__header {
  display: flex;
  background: rgba(255, 0, 64, 0.04);
  border-bottom: var(--nexus-border-width-thick) solid var(--nexus-glass-border);
}

.nexus-table__header-cell {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  font-size: var(--nexus-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nexus-text-dim);
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--nexus-space-xs);
}

/* ── Sortable ── */
.nexus-table__header-cell--sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--nexus-transition-fast);
}

.nexus-table__header-cell--sortable:hover {
  color: var(--nexus-neon-primary);
}

.nexus-table__header-cell--sortable::after {
  content: '↕';
  font-size: 0.75em;
  opacity: 0.3;
}

.nexus-table__header-cell--asc::after {
  content: '↑';
  opacity: 1;
  color: var(--nexus-neon-primary);
}

.nexus-table__header-cell--desc::after {
  content: '↓';
  opacity: 1;
  color: var(--nexus-neon-primary);
}

/* ── Body ── */
.nexus-table__body {
  display: flex;
  flex-direction: column;
}

.nexus-table__row {
  display: flex;
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.05);
  transition: background var(--nexus-transition-fast);
}

.nexus-table__row:last-child {
  border-bottom: none;
}

.nexus-table__row:hover {
  background: rgba(255, 0, 64, 0.04);
}

.nexus-table__row--selected {
  background: rgba(255, 0, 64, 0.08);
}

.nexus-table__row--expanded {
  border-bottom: none;
}

.nexus-table__cell {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  flex: 1;
  display: flex;
  align-items: center;
}

/* ── Expand detail ── */
.nexus-table__expand-row {
  background: rgba(0, 0, 0, 0.15);
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.05);
}

.nexus-table__expand-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--nexus-text-dim);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  flex-shrink: 0;
}

.nexus-table__expand-toggle:hover {
  color: var(--nexus-neon-primary);
}

.nexus-table__expand-toggle--open {
  transform: rotate(90deg);
}

/* ── Footer ── */
.nexus-table__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nexus-space-sm) var(--nexus-space-lg);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  background: rgba(0, 0, 0, 0.1);
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-dim);
}

/* ── Striped ── */
.nexus-table--striped .nexus-table__row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* ── Compact ── */
.nexus-table--compact .nexus-table__header-cell,
.nexus-table--compact .nexus-table__cell {
  padding: var(--nexus-space-sm) var(--nexus-space-md);
}

/* ── Bordered ── */
.nexus-table--bordered .nexus-table__cell {
  border-right: var(--nexus-border-width) solid rgba(255, 20, 80, 0.05);
}

.nexus-table--bordered .nexus-table__cell:last-child {
  border-right: none;
}

/* ── Responsive (horizontal scroll) ── */
.nexus-table--responsive {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Loading state ── */
.nexus-table--loading .nexus-table__body {
  position: relative;
  min-height: 200px;
}

.nexus-table--loading .nexus-table__body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.03) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: nexus-table-shimmer 1.5s infinite;
}

@keyframes nexus-table-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ==========================================================================
   §7  TABS
   ========================================================================== */

.nexus-tabs {
  display: flex;
  flex-direction: column;
}

.nexus-tabs__list {
  display: flex;
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur-light));
  -webkit-backdrop-filter: blur(var(--nexus-blur-light));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius) var(--nexus-radius) 0 0;
  padding: 4px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
}

.nexus-tabs__list::-webkit-scrollbar { display: none; }

.nexus-tabs__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--nexus-space-xs);
  padding: 8px 20px;
  font-family: var(--nexus-font-sans);
  font-size: var(--nexus-font-size-sm);
  font-weight: 500;
  color: var(--nexus-text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--nexus-transition);
  user-select: none;
  flex-shrink: 0;
}

.nexus-tabs__tab:hover {
  color: var(--nexus-text-primary);
  background: rgba(255, 0, 64, 0.06);
}

.nexus-tabs__tab--active {
  color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.1);
  box-shadow: 0 0 8px var(--nexus-neon-glow-soft);
}

.nexus-tabs__tab--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--nexus-neon-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--nexus-neon-glow);
}

.nexus-tabs__tab--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.nexus-tabs__tab-icon {
  font-size: 14px;
  color: var(--nexus-text-dim);
}

.nexus-tabs__tab--active .nexus-tabs__tab-icon {
  color: var(--nexus-neon-primary);
}

.nexus-tabs__tab-badge {
  font-size: 10px;
  padding: 1px 5px;
  background: var(--nexus-neon-primary);
  color: #fff;
  border-radius: var(--nexus-radius-round);
  line-height: 1.3;
}

/* ── Panel ── */
.nexus-tabs__panel {
  padding: var(--nexus-space-lg);
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur-light));
  -webkit-backdrop-filter: blur(var(--nexus-blur-light));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-top: none;
  border-radius: 0 0 var(--nexus-radius) var(--nexus-radius);
}

/* ── Vertical ── */
.nexus-tabs--vertical {
  flex-direction: row;
}

.nexus-tabs--vertical .nexus-tabs__list {
  flex-direction: column;
  border-radius: var(--nexus-radius) 0 0 var(--nexus-radius);
  width: fit-content;
  min-width: 160px;
}

.nexus-tabs--vertical .nexus-tabs__tab--active::after {
  bottom: auto;
  left: auto;
  right: -4px;
  top: 20%;
  width: 2px;
  height: 60%;
}

.nexus-tabs--vertical .nexus-tabs__panel {
  flex: 1;
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-left: none;
  border-radius: 0 var(--nexus-radius) var(--nexus-radius) 0;
}

/* ── Pills ── */
.nexus-tabs--pills .nexus-tabs__tab {
  border-radius: var(--nexus-radius-round);
}

.nexus-tabs--pills .nexus-tabs__tab--active {
  background: var(--nexus-neon-primary);
  color: #fff;
  box-shadow: 0 0 12px var(--nexus-neon-glow);
}

.nexus-tabs--pills .nexus-tabs__tab--active::after {
  display: none;
}

/* ── Underlined ── */
.nexus-tabs--underlined .nexus-tabs__list {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-bottom: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: 0;
  padding: 0;
}

/* ── Scroll buttons ── */
.nexus-tabs__scroll-prev,
.nexus-tabs__scroll-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--nexus-glass-bg);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-sm);
  color: var(--nexus-text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--nexus-transition-fast);
}

.nexus-tabs__scroll-prev:hover,
.nexus-tabs__scroll-next:hover {
  color: var(--nexus-neon-primary);
  border-color: var(--nexus-glass-border-hover);
}


/* ==========================================================================
   §8  ACCORDION
   ========================================================================== */

.nexus-accordion {
  display: flex;
  flex-direction: column;
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
  overflow: hidden;
}

.nexus-accordion__item {
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.06);
}

.nexus-accordion__item:last-child {
  border-bottom: none;
}

.nexus-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  font-family: var(--nexus-font-sans);
  font-size: var(--nexus-font-size-sm);
  font-weight: 600;
  color: var(--nexus-text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--nexus-transition);
  user-select: none;
}

.nexus-accordion__trigger:hover {
  background: rgba(255, 0, 64, 0.04);
}

.nexus-accordion__trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--nexus-text-dim);
  transition: transform var(--nexus-transition-spring);
  flex-shrink: 0;
}

.nexus-accordion__trigger-icon::before {
  content: '›';
  font-size: 16px;
}

.nexus-accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--nexus-transition-slow), padding var(--nexus-transition);
}

.nexus-accordion__content--open {
  max-height: 1000px;
  padding: 0 var(--nexus-space-lg) var(--nexus-space-lg);
}

.nexus-accordion__content--open ~ .nexus-accordion__trigger .nexus-accordion__trigger-icon,
.nexus-accordion__item:has(.nexus-accordion__content--open) .nexus-accordion__trigger-icon {
  transform: rotate(90deg);
}

/* ── Flush (no outer borders) ── */
.nexus-accordion--flush {
  border: none;
  border-radius: 0;
}

.nexus-accordion--flush .nexus-accordion__item {
  border-bottom-color: rgba(255, 20, 80, 0.08);
}

/* ── Bordered items ── */
.nexus-accordion--bordered .nexus-accordion__item {
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-sm);
  margin-bottom: var(--nexus-space-xs);
}

.nexus-accordion--bordered .nexus-accordion__item:last-child {
  margin-bottom: 0;
}


/* ==========================================================================
   §9  BREADCRUMB
   ========================================================================== */

.nexus-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-xs);
  padding: var(--nexus-space-sm) 0;
  font-size: var(--nexus-font-size-sm);
  flex-wrap: wrap;
}

.nexus-breadcrumb__item {
  display: flex;
  align-items: center;
  color: var(--nexus-text-link);
  text-decoration: none;
  transition: color var(--nexus-transition-fast);
  padding: 2px 4px;
  border-radius: var(--nexus-radius-sm);
}

.nexus-breadcrumb__item:hover {
  color: var(--nexus-text-link-hover);
  background: rgba(255, 0, 64, 0.05);
}

.nexus-breadcrumb__item--current {
  color: var(--nexus-text-secondary);
  pointer-events: none;
}

.nexus-breadcrumb__separator {
  color: var(--nexus-text-dim);
  font-size: 0.8em;
  user-select: none;
}

.nexus-breadcrumb__separator::before {
  content: '›';
}

/* ── Collapsed (middle items hidden) ── */
.nexus-breadcrumb--collapsed .nexus-breadcrumb__item:not(:first-child):not(:last-child):not(.nexus-breadcrumb__item--ellipsis) {
  display: none;
}

.nexus-breadcrumb__item--ellipsis {
  color: var(--nexus-text-dim);
  cursor: pointer;
  padding: 2px 6px;
}

.nexus-breadcrumb__item--ellipsis:hover {
  color: var(--nexus-neon-primary);
}


/* ==========================================================================
   §10  PAGINATION
   ========================================================================== */

.nexus-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--nexus-space-xs);
  padding: var(--nexus-space-md) 0;
}

.nexus-pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  background: transparent;
  border: var(--nexus-border-width) solid transparent;
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  user-select: none;
  text-decoration: none;
}

.nexus-pagination__item:hover {
  color: var(--nexus-text-primary);
  background: var(--nexus-glass-bg);
  border-color: var(--nexus-glass-border);
}

.nexus-pagination__item--active {
  color: #fff;
  background: rgba(255, 0, 64, 0.2);
  border-color: var(--nexus-neon-primary);
  box-shadow: 0 0 10px var(--nexus-neon-glow-soft);
}

.nexus-pagination__item--active:hover {
  background: rgba(255, 0, 64, 0.3);
  color: #fff;
}

.nexus-pagination__item--disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.nexus-pagination__prev,
.nexus-pagination__next {
  font-size: 16px;
}

.nexus-pagination__ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--nexus-text-dim);
  font-size: var(--nexus-font-size-sm);
  user-select: none;
}

/* ── Compact (prev/next only) ── */
.nexus-pagination--compact {
  justify-content: space-between;
}

.nexus-pagination--compact .nexus-pagination__ellipsis,
.nexus-pagination--compact .nexus-pagination__item:not(.nexus-pagination__prev):not(.nexus-pagination__next) {
  display: none;
}


/* ==========================================================================
   §11  AVATAR
   ========================================================================== */

.nexus-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--nexus-glass-border);
  box-shadow: 0 0 6px var(--nexus-neon-glow-soft);
  background: var(--nexus-glass-bg);
  flex-shrink: 0;
  transition: all var(--nexus-transition);
}

.nexus-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nexus-avatar__initials {
  font-size: 14px;
  font-weight: 700;
  color: var(--nexus-text-secondary);
  text-transform: uppercase;
  user-select: none;
}

/* ── Status indicator ── */
.nexus-avatar__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--nexus-bg);
  background: var(--nexus-text-dim);
}

.nexus-avatar__status--online { background: var(--nexus-success); box-shadow: 0 0 4px var(--nexus-success-glow); }
.nexus-avatar__status--offline { background: var(--nexus-text-dim); }
.nexus-avatar__status--busy, .nexus-avatar__status--dnd { background: var(--nexus-danger); box-shadow: 0 0 4px var(--nexus-danger-glow); }
.nexus-avatar__status--away { background: var(--nexus-warning); box-shadow: 0 0 4px var(--nexus-warning-glow); }

/* ── Size variants ── */
.nexus-avatar--xs { width: 24px; height: 24px; border-width: 1.5px; }
.nexus-avatar--xs .nexus-avatar__initials { font-size: 9px; }
.nexus-avatar--xs .nexus-avatar__status { width: 7px; height: 7px; border-width: 1.5px; }

.nexus-avatar--sm { width: 32px; height: 32px; }
.nexus-avatar--sm .nexus-avatar__initials { font-size: 11px; }
.nexus-avatar--sm .nexus-avatar__status { width: 8px; height: 8px; }

.nexus-avatar--md { width: 40px; height: 40px; }

.nexus-avatar--lg { width: 56px; height: 56px; border-width: 2.5px; }
.nexus-avatar--lg .nexus-avatar__initials { font-size: 18px; }
.nexus-avatar--lg .nexus-avatar__status { width: 12px; height: 12px; border-width: 2.5px; }

.nexus-avatar--xl { width: 72px; height: 72px; border-width: 3px; }
.nexus-avatar--xl .nexus-avatar__initials { font-size: 24px; }
.nexus-avatar--xl .nexus-avatar__status { width: 14px; height: 14px; border-width: 3px; }

.nexus-avatar--2xl { width: 96px; height: 96px; border-width: 3px; }
.nexus-avatar--2xl .nexus-avatar__initials { font-size: 32px; }
.nexus-avatar--2xl .nexus-avatar__status { width: 16px; height: 16px; border-width: 3px; }

/* ── Square variant ── */
.nexus-avatar--square { border-radius: var(--nexus-radius); }

/* ── Neon ring ── */
.nexus-avatar--neon {
  border-color: var(--nexus-neon-primary);
  box-shadow: 0 0 12px var(--nexus-neon-glow);
}

/* ── Avatar group ── */
.nexus-avatar-group {
  display: inline-flex;
  align-items: center;
}

.nexus-avatar-group .nexus-avatar {
  margin-left: -10px;
  border-color: var(--nexus-bg);
  transition: transform var(--nexus-transition-fast), z-index 0s;
}

.nexus-avatar-group .nexus-avatar:first-child {
  margin-left: 0;
}

.nexus-avatar-group .nexus-avatar:hover {
  z-index: 1;
  transform: translateY(-3px);
}

.nexus-avatar-group__overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nexus-glass-bg);
  border: 2px solid var(--nexus-bg);
  color: var(--nexus-text-dim);
  font-size: var(--nexus-font-size-xs);
  font-weight: 600;
  margin-left: -10px;
}


/* ==========================================================================
   §12  BADGE
   ========================================================================== */

.nexus-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  background: var(--nexus-neon-primary);
  border-radius: var(--nexus-radius-round);
  white-space: nowrap;
  user-select: none;
}

.nexus-badge--primary { background: var(--nexus-neon-primary); }
.nexus-badge--secondary { background: var(--nexus-neon-secondary); }
.nexus-badge--success { background: var(--nexus-success); color: #000; }
.nexus-badge--warning { background: var(--nexus-warning); color: #000; }
.nexus-badge--danger { background: var(--nexus-danger); }
.nexus-badge--info { background: var(--nexus-info); }

.nexus-badge--dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  min-width: 8px;
}

.nexus-badge--pulse {
  animation: nexus-badge-pulse 2s ease-in-out infinite;
}

@keyframes nexus-badge-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--nexus-neon-glow-soft); }
  50% { opacity: 0.7; box-shadow: 0 0 12px var(--nexus-neon-glow); }
}

.nexus-badge--outline {
  background: transparent;
  border: var(--nexus-border-width) solid var(--nexus-neon-primary);
  color: var(--nexus-neon-primary);
}

.nexus-badge__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 10px;
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity var(--nexus-transition-fast);
}

.nexus-badge__dismiss:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}


/* ==========================================================================
   §13  TAG
   ========================================================================== */

.nexus-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--nexus-space-xs);
  padding: 4px 12px;
  font-size: var(--nexus-font-size-xs);
  font-weight: 500;
  color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.06);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-round);
  white-space: nowrap;
  transition: all var(--nexus-transition);
  user-select: none;
}

.nexus-tag__label { flex: 1; }

.nexus-tag__icon {
  font-size: 12px;
  color: var(--nexus-text-dim);
}

.nexus-tag__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: none;
  border: none;
  color: var(--nexus-text-dim);
  cursor: pointer;
  font-size: 11px;
  border-radius: 50%;
  transition: all var(--nexus-transition-fast);
  margin-right: -4px;
}

.nexus-tag__dismiss:hover {
  background: rgba(255, 0, 64, 0.2);
  color: var(--nexus-neon-primary);
}

/* ── Sizes ── */
.nexus-tag--sm { padding: 2px 8px; font-size: 10px; }
.nexus-tag--md { padding: 6px 16px; font-size: var(--nexus-font-size-sm); }
.nexus-tag--lg { padding: 8px 20px; font-size: var(--nexus-font-size-sm); }

/* ── Color variants ── */
.nexus-tag--primary { color: var(--nexus-neon-primary); background: rgba(255,0,64,0.06); }
.nexus-tag--secondary { color: var(--nexus-neon-secondary); background: rgba(255,32,96,0.06); }
.nexus-tag--success { color: var(--nexus-success); background: rgba(0,255,136,0.06); border-color: rgba(0,255,136,0.15); }
.nexus-tag--warning { color: var(--nexus-warning); background: rgba(255,170,0,0.06); border-color: rgba(255,170,0,0.15); }
.nexus-tag--danger { color: var(--nexus-danger); background: rgba(255,0,64,0.08); border-color: rgba(255,0,64,0.2); }

/* ── Interactive ── */
.nexus-tag--interactive { cursor: pointer; }
.nexus-tag--interactive:hover {
  background: rgba(255, 0, 64, 0.12);
  border-color: var(--nexus-glass-border-hover);
  box-shadow: 0 0 8px var(--nexus-neon-glow-soft);
}

/* ── Tag group ── */
.nexus-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nexus-space-xs);
}


/* ==========================================================================
   §14  TOOLTIP
   ========================================================================== */

.nexus-tooltip {
  position: absolute;
  z-index: var(--nexus-z-tooltip);
  padding: 6px 12px;
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-primary);
  background: rgba(20, 0, 10, 0.92);
  backdrop-filter: blur(var(--nexus-blur));
  -webkit-backdrop-filter: blur(var(--nexus-blur));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-sm);
  box-shadow: var(--nexus-shadow-neon-subtle);
  white-space: nowrap;
  pointer-events: none;
  animation: nexus-tooltip-in 0.15s ease-out;
}

@keyframes nexus-tooltip-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nexus-tooltip__content { line-height: 1.4; }

.nexus-tooltip__arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(20, 0, 10, 0.92);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  transform: rotate(45deg);
}

/* ── Positions ── */
.nexus-tooltip--top .nexus-tooltip__arrow { bottom: -5px; left: 50%; margin-left: -4px; border-top: none; border-left: none; }
.nexus-tooltip--bottom .nexus-tooltip__arrow { top: -5px; left: 50%; margin-left: -4px; border-bottom: none; border-right: none; }
.nexus-tooltip--left .nexus-tooltip__arrow { right: -5px; top: 50%; margin-top: -4px; border-bottom: none; border-left: none; }
.nexus-tooltip--right .nexus-tooltip__arrow { left: -5px; top: 50%; margin-top: -4px; border-top: none; border-right: none; }

/* ── Dark variant ── */
.nexus-tooltip--dark { background: rgba(5, 0, 3, 0.95); }

/* ── Rich (title + description) ── */
.nexus-tooltip--rich {
  max-width: 260px;
  white-space: normal;
  padding: 10px 14px;
}

.nexus-tooltip--rich .nexus-tooltip__title {
  font-weight: 600;
  color: var(--nexus-text-primary);
  margin-bottom: 4px;
}

.nexus-tooltip--rich .nexus-tooltip__description {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-secondary);
  line-height: 1.5;
}


/* ==========================================================================
   §15  POPOVER
   ========================================================================== */

.nexus-popover {
  position: absolute;
  z-index: var(--nexus-z-popover);
  min-width: 220px;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border-hover);
  border-radius: var(--nexus-radius);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  animation: nexus-popover-in 0.2s var(--nexus-transition-spring);
  overflow: hidden;
}

@keyframes nexus-popover-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.nexus-popover__header {
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  font-weight: 600;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-primary);
}

.nexus-popover__body {
  padding: var(--nexus-space-md);
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
}

.nexus-popover__footer {
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: var(--nexus-space-sm);
}

.nexus-popover__arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--nexus-glass-bg-hover);
  border: var(--nexus-border-width) solid var(--nexus-glass-border-hover);
  transform: rotate(45deg);
}

.nexus-popover--top .nexus-popover__arrow { bottom: -6px; left: 50%; margin-left: -5px; border-top: none; border-left: none; }
.nexus-popover--bottom .nexus-popover__arrow { top: -6px; left: 50%; margin-left: -5px; border-bottom: none; border-right: none; }
.nexus-popover--left .nexus-popover__arrow { right: -6px; top: 50%; margin-top: -5px; border-bottom: none; border-left: none; }
.nexus-popover--right .nexus-popover__arrow { left: -6px; top: 50%; margin-top: -5px; border-top: none; border-right: none; }

.nexus-popover--wide { min-width: 320px; max-width: 400px; }


/* ==========================================================================
   §16  DRAWER
   ========================================================================== */

.nexus-drawer {
  position: fixed;
  z-index: var(--nexus-z-modal);
}

.nexus-drawer__overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 0, 3, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: nexus-fade-in 0.2s ease-out;
}

@keyframes nexus-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nexus-drawer__panel {
  position: fixed;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Directions ── */
.nexus-drawer--left .nexus-drawer__panel {
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  border-right: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: 0 var(--nexus-radius-lg) var(--nexus-radius-lg) 0;
  animation: nexus-drawer-slide-left 0.3s var(--nexus-transition-spring);
}

@keyframes nexus-drawer-slide-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.nexus-drawer--right .nexus-drawer__panel {
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  border-left: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-lg) 0 0 var(--nexus-radius-lg);
  animation: nexus-drawer-slide-right 0.3s var(--nexus-transition-spring);
}

@keyframes nexus-drawer-slide-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.nexus-drawer--top .nexus-drawer__panel {
  top: 0;
  left: 0;
  right: 0;
  height: 320px;
  border-bottom: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: 0 0 var(--nexus-radius-lg) var(--nexus-radius-lg);
  animation: nexus-drawer-slide-top 0.3s var(--nexus-transition-spring);
}

@keyframes nexus-drawer-slide-top {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.nexus-drawer--bottom .nexus-drawer__panel {
  bottom: 0;
  left: 0;
  right: 0;
  height: 320px;
  border-top: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-lg) var(--nexus-radius-lg) 0 0;
  animation: nexus-drawer-slide-bottom 0.3s var(--nexus-transition-spring);
}

@keyframes nexus-drawer-slide-bottom {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ── Sizes ── */
.nexus-drawer--sm .nexus-drawer__panel { width: 260px; }
.nexus-drawer--md .nexus-drawer__panel { width: 360px; }
.nexus-drawer--lg .nexus-drawer__panel { width: 480px; }
.nexus-drawer--full .nexus-drawer__panel { width: 100%; height: 100%; border-radius: 0; }

.nexus-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  flex-shrink: 0;
}

.nexus-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--nexus-space-lg);
}

.nexus-drawer__footer {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: var(--nexus-space-sm);
  flex-shrink: 0;
}


/* ==========================================================================
   §17  SHEET
   ========================================================================== */

.nexus-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--nexus-z-modal);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.nexus-sheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 0, 3, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nexus-sheet__panel {
  position: relative;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-bottom: none;
  border-radius: var(--nexus-radius-xl) var(--nexus-radius-xl) 0 0;
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: nexus-sheet-slide-up 0.35s var(--nexus-transition-spring);
}

@keyframes nexus-sheet-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.nexus-sheet__handle {
  display: flex;
  justify-content: center;
  padding: var(--nexus-space-sm) 0;
  cursor: grab;
}

.nexus-sheet__handle::before {
  content: '';
  width: 40px;
  height: 4px;
  background: var(--nexus-text-dim);
  border-radius: var(--nexus-radius-round);
  opacity: 0.5;
}

.nexus-sheet__header {
  padding: var(--nexus-space-sm) var(--nexus-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
}

.nexus-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--nexus-space-lg);
}

/* ── Peek (partially visible) ── */
.nexus-sheet--peek .nexus-sheet__panel {
  max-height: 40vh;
}

/* ── Full height ── */
.nexus-sheet--full .nexus-sheet__panel {
  max-height: 95vh;
  border-radius: var(--nexus-radius-lg) var(--nexus-radius-lg) 0 0;
}


/* ==========================================================================
   §18  TOOLBAR
   ========================================================================== */

.nexus-toolbar {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur-light));
  -webkit-backdrop-filter: blur(var(--nexus-blur-light));
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
}

.nexus-toolbar__group {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-xs);
}

.nexus-toolbar__separator {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent, var(--nexus-glass-border), transparent);
  margin: 0 var(--nexus-space-xs);
}

.nexus-toolbar__spacer {
  flex: 1;
}

.nexus-toolbar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: var(--nexus-border-width) solid transparent;
  border-radius: var(--nexus-radius-sm);
  color: var(--nexus-text-secondary);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  font-size: 14px;
}

.nexus-toolbar__item:hover {
  color: var(--nexus-text-primary);
  background: rgba(255, 0, 64, 0.06);
  border-color: var(--nexus-glass-border);
}

.nexus-toolbar__item--active {
  color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.1);
  border-color: var(--nexus-glass-border-hover);
}

/* ── Dense ── */
.nexus-toolbar--dense {
  padding: var(--nexus-space-xs) var(--nexus-space-sm);
}

.nexus-toolbar--dense .nexus-toolbar__item {
  width: 28px;
  height: 28px;
}

/* ── Floating ── */
.nexus-toolbar--floating {
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  border-radius: var(--nexus-radius-lg);
}

/* ── Responsive ── */
.nexus-toolbar {
  container-type: inline-size;
}

@container (max-width: 400px) {
  .nexus-toolbar__group:not(:first-child):not(:last-child) {
    display: none;
  }
}


/* ==========================================================================
   §19  SIDEBAR
   ========================================================================== */

.nexus-sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  height: 100%;
  background: var(--nexus-glass-bg);
  backdrop-filter: blur(var(--nexus-blur));
  -webkit-backdrop-filter: blur(var(--nexus-blur));
  border-right: var(--nexus-border-width) solid var(--nexus-glass-border);
  overflow: hidden;
  transition: width var(--nexus-transition);
  flex-shrink: 0;
}

.nexus-sidebar__header {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  flex-shrink: 0;
}

.nexus-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--nexus-space-sm);
}

.nexus-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  padding: 8px 12px;
  border-radius: var(--nexus-radius-sm);
  color: var(--nexus-text-secondary);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  font-size: var(--nexus-font-size-sm);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  user-select: none;
}

.nexus-sidebar__item:hover {
  color: var(--nexus-text-primary);
  background: rgba(255, 0, 64, 0.06);
}

.nexus-sidebar__item--active {
  color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.1);
}

.nexus-sidebar__item--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--nexus-neon-primary);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--nexus-neon-glow);
}

.nexus-sidebar__item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--nexus-text-dim);
}

.nexus-sidebar__item--active .nexus-sidebar__item-icon {
  color: var(--nexus-neon-primary);
}

.nexus-sidebar__item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-sidebar__item-badge {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--nexus-neon-primary);
  color: #fff;
  border-radius: var(--nexus-radius-round);
  flex-shrink: 0;
}

/* ── Group ── */
.nexus-sidebar__group {
  margin-top: var(--nexus-space-sm);
}

.nexus-sidebar__group-label {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nexus-text-dim);
  user-select: none;
}

.nexus-sidebar__group-items {
  display: flex;
  flex-direction: column;
  padding-left: var(--nexus-space-sm);
}

/* ── Footer ── */
.nexus-sidebar__footer {
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
  flex-shrink: 0;
}

/* ── Collapsed (icon-only) ── */
.nexus-sidebar--collapsed {
  width: 56px;
}

.nexus-sidebar--collapsed .nexus-sidebar__item-label,
.nexus-sidebar--collapsed .nexus-sidebar__item-badge,
.nexus-sidebar--collapsed .nexus-sidebar__group-label,
.nexus-sidebar--collapsed .nexus-sidebar__group-items {
  display: none;
}

.nexus-sidebar--collapsed .nexus-sidebar__item {
  justify-content: center;
  padding: 10px;
}

.nexus-sidebar--collapsed .nexus-sidebar__header {
  justify-content: center;
}

/* ── Overlay (mobile) ── */
.nexus-sidebar--overlay {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--nexus-z-modal);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-strong);
  animation: nexus-drawer-slide-left 0.3s var(--nexus-transition-spring);
}

/* ── Width variants ── */
.nexus-sidebar--sm { width: 200px; }
.nexus-sidebar--md { width: 260px; }
.nexus-sidebar--lg { width: 320px; }


/* ==========================================================================
   §20  SPLIT VIEW
   ========================================================================== */

.nexus-split-view {
  display: flex;
  height: 100%;
  overflow: hidden;
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
}

.nexus-split-view__panel {
  flex: 1;
  overflow: auto;
  min-width: 0;
  min-height: 0;
}

.nexus-split-view__divider {
  flex-shrink: 0;
  background: var(--nexus-glass-border);
  transition: background var(--nexus-transition-fast);
  position: relative;
  cursor: col-resize;
}

.nexus-split-view--horizontal {
  flex-direction: row;
}

.nexus-split-view--horizontal .nexus-split-view__divider {
  width: 4px;
}

.nexus-split-view--vertical {
  flex-direction: column;
}

.nexus-split-view--vertical .nexus-split-view__divider {
  height: 4px;
  width: 100%;
  cursor: row-resize;
}

.nexus-split-view__divider:hover {
  background: var(--nexus-neon-primary);
  box-shadow: 0 0 8px var(--nexus-neon-glow);
}

.nexus-split-view__divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 20px;
  background: repeating-linear-gradient(
    180deg,
    var(--nexus-text-dim) 0px,
    var(--nexus-text-dim) 2px,
    transparent 2px,
    transparent 5px
  );
  opacity: 0.4;
}


/* ==========================================================================
   §21  FILE DROP
   ========================================================================== */

.nexus-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-2xl) var(--nexus-space-lg);
  background: var(--nexus-glass-bg);
  border: 2px dashed var(--nexus-glass-border);
  border-radius: var(--nexus-radius-lg);
  cursor: pointer;
  transition: all var(--nexus-transition);
  text-align: center;
  min-height: 160px;
}

.nexus-file-drop:hover {
  border-color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.03);
}

.nexus-file-drop__icon {
  font-size: 40px;
  color: var(--nexus-text-dim);
  transition: color var(--nexus-transition);
}

.nexus-file-drop__text {
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
}

.nexus-file-drop__hint {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-dim);
}

/* ── Active (drag-over) ── */
.nexus-file-drop--active {
  border-color: var(--nexus-neon-primary);
  background: rgba(255, 0, 64, 0.08);
  box-shadow: 0 0 20px var(--nexus-neon-glow-soft);
  transform: scale(1.01);
}

.nexus-file-drop--active .nexus-file-drop__icon {
  color: var(--nexus-neon-primary);
}

/* ── States ── */
.nexus-file-drop--error {
  border-color: var(--nexus-danger);
  background: rgba(255, 0, 40, 0.05);
}

.nexus-file-drop--success {
  border-color: var(--nexus-success);
  background: rgba(0, 255, 136, 0.03);
}

.nexus-file-drop--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Preview ── */
.nexus-file-drop__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--nexus-space-sm);
  width: 100%;
  margin-top: var(--nexus-space-md);
}

.nexus-file-drop__file {
  position: relative;
  aspect-ratio: 1;
  background: rgba(20, 0, 10, 0.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-file-drop__file img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nexus-file-drop__file-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: var(--nexus-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  transition: opacity var(--nexus-transition-fast);
}

.nexus-file-drop__file:hover .nexus-file-drop__file-remove {
  opacity: 1;
}


/* ==========================================================================
   §22  COLOR PICKER
   ========================================================================== */

.nexus-color-picker {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-md);
  padding: var(--nexus-space-md);
  background: var(--nexus-glass-bg);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius);
}

.nexus-color-picker__palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.nexus-color-picker__swatch {
  aspect-ratio: 1;
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--nexus-transition-fast);
  min-width: 24px;
}

.nexus-color-picker__swatch:hover {
  transform: scale(1.15);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.nexus-color-picker__swatch--active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.nexus-color-picker__preview {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-md);
}

.nexus-color-picker__preview-swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--nexus-radius-sm);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
}

.nexus-color-picker__input {
  flex: 1;
}

.nexus-color-picker__gradient {
  display: flex;
  gap: var(--nexus-space-xs);
  overflow-x: auto;
  padding-bottom: var(--nexus-space-xs);
}

.nexus-color-picker__gradient-item {
  width: 60px;
  height: 28px;
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  border: var(--nexus-border-width) solid transparent;
  flex-shrink: 0;
  transition: border-color var(--nexus-transition-fast);
}

.nexus-color-picker__gradient-item:hover {
  border-color: var(--nexus-glass-border-hover);
}


/* ==========================================================================
   §23  SLIDER GROUP
   ========================================================================== */

.nexus-slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-xs);
}

.nexus-slider-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexus-slider-group__label {
  font-size: var(--nexus-font-size-sm);
  font-weight: 500;
  color: var(--nexus-text-secondary);
}

.nexus-slider-group__value {
  font-size: var(--nexus-font-size-sm);
  font-family: var(--nexus-font-mono);
  color: var(--nexus-neon-primary);
  min-width: 40px;
  text-align: right;
}

.nexus-slider-group__track {
  position: relative;
}

.nexus-slider-group__marks {
  display: flex;
  justify-content: space-between;
  padding-top: var(--nexus-space-xs);
  font-size: 10px;
  color: var(--nexus-text-dim);
}

/* ── Vertical ── */
.nexus-slider-group--vertical {
  flex-direction: row;
  align-items: center;
  height: 200px;
}

.nexus-slider-group--vertical .nexus-slider-group__track {
  writing-mode: vertical-lr;
  direction: rtl;
  height: 100%;
}


/* ==========================================================================
   §24  METER
   ========================================================================== */

.nexus-meter {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-xs);
}

.nexus-meter__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.nexus-meter__label {
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
}

.nexus-meter__value {
  font-size: var(--nexus-font-size-sm);
  font-family: var(--nexus-font-mono);
  color: var(--nexus-text-primary);
}

.nexus-meter__track {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(20, 0, 10, 0.6);
  border: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
  border-radius: var(--nexus-radius-round);
  overflow: hidden;
}

.nexus-meter__fill {
  height: 100%;
  background: var(--nexus-gradient-neon);
  border-radius: var(--nexus-radius-round);
  box-shadow: 0 0 6px var(--nexus-neon-glow-soft);
  transition: width var(--nexus-transition);
}

/* ── Threshold colors ── */
.nexus-meter--success .nexus-meter__fill { background: var(--nexus-success); box-shadow: 0 0 6px var(--nexus-success-glow); }
.nexus-meter--warning .nexus-meter__fill { background: var(--nexus-warning); box-shadow: 0 0 6px var(--nexus-warning-glow); }
.nexus-meter--danger .nexus-meter__fill { background: var(--nexus-danger); box-shadow: 0 0 6px var(--nexus-danger-glow); }

/* ── Circular meter ── */
.nexus-meter--circular {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nexus-meter--circular .nexus-meter__track {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  background: conic-gradient(
    var(--nexus-neon-primary) var(--meter-percent, 0%),
    rgba(20, 0, 10, 0.6) var(--meter-percent, 0%)
  );
  border-radius: 50%;
  border: none;
}

.nexus-meter--circular .nexus-meter__track::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--nexus-bg);
  border-radius: 50%;
}

/* ── Segmented ── */
.nexus-meter--segmented .nexus-meter__track {
  display: flex;
  gap: 2px;
  background: transparent;
  border: none;
  height: 12px;
}

.nexus-meter--segmented .nexus-meter__fill {
  background: repeating-linear-gradient(
    90deg,
    var(--nexus-neon-primary) 0px,
    var(--nexus-neon-primary) 8px,
    transparent 8px,
    transparent 10px
  );
}


/* ==========================================================================
   §25  TIMELINE
   ========================================================================== */

.nexus-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: var(--nexus-space-xl);
}

.nexus-timeline__item {
  position: relative;
  padding-bottom: var(--nexus-space-lg);
}

.nexus-timeline__item:last-child {
  padding-bottom: 0;
}

/* Vertical line */
.nexus-timeline__connector {
  position: absolute;
  left: calc(var(--nexus-space-xl) * -1 + 7px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--nexus-glass-border), var(--nexus-neon-glow-soft));
}

.nexus-timeline__item:last-child .nexus-timeline__connector {
  display: none;
}

.nexus-timeline__marker {
  position: absolute;
  left: calc(var(--nexus-space-xl) * -1);
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--nexus-bg);
  border: 2px solid var(--nexus-neon-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--nexus-neon-glow-soft);
  z-index: 1;
}

.nexus-timeline__content {
  background: var(--nexus-glass-bg);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-radius: var(--nexus-radius-sm);
  padding: var(--nexus-space-md);
}

.nexus-timeline__time {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-dim);
  font-family: var(--nexus-font-mono);
  margin-bottom: 4px;
}

.nexus-timeline__title {
  font-size: var(--nexus-font-size-sm);
  font-weight: 600;
  color: var(--nexus-text-primary);
  margin-bottom: 4px;
}

.nexus-timeline__description {
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  line-height: 1.5;
}

/* ── Horizontal ── */
.nexus-timeline--horizontal {
  flex-direction: row;
  padding-left: 0;
  padding-top: var(--nexus-space-xl);
  overflow-x: auto;
  gap: var(--nexus-space-md);
}

.nexus-timeline--horizontal .nexus-timeline__connector {
  top: calc(var(--nexus-space-xl) * -1 + 7px);
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, var(--nexus-glass-border), var(--nexus-neon-glow-soft));
}

.nexus-timeline--horizontal .nexus-timeline__marker {
  top: calc(var(--nexus-space-xl) * -1);
  left: 50%;
  transform: translateX(-50%);
}

.nexus-timeline--horizontal .nexus-timeline__item {
  padding-bottom: 0;
  min-width: 200px;
}

/* ── Alternating ── */
.nexus-timeline--alternating .nexus-timeline__item:nth-child(even) {
  padding-left: calc(var(--nexus-space-xl) * 2);
  padding-right: 0;
}

/* ── Compact ── */
.nexus-timeline--compact {
  padding-left: var(--nexus-space-lg);
}

.nexus-timeline--compact .nexus-timeline__item {
  padding-bottom: var(--nexus-space-md);
}

.nexus-timeline--compact .nexus-timeline__content {
  padding: var(--nexus-space-sm);
}


/* ==========================================================================
   §26  STEPPER
   ========================================================================== */

.nexus-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}

.nexus-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.nexus-stepper__step-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--nexus-font-size-sm);
  font-weight: 700;
  background: var(--nexus-glass-bg);
  border: 2px solid var(--nexus-glass-border);
  color: var(--nexus-text-dim);
  transition: all var(--nexus-transition);
  position: relative;
  z-index: 1;
}

/* Connector line */
.nexus-stepper__connector {
  position: absolute;
  top: 18px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--nexus-glass-border);
}

.nexus-stepper__step:last-child .nexus-stepper__connector {
  display: none;
}

/* ── Active step ── */
.nexus-stepper__step--active .nexus-stepper__step-indicator {
  border-color: var(--nexus-neon-primary);
  color: var(--nexus-neon-primary);
  box-shadow: 0 0 12px var(--nexus-neon-glow);
  background: rgba(255, 0, 64, 0.1);
}

/* ── Completed step ── */
.nexus-stepper__step--completed .nexus-stepper__step-indicator {
  border-color: var(--nexus-neon-primary);
  background: var(--nexus-neon-primary);
  color: #fff;
}

.nexus-stepper__step--completed .nexus-stepper__step-indicator::after {
  content: '✓';
  font-size: 14px;
}

.nexus-stepper__step--completed .nexus-stepper__connector {
  background: var(--nexus-neon-primary);
  box-shadow: 0 0 6px var(--nexus-neon-glow-soft);
}

/* ── Error step ── */
.nexus-stepper__step--error .nexus-stepper__step-indicator {
  border-color: var(--nexus-danger);
  color: var(--nexus-danger);
  box-shadow: 0 0 10px var(--nexus-danger-glow);
}

.nexus-stepper__step-label {
  margin-top: var(--nexus-space-sm);
  font-size: var(--nexus-font-size-xs);
  font-weight: 500;
  color: var(--nexus-text-dim);
  text-align: center;
  white-space: nowrap;
}

.nexus-stepper__step--active .nexus-stepper__step-label {
  color: var(--nexus-text-primary);
}

.nexus-stepper__step-description {
  font-size: 10px;
  color: var(--nexus-text-dim);
  text-align: center;
  max-width: 100px;
  margin-top: 2px;
}

/* ── Content ── */
.nexus-stepper__content {
  width: 100%;
  padding: var(--nexus-space-lg);
  margin-top: var(--nexus-space-md);
}

.nexus-stepper__actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--nexus-space-md);
}

/* ── Vertical ── */
.nexus-stepper--vertical {
  flex-direction: column;
  align-items: stretch;
}

.nexus-stepper--vertical .nexus-stepper__step {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--nexus-space-md);
}

.nexus-stepper--vertical .nexus-stepper__connector {
  position: absolute;
  top: 38px;
  left: 17px;
  right: auto;
  width: 2px;
  height: calc(100% - 38px);
}

/* ── Compact ── */
.nexus-stepper--compact .nexus-stepper__step-indicator {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.nexus-stepper--compact .nexus-stepper__step-label {
  display: none;
}


/* ==========================================================================
   §27  SPINNER
   ========================================================================== */

@keyframes nexus-spin {
  to { transform: rotate(360deg); }
}

@keyframes nexus-dots-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes nexus-pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes nexus-bars-scale {
  0%, 40%, 100% { transform: scaleY(0.4); }
  20% { transform: scaleY(1); }
}

.nexus-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

/* ── Ring spinner ── */
.nexus-spinner--ring::before {
  content: '';
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--nexus-neon-primary);
  border-radius: 50%;
  animation: nexus-spin 0.8s linear infinite;
}

/* ── Dots spinner ── */
.nexus-spinner--dots {
  display: inline-flex;
  gap: 6px;
}

.nexus-spinner--dots::before,
.nexus-spinner--dots::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--nexus-neon-primary);
  border-radius: 50%;
  animation: nexus-dots-bounce 1.4s ease-in-out infinite both;
}

.nexus-spinner--dots::before { animation-delay: -0.32s; }
.nexus-spinner--dots::after { animation-delay: 0s; }

/* ── Pulse spinner ── */
.nexus-spinner--pulse::before {
  content: '';
  width: 100%;
  height: 100%;
  background: var(--nexus-neon-primary);
  border-radius: 50%;
  animation: nexus-pulse-ring 1.2s ease-out infinite;
}

/* ── Bars spinner ── */
.nexus-spinner--bars {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.nexus-spinner--bars::before,
.nexus-spinner--bars::after {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--nexus-neon-primary);
  border-radius: 2px;
  animation: nexus-bars-scale 1.2s ease-in-out infinite;
}

.nexus-spinner--bars::before { animation-delay: -0.4s; }

/* ── Sizes ── */
.nexus-spinner--xs { width: 16px; height: 16px; }
.nexus-spinner--xs::before { border-width: 2px; }
.nexus-spinner--sm { width: 24px; height: 24px; }
.nexus-spinner--md { width: 32px; height: 32px; }
.nexus-spinner--lg { width: 48px; height: 48px; }
.nexus-spinner--lg::before { border-width: 4px; }

/* ── Neon colored ── */
.nexus-spinner--neon::before {
  border-top-color: var(--nexus-neon-primary);
  box-shadow: 0 0 8px var(--nexus-neon-glow-soft);
}

/* ── Full page overlay ── */
.nexus-spinner--overlay {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  background: rgba(5, 0, 3, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--nexus-z-max);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-spinner--overlay .nexus-spinner {
  width: 48px;
  height: 48px;
}

/* ── Inline ── */
.nexus-spinner--inline {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 var(--nexus-space-xs);
}


/* ==========================================================================
   §28  SKELETON
   ========================================================================== */

@keyframes nexus-shimmer-sweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.nexus-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: nexus-shimmer-sweep 1.5s ease-in-out infinite;
  border-radius: var(--nexus-radius-sm);
}

.nexus-skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--nexus-space-sm);
}

.nexus-skeleton--heading {
  height: 24px;
  width: 60%;
  margin-bottom: var(--nexus-space-md);
}

.nexus-skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.nexus-skeleton--image {
  width: 100%;
  height: 200px;
  border-radius: var(--nexus-radius);
}

.nexus-skeleton--button {
  height: 36px;
  width: 100px;
  border-radius: var(--nexus-radius-sm);
}

.nexus-skeleton--card {
  height: 200px;
  width: 100%;
  border-radius: var(--nexus-radius);
}

/* ── Individual lines ── */
.nexus-skeleton__line {
  height: 12px;
  border-radius: var(--nexus-radius-sm);
  margin-bottom: var(--nexus-space-xs);
}

.nexus-skeleton__line--w-100 { width: 100%; }
.nexus-skeleton__line--w-90 { width: 90%; }
.nexus-skeleton__line--w-80 { width: 80%; }
.nexus-skeleton__line--w-70 { width: 70%; }
.nexus-skeleton__line--w-60 { width: 60%; }
.nexus-skeleton__line--w-50 { width: 50%; }
.nexus-skeleton__line--w-40 { width: 40%; }
.nexus-skeleton__line--w-30 { width: 30%; }

/* ── Group (pre-built layouts) ── */
.nexus-skeleton-group {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-sm);
}

.nexus-skeleton-group--row {
  flex-direction: row;
  align-items: center;
  gap: var(--nexus-space-md);
}


/* ==========================================================================
   §29  TOAST
   ========================================================================== */

.nexus-toast-container {
  position: fixed;
  z-index: var(--nexus-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-md);
  pointer-events: none;
  max-width: 420px;
}

/* ── Position variants ── */
.nexus-toast-container--bottom-right { bottom: 0; right: 0; }
.nexus-toast-container--bottom-left { bottom: 0; left: 0; }
.nexus-toast-container--top-right { top: 0; right: 0; }
.nexus-toast-container--top-left { top: 0; left: 0; }
.nexus-toast-container--top-center { top: 0; left: 50%; transform: translateX(-50%); }
.nexus-toast-container--bottom-center { bottom: 0; left: 50%; transform: translateX(-50%); }

.nexus-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-md);
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
  border-left: 3px solid var(--nexus-neon-primary);
  border-radius: var(--nexus-radius);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  pointer-events: auto;
  animation: nexus-toast-slide-in-right 0.3s var(--nexus-transition-spring);
  position: relative;
  overflow: hidden;
}

@keyframes nexus-toast-slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.nexus-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: 1px;
}

.nexus-toast__content {
  flex: 1;
  min-width: 0;
}

.nexus-toast__title {
  font-size: var(--nexus-font-size-sm);
  font-weight: 600;
  color: var(--nexus-text-primary);
  margin-bottom: 2px;
}

.nexus-toast__message {
  font-size: var(--nexus-font-size-xs);
  color: var(--nexus-text-secondary);
  line-height: 1.4;
}

.nexus-toast__action {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--nexus-neon-primary);
  font-size: var(--nexus-font-size-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--nexus-radius-sm);
  transition: background var(--nexus-transition-fast);
  white-space: nowrap;
}

.nexus-toast__action:hover {
  background: rgba(255, 0, 64, 0.1);
}

.nexus-toast__dismiss {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--nexus-text-dim);
  cursor: pointer;
  font-size: 14px;
  border-radius: var(--nexus-radius-sm);
  transition: all var(--nexus-transition-fast);
}

.nexus-toast__dismiss:hover {
  color: var(--nexus-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Progress bar (auto-dismiss) ── */
.nexus-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--nexus-neon-primary);
  border-radius: 0 2px 0 0;
  transition: width linear;
  opacity: 0.6;
}

/* ── Status variants ── */
.nexus-toast--success { border-left-color: var(--nexus-success); }
.nexus-toast--success .nexus-toast__icon { color: var(--nexus-success); }

.nexus-toast--warning { border-left-color: var(--nexus-warning); }
.nexus-toast--warning .nexus-toast__icon { color: var(--nexus-warning); }

.nexus-toast--danger { border-left-color: var(--nexus-danger); }
.nexus-toast--danger .nexus-toast__icon { color: var(--nexus-danger); }

.nexus-toast--info { border-left-color: var(--nexus-info); }
.nexus-toast--info .nexus-toast__icon { color: var(--nexus-info); }

/* ── Compact (single line) ── */
.nexus-toast--compact {
  padding: var(--nexus-space-sm) var(--nexus-space-md);
  align-items: center;
}

.nexus-toast--compact .nexus-toast__message {
  margin: 0;
}


/* ==========================================================================
   §30  DIALOG
   ========================================================================== */

.nexus-dialog {
  position: fixed;
  inset: 0;
  z-index: var(--nexus-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nexus-space-lg);
}

.nexus-dialog__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 0, 3, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: nexus-fade-in 0.15s ease-out;
}

.nexus-dialog__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width-thick) solid var(--nexus-glass-border-hover);
  border-radius: var(--nexus-radius-lg);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-strong), var(--nexus-shadow-inset);
  display: flex;
  flex-direction: column;
  animation: nexus-dialog-scale-in 0.25s var(--nexus-transition-spring);
  overflow: hidden;
}

@keyframes nexus-dialog-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.nexus-dialog__header {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-lg);
  border-bottom: var(--nexus-border-width) solid rgba(255, 20, 80, 0.1);
}

.nexus-dialog__title {
  font-family: var(--nexus-font-display, var(--nexus-font-sans));
  font-size: var(--nexus-font-size-lg);
  font-weight: 700;
  color: var(--nexus-text-primary);
  flex: 1;
}

.nexus-dialog__body {
  padding: var(--nexus-space-lg);
  overflow-y: auto;
  flex: 1;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  line-height: 1.6;
}

.nexus-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--nexus-space-sm);
  padding: var(--nexus-space-md) var(--nexus-space-lg);
  border-top: var(--nexus-border-width) solid rgba(255, 20, 80, 0.08);
  background: rgba(0, 0, 0, 0.1);
}

/* ── Alert (single OK) ── */
.nexus-dialog--alert .nexus-dialog__footer {
  justify-content: center;
}

.nexus-dialog__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--nexus-space-md);
  font-size: 28px;
  border-radius: 50%;
  background: rgba(255, 0, 64, 0.08);
  border: var(--nexus-border-width) solid var(--nexus-glass-border);
}

/* ── Confirm ── */
.nexus-dialog--confirm .nexus-dialog__footer {
  justify-content: flex-end;
}

/* ── Prompt (with input) ── */
.nexus-dialog--prompt .nexus-dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--nexus-space-md);
}

/* ── Destructive ── */
.nexus-dialog--destructive .nexus-dialog__icon {
  background: rgba(255, 0, 40, 0.1);
  border-color: var(--nexus-danger);
  color: var(--nexus-danger);
}

.nexus-dialog--destructive .nexus-dialog__footer .btn-primary {
  background: rgba(255, 0, 40, 0.2);
  border-color: var(--nexus-danger);
  color: var(--nexus-danger);
}

/* ── Size variants ── */
.nexus-dialog--narrow .nexus-dialog__panel { max-width: 360px; }
.nexus-dialog--wide .nexus-dialog__panel { max-width: 640px; }

/* ── Fullscreen on mobile ── */
@media (max-width: 640px) {
  .nexus-dialog--fullscreen .nexus-dialog__panel {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100%;
  }
}

/* ── Stacking multiple dialogs ── */
.nexus-dialog + .nexus-dialog {
  z-index: calc(var(--nexus-z-modal) + 10);
}

.nexus-dialog + .nexus-dialog + .nexus-dialog {
  z-index: calc(var(--nexus-z-modal) + 20);
}


/* ==========================================================================
   §31  MENU
   ========================================================================== */

.nexus-menu {
  position: relative;
  display: inline-block;
}

.nexus-menu__trigger {
  cursor: pointer;
}

.nexus-menu__panel {
  position: absolute;
  min-width: 200px;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border-hover);
  border-radius: var(--nexus-radius);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  padding: var(--nexus-space-xs);
  z-index: var(--nexus-z-dropdown);
  animation: nexus-menu-in 0.15s ease-out;
}

@keyframes nexus-menu-in {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.nexus-menu__item {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  padding: 8px 14px;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nexus-menu__item:hover {
  background: rgba(255, 0, 64, 0.08);
  color: var(--nexus-text-primary);
}

.nexus-menu__item-icon {
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-text-dim);
  font-size: 14px;
  flex-shrink: 0;
}

.nexus-menu__item:hover .nexus-menu__item-icon {
  color: var(--nexus-neon-primary);
}

.nexus-menu__item-label {
  flex: 1;
}

.nexus-menu__item-shortcut {
  font-size: var(--nexus-font-size-xs);
  font-family: var(--nexus-font-mono);
  color: var(--nexus-text-dim);
  margin-left: var(--nexus-space-lg);
}

.nexus-menu__item--active {
  background: rgba(255, 0, 64, 0.1);
  color: var(--nexus-neon-primary);
  border-left: 2px solid var(--nexus-neon-primary);
  padding-left: 12px;
}

.nexus-menu__item--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.nexus-menu__item--danger {
  color: var(--nexus-danger);
}

.nexus-menu__item--danger:hover {
  background: rgba(255, 0, 40, 0.1);
  color: var(--nexus-danger);
}

.nexus-menu__separator {
  height: 1px;
  margin: var(--nexus-space-xs) var(--nexus-space-sm);
  background: linear-gradient(90deg, transparent, var(--nexus-glass-border), transparent);
}

.nexus-menu__group {
  display: flex;
  flex-direction: column;
}

.nexus-menu__group-label {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nexus-text-dim);
  user-select: none;
}

/* ── Submenu ── */
.nexus-menu__submenu {
  position: relative;
}

.nexus-menu__submenu-indicator {
  margin-left: auto;
  font-size: 10px;
  color: var(--nexus-text-dim);
}

.nexus-menu__submenu-indicator::before {
  content: '›';
}

.nexus-menu__submenu > .nexus-menu__panel {
  top: 0;
  left: 100%;
  margin-left: 2px;
}


/* ==========================================================================
   §32  CONTEXT MENU
   ========================================================================== */

.nexus-context-menu {
  position: fixed;
  min-width: 180px;
  background: var(--nexus-glass-bg-hover);
  backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--nexus-blur-heavy)) saturate(1.5);
  border: var(--nexus-border-width) solid var(--nexus-glass-border-hover);
  border-radius: var(--nexus-radius);
  box-shadow: var(--nexus-shadow-depth), var(--nexus-shadow-neon-subtle);
  padding: var(--nexus-space-xs);
  z-index: var(--nexus-z-popover);
  animation: nexus-context-in 0.1s ease-out;
}

@keyframes nexus-context-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.nexus-context-menu__item {
  display: flex;
  align-items: center;
  gap: var(--nexus-space-sm);
  padding: 6px 12px;
  font-size: var(--nexus-font-size-sm);
  color: var(--nexus-text-secondary);
  border-radius: var(--nexus-radius-sm);
  cursor: pointer;
  transition: all var(--nexus-transition-fast);
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nexus-context-menu__item:hover {
  background: rgba(255, 0, 64, 0.08);
  color: var(--nexus-text-primary);
}

.nexus-context-menu__item-icon {
  width: 14px;
  font-size: 12px;
  color: var(--nexus-text-dim);
  flex-shrink: 0;
}

.nexus-context-menu__item:hover .nexus-context-menu__item-icon {
  color: var(--nexus-neon-primary);
}

.nexus-context-menu__item-shortcut {
  font-size: var(--nexus-font-size-xs);
  font-family: var(--nexus-font-mono);
  color: var(--nexus-text-dim);
  margin-left: auto;
  padding-left: var(--nexus-space-md);
}

.nexus-context-menu__separator {
  height: 1px;
  margin: var(--nexus-space-xs) var(--nexus-space-sm);
  background: linear-gradient(90deg, transparent, var(--nexus-glass-border), transparent);
}

.nexus-context-menu__group {
  display: flex;
  flex-direction: column;
}

/* ── Nested submenu ── */
.nexus-context-menu--nested {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 2px;
}


/* ==========================================================================
   §33  CONTAINER QUERIES
   ========================================================================== */

@container (max-width: 500px) {
  .nexus-card--horizontal {
    flex-direction: column;
  }
  .nexus-card--horizontal .nexus-card__image {
    width: 100%;
    height: 140px;
  }

  .nexus-sidebar {
    width: 56px;
  }

  .nexus-sidebar .nexus-sidebar__item-label,
  .nexus-sidebar .nexus-sidebar__group-label {
    display: none;
  }
}


/* ==========================================================================
   §34  @MEDIA QUERIES
   ========================================================================== */

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .nexus-toast,
  .nexus-dialog__panel,
  .nexus-drawer__panel,
  .nexus-sheet__panel,
  .nexus-popover,
  .nexus-menu__panel,
  .nexus-context-menu,
  .nexus-tooltip,
  .nexus-spinner::before,
  .nexus-spinner::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive breakpoints ── */
@media (max-width: 768px) {
  .nexus-dialog__panel {
    max-width: 95%;
  }

  .nexus-drawer--left .nexus-drawer__panel,
  .nexus-drawer--right .nexus-drawer__panel {
    width: 85vw;
  }

  .nexus-toast-container {
    left: 0;
    right: 0;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .nexus-stepper {
    flex-direction: column;
    align-items: stretch;
  }

  .nexus-stepper__connector {
    display: none;
  }

  .nexus-table {
    display: block;
    overflow-x: auto;
  }
}

/* ── Print ── */
@media print {
  .nexus-toast,
  .nexus-spinner,
  .nexus-skeleton,
  .nexus-dialog__overlay,
  .nexus-drawer__overlay,
  .nexus-sheet__overlay {
    display: none !important;
  }

  .nexus-card,
  .nexus-table,
  .nexus-dialog__panel {
    background: #fff !important;
    border-color: #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}

} /* end @layer components */
