/* ═══════════════════════════════════════════════
   NX-UI Design System — components.css v2.1.0
   All .nx-* component styles
   rolik migration — hero-stats, filter-row, phase, hint,
           loading, live-dot, id, group-label, chips, search-modal,
           topbar-search, hidden util, chip color variants
   ═══════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: var(--bg-app); color: var(--text); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; /* fixed: scrollbar thumb */ }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── nx-card — Glass карта ── */
.nx-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--sp) * 1.4);
  position: relative;
  transition: transform .2s ease, box-shadow .3s ease, border-color .3s ease;
}

/* ── nx-badge — Status badge ── */
.nx-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 1.2px;
  padding: 3px 8px;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-block;
  width: var(--badge-w);
  white-space: nowrap;
}
.nx-badge[data-status="ok"]   { color: var(--ok);   border-color: rgba(0,255,136,.2);  background: rgba(0,255,136,.04); }
.nx-badge[data-status="warn"] { color: var(--warn); border-color: rgba(255,179,0,.2);  background: rgba(255,179,0,.04); }
.nx-badge[data-status="err"]  { color: var(--err);  border-color: rgba(255,77,77,.2);  background: rgba(255,77,77,.04); }
/* info variant decoupled from --accent. Was: color: var(--accent).
   Now: fixed #e94560 (rose-red) — semantically "active/primary", distinct
   from cyan (--accent) which is used for emphasis. */
.nx-badge[data-status="info"] { color: var(--status-info); border-color: rgba(233,69,96,.3); background: rgba(233,69,96,.06); }
.nx-badge[data-status="todo"] { color: var(--text-3); border-color: var(--border); background: transparent; }
/* cyan = theme-independent fixed cyan for in_progress states.
   Unlike .info (which follows --accent), .cyan is always #00d4ff regardless of theme. */
.nx-badge[data-tone="cyan"] { color: rgb(var(--tone-cyan-rgb)); border-color: rgba(var(--tone-cyan-rgb),.3); background: rgba(var(--tone-cyan-rgb),.06); }

/* ── nx-entry — KV ред ── */
.nx-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px; /* fixed: inner KV-row gap */
  padding: var(--sp);
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: background .15s ease;
}
.nx-entry:last-child { border-bottom: none; }
.nx-entry:hover { background: var(--bg-card-hover); }

.nx-entry-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ── nx-entry-list — group container ── */
.nx-entry-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Section heading family — 3 tiers, largest → smallest ──
   T1 .nx-section-t1 (page-top) › T2 .nx-section-t2 (sub-section, +number) › T3 .nx-section-t3 (micro label) */
.nx-section-t1,
.nx-section-t2 {
  display: flex;
  align-items: baseline;
  gap: 10px; /* fixed: inner section-head gap */
  margin-bottom: var(--section-gap);
  margin-top: var(--section-rhythm);
}
.nx-section-t1:first-child,
.nx-section-t2:first-child { margin-top: 0; }
.nx-section-t1 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.nx-section-t1 .nx-section-title {
  font-size: var(--text-base);
  letter-spacing: 2px;
  color: var(--text);
}
.nx-section-number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 1px;
}
.nx-section-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-2);
}
.nx-section-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
}
/* T3 — micro group-label (smallest), e.g. DIRECT / CHANNELS within a list. No inline. */
.nx-section-t3 {
  font-family: var(--font-mono);
  font-size: calc(9px * var(--app-scale));
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: calc(var(--sp) * 0.5) 0 8px; /* 12px top group-sep, 8px bottom (fixed micro) */
}

/* Page hero — stacked masthead (kicker + title + desc, multi-line). Distinct from
   .nx-section-t1 which is a single-line flex header (title + right-aligned meta).
   Use for page-top intros that span multiple lines. */
.nx-hero {
  display: block;
  margin: 0 0 var(--section-rhythm);
}

/* ── nx-progress — Progress bar ── */
.nx-progress {
  height: 3px; /* fixed: hairline */
  background: var(--border);
  border-radius: 2px; /* fixed: progress-bar corner */
  overflow: hidden;
  margin-top: 8px;
}
.nx-progress-fill {
  height: 100%;
  border-radius: 2px; /* fixed: progress-fill corner */
  transition: width .4s ease;
}

/* ── nx-chip — Tag chip (with color variants v2.1.0) ── */
.nx-chip {
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro */
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-3);
  display: inline-block;
  margin: 2px;
}
.nx-chip[data-status="ok"]   { color: var(--ok);     border-color: rgba(0,255,136,.2); }
.nx-chip[data-status="warn"] { color: var(--warn);   border-color: rgba(255,179,0,.2); }
.nx-chip[data-status="err"]  { color: var(--err);    border-color: rgba(255,77,77,.2); }
.nx-chip[data-status="info"] { color: var(--status-info); border-color: rgba(233,69,96,.3); }
.nx-chip[data-status="todo"] { color: var(--text-3); border-color: var(--border); }

/* ── nx-chips — flex wrapper for chips ── */
.nx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── nx-pill — Compact status (inline) ── */
.nx-pill {
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro */
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-block;
}
.nx-pill[data-status="ok"]   { color: var(--ok);   background: rgba(0,255,136,.08); }
.nx-pill[data-status="warn"] { color: var(--warn); background: rgba(255,179,0,.08); }
.nx-pill[data-status="err"]  { color: var(--err);  background: rgba(255,77,77,.08); }
.nx-pill[data-status="info"] { color: var(--status-info); background: rgba(233,69,96,.06); }

/* ── nx-bento — Bento grid ── */
.nx-bento {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

/* ── Typography helpers ── */
.nx-title {
  font-size: calc(15px * var(--app-scale));
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.2px;
}
.nx-desc {
  font-size: calc(12px * var(--app-scale));
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 4px;
}
/* meta / label / chip text primitives (mono). G1 dedup (value-identical):
   nx-topbar-meta folded here; nx-action-id/-quick-tile-count and
   -hero-greeting/-metric-title promoted from feature files (shared primitives). */
.nx-meta, .nx-topbar-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
}
.nx-deleted {
  color: var(--text-3);
  font-style: italic;
  font-size: var(--text-sm);
}
.nx-caption {
  color: var(--text-3);
  font-size: var(--text-xs);
}
.nx-bold-base {
  font-weight: 600;
  font-size: var(--text-base);
}
.nx-edit-toggle {
  color: var(--text-3);
  font-size: 9px; /* fixed: byte-equal P2.2; tokenize → P3.1 */
  font-style: italic;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  margin: -6px -4px;
}
.nx-action-id, .nx-quick-tile-count {
  font-family: var(--font-mono);
  font-size: calc(11px * var(--app-scale));
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.nx-hero-greeting, .nx-metric-title {
  font-family: var(--font-mono);
  font-size: calc(11px * var(--app-scale));
  letter-spacing: 2px;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ── Card inner layout helpers ── */
.nx-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: calc(var(--vsp) * 0.214);
}
.nx-card-footer {
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════
   v2.1.0 — Rolik migration components
   ═══════════════════════════════════════════════ */

/* ── nx-hero-stats — KPI row ── */
.nx-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: calc(var(--vsp) * 0.429);
}
.nx-stat {
  padding: calc(var(--sp) * 0.833) var(--sp);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nx-stat:last-child { border-right: none; }
.nx-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--text);
}
.nx-stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── nx-filter-row + nx-filter-btn — MOVED to features/filter-row/feature.css
   (feature-bundle migration Step 4, 2026-05-26).
   App opt-in: manifest.features: ["filter-row"]. ── */

/* ── nx-phase — Timeline phase row ── */
.nx-phase {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--sp);
  padding: calc(var(--sp) * 0.833) var(--sp);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  transition: background .15s;
  border-radius: 0;
  align-items: center;
}
.nx-phase:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.nx-phase:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}
.nx-phase:hover { background: var(--bg-card-hover); }
.nx-phase.is-active {
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
}
.nx-phase-number {
  font-family: var(--font-mono);
  font-size: calc(26px * var(--app-scale));
  font-weight: 300;
  color: var(--text-3);
  line-height: 1;
}
.nx-phase.is-active .nx-phase-number { color: var(--accent); }
.nx-phase.is-done .nx-phase-number { color: var(--ok); }
/* .nx-phase-body — folded into the .nx-field primitive (G1 dedup, value-identical) */
.nx-phase-name {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--text);
  font-weight: 500;
}
.nx-phase-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}
.nx-phase-item {
  font-size: calc(12px * var(--app-scale));
  color: var(--text-2);
  line-height: 1.6;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.nx-phase-item.is-done { opacity: .45; }
.nx-phase-links {
  margin-top: 8px;
}

/* ── nx-link-btn — inline action button (accent) ── */
.nx-link-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 2px 8px;
  cursor: pointer;
  margin-right: 4px;
  transition: all .15s;
}
.nx-link-btn:hover {
  background: var(--accent-bg);
}

/* ── nx-hint — Accent info banner ── */
.nx-hint {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-3);
  padding: calc(var(--sp) * 0.417) calc(var(--sp) * 0.583);
  border-left: 2px solid var(--accent-border);
  background: var(--accent-bg);
  margin-bottom: calc(var(--vsp) * 0.429);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.55;
}
.nx-hint strong { color: var(--text-2); }
.nx-hint code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.nx-hint[data-status="warn"] {
  border-left-color: rgba(255,179,0,.4);
  background: rgba(255,179,0,.04);
  color: var(--warn);
}
.nx-hint[data-status="ok"] {
  border-left-color: rgba(0,255,136,.4);
  background: rgba(0,255,136,.04);
}
.nx-hint[data-status="err"] {
  border-left-color: rgba(255,77,77,.4);
  background: rgba(255,77,77,.04);
  color: var(--err);
}

/* ── nx-loading + nxPulse keyframe ── */
.nx-loading {
  /* fixed full-screen overlay — same screen position whether rendered in body
     (pre-shell) or inside .nx-content (post-shell) → no position flicker (#2) */
  position: fixed;
  inset: 0;
  z-index: var(--z-topbar);
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.nx-loading p {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 2px;
  /* no pulse: shell replaces body (index loader → shell loader); an animation
     would restart mid-cycle on the new element = flicker. Static = seamless swap. */
}
@keyframes nxPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── nx-live-dot — Animated status indicator ──
   The glow is FUNCTIONAL (encodes live ok/warn/err status, like presence dots) →
   fx-exempt, stays constant across Effects. */
.nx-live-pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: .5px;
  color: var(--text-2); padding: 5px 10px 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.nx-live-pill:hover { border-color: var(--accent-border); background: var(--bg-card-hover); color: var(--text); }
.nx-live-pill .nx-live-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); flex-shrink: 0; animation: nxLivePulse 2s ease infinite; }
.nx-live-pill .nx-live-pill-caret { opacity: .45; font-size: var(--text-base); margin-left: 1px; transition: opacity .15s ease, transform .15s ease; }
.nx-live-pill:hover .nx-live-pill-caret { opacity: .8; transform: translateX(2px); }
@keyframes nxLivePulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.nx-live-dot {
  width: 8px; /* fixed: micro status dot */
  height: 8px; /* fixed: micro status dot */
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: nxPulse 2s ease-in-out infinite;
  flex-shrink: 0;
  display: inline-block;
}
.nx-live-dot[data-status="warn"] { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.nx-live-dot[data-status="err"]  { background: var(--err);  box-shadow: 0 0 8px var(--err); }

/* ── nx-id — ID prefix for list items ── */
.nx-id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  margin-right: 8px;
  letter-spacing: 1px;
}
.nx-id.key { color: var(--ok); }

/* ── nx-group-label — sub-group header ── */
.nx-group-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: calc(var(--sp) * 0.5) 0 6px;
}

/* ── nx-topbar-search — MOVED to layout.css (topbar-family base ownership,
   modular-realignment Phase 2.3). The topbar shell is always-loaded layout;
   its visual base belongs with .nx-topbar / .nx-topbar-btn in layout.css. The
   mobile icon-only override already lived in layout.css @media — base now sits
   beside it. The shared user-select rule below still lists .nx-topbar-search
   (cross-cutting interaction utility, not topbar base → stays here). ── */

/* ── nx-search-modal — Command palette / search overlay ── */
.nx-search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  background: rgba(5,5,8,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nx-search-modal.is-open { display: flex; }
.nx-search-modal-box {
  width: 100%;
  max-width: 600px; /* fixed: layout modal cap */
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  animation: nxFadeIn .25s cubic-bezier(.16,1,.3,1);
}
.nx-search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px; /* fixed: inner input-wrap gap */
  padding: calc(var(--sp) * 0.667) calc(var(--sp) * 0.833);
  border-bottom: 1px solid var(--border);
}
.nx-search-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: calc(15px * var(--app-scale));
  color: var(--text);
  font-family: var(--font-body);
}
.nx-search-modal-input::placeholder { color: var(--text-3); }
/* leading search icon inside the modal — was unsized (rendered huge); match topbar */
.nx-search-modal-input-wrap svg {
  width: calc(20px * var(--app-scale));
  height: calc(20px * var(--app-scale));
  flex-shrink: 0;
  color: var(--text-3);
}
.nx-sr-item {
  display: flex;
  gap: 14px; /* fixed: inner result-row gap */
  align-items: start;
  padding: calc(var(--sp) * 0.5) calc(var(--sp) * 0.833);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.nx-sr-item:hover { background: var(--accent-bg); }
.nx-sr-item:last-child { border-bottom: none; }
.nx-sr-type {
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro */
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
}
.nx-sr-title {
  font-size: var(--text-base);
  color: var(--text);
  margin: 2px 0;
}
.nx-sr-body {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.nx-search-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 2px 7px;
  cursor: pointer;
  border-radius: calc(var(--radius) * 0.333);
  flex-shrink: 0;
}
.nx-search-empty {
  padding: var(--sp);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* ── search recents (empty-state) — rendered by shell.js renderSearchEmpty();
   the app supplies data via window.<stem>SearchRecents(). ── */
.nx-search-recents {
  padding: calc(var(--sp) * 0.5) calc(var(--sp) * 0.833);
  border-bottom: 1px solid var(--border);
}
.nx-search-recents:last-child { border-bottom: none; }
.nx-recents-label {
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro — matches .nx-sr-type */
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: calc(var(--sp) * 0.5);
}
.nx-recents-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nx-recent-chip {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.nx-recent-chip:hover { background: var(--accent-bg-strong, var(--accent-bg)); border-color: var(--accent-border); color: var(--text); }
.nx-recents-rows { display: flex; flex-direction: column; }
.nx-recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--sp) * 0.417) calc(var(--sp) * 0.25);
  border-radius: calc(var(--radius) * 0.5);
  cursor: pointer;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  transition: background .1s;
}
.nx-recent-row:hover { background: var(--accent-bg); }
.nx-recent-av {
  width: calc(36px * var(--app-scale));
  height: calc(36px * var(--app-scale));
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.nx-recent-av-ph { display: inline-block; }
.nx-recent-meta { min-width: 0; display: flex; flex-direction: column; }
.nx-recent-name {
  font-size: var(--text-base);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nx-recent-handle {
  font-size: var(--text-sm);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── touch polish: side gutters for the modal box + hide the keyboard-only `esc` hint ── */
@media (pointer: coarse) {
  .nx-search-modal { padding-top: 12vh; }
  .nx-search-modal-box { width: calc(100% - 24px); } /* was edge-to-edge on phones */
  .nx-search-kbd { display: none; }
}

/* ── Utilities ── */
.nx-hidden { display: none !important; }
.nx-flex-min { min-width: 0; flex: 1; }

/* ── Shared keyframes ── */
@keyframes nxFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════
   Settings panel (existing — unchanged)
   ═══════════════════════════════════════════════ */

.nx-settings {
  display: flex;
  gap: 6px;
  margin-bottom: calc(var(--vsp) * 0.429);
  flex-wrap: wrap;
}
.nx-settings-grp {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: calc(var(--sp) * 0.667);
}
.nx-settings-label {
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro */
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 6px;
}
.nx-settings-opt {
  padding: 4px 10px; /* fixed: option-chip inner padding */
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
  transition: all .15s ease;
  letter-spacing: .5px;
}
.nx-settings-opt:hover {
  color: var(--text-2);
  border-color: var(--border);
}
.nx-settings-opt.is-on {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

/* .nx-settings-panel slide-out RETIRED in 9.0.0 — Appearance now lives in the
   unified NxDrawer (drawer feature). The drawer's own preview-fade rule is right
   below; the shared form classes (.nx-settings-panel-hint, -group, -options,
   .nx-settings-opt, .nx-swatch, .nx-btn-reset) are KEPT — renderPanelBody()
   still renders them inside the drawer. */
/* Press-and-hold preview also fades the unified drawer (Appearance in NxDrawer) */
body.nx-settings-previewing .nx-drawer-panel,
body.nx-settings-previewing .nx-drawer-backdrop {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Disable text selection + context menu + tap highlight за settings
   buttons (long-press shouldn't trigger text selection или browser context menu
   — interferes с press-and-hold preview UX).
   extended до ВСИЧКИ interactive nx-* elements. Text selection в
   content (.nx-msg-text etc.) запазено. */
.nx-settings-opt,
.nx-swatch,
.nx-btn-reset,
.nx-side-item,
/* topbar user trigger — moved here from the removed user-menu feature (2026-05-31, @deyan: NxUserMenu removed). The topbar avatar button is styled from base now. */
.nx-topbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
  background: none;
  border: 0;
}
.nx-topbar-user:hover { background: var(--bg-card-hover); }
.nx-topbar-user .nx-side-avatar {
  width: calc(28px * var(--app-scale));
  height: calc(28px * var(--app-scale));
  font-size: calc(11px * var(--app-scale));
}

.nx-side-toggle,
.nx-topbar-btn,
.nx-topbar-user,
.nx-topbar-search,
.nx-filter-btn,
.nx-dropdown-trigger,
.nx-dropdown-item,
.nx-composer-mic,
.nx-composer-send,
.nx-profile-card-trigger,
.nx-info-banner-toggle {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Hint text в panel header explaining preview */
.nx-settings-panel-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-style: italic;
  letter-spacing: 0.3px;
  margin-top: 2px;
  width: 100%;
  flex-basis: 100%;
}
/* (legacy .nx-settings-panel overlay + header + close + panel-scoped h3 removed
   in 9.0.0 — the drawer supplies its own head / back / title; no separate overlay.) */

.nx-settings-panel-group {
  margin-bottom: calc(var(--vsp) * 0.357);
}
.nx-settings-panel-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px; /* fixed: micro */
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.nx-settings-panel-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Accent color swatches ── */
.nx-swatch {
  width: calc(28px * var(--app-scale));
  height: calc(28px * var(--app-scale));
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.nx-swatch:hover { transform: scale(1.1); }
.nx-swatch.is-on { border-color: var(--text); }

/* ── Reset button ── */
.nx-btn-reset {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 16px; /* fixed: button inner padding */
  cursor: pointer;
  transition: all .15s;
  margin-top: calc(var(--vsp) * 0.286);
}
.nx-btn-reset:hover { color: var(--text); border-color: var(--border-hover); }

/* ═══════════════════════════════════════════════
   v2.5.4 — visual fixes batch (2026-05-18)
   - Badge overflow handling (long status labels no longer overlap title cell)
   - Sibling card spacing (strikes / standalone card lists)
   - Headless section title style (when nxSec called without num)
   - Settings panel: transparent overlay (no content dim)
   ═══════════════════════════════════════════════ */

/* Badge: graceful overflow when label > --badge-w
   removed ellipsis truncation — long labels now wrap to 2 lines instead
   of cutting off. Keeps max-width for grid alignment but allows vertical growth. */
.nx-badge {
  max-width: var(--badge-w);
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  text-align: center;
}

/* Adjacent cards (not inside bento) get vertical spacing */
.nx-card + .nx-card {
  margin-top: calc(var(--vsp) * .5);
}

/* (legacy .nx-settings-panel-overlay transparent override removed in 9.0.0) */

/* ═══════════════════════════════════════════════
   v2.5.8 — Long pages helpers (REDUCED v2.X.30 audit cleanup)
   Most classes here (nx-anchor*, nx-chip-row*, .nx-chip duplicate) removed —
   were dead code from removed Long Pages feature. Only the filter-hide
   utility .nx-filterable.nx-hidden retained (rolik-data-directs uses it).
   ═══════════════════════════════════════════════ */

/* Section that filters hide */
.nx-filterable.nx-hidden { display: none; }

/* ═══════════════════════════════════════════════
   Floating cog — used when manifest.topbar:false + settings:true.
   shell.js renders this outside the (collapsed) topbar row, fixed top-right.
   ═══════════════════════════════════════════════ */
.nx-floating-cog {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-dropdown);
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.667);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.nx-floating-cog svg {
  width: calc(18px * var(--app-scale));
  height: calc(18px * var(--app-scale));
  flex-shrink: 0;
}
.nx-floating-cog:hover {
  background: var(--bg-3);
  color: var(--text-1);
}
.nx-floating-cog:active {
  transform: scale(0.96);
}

/* ═══════════════════════════════════════════════
   v2.5.9 — Real tabs (replaces nxAnchorBar in long pages)
   Per @deyan: tabs should SWITCH content, not scroll-to-anchor.
   Filter chips replaced by existing .nx-filter-row helper.
   ═══════════════════════════════════════════════ */

.nx-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: calc(var(--vsp) * 0.357);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-wrap: nowrap;            /* #5 — never stack to 2 rows */
  overflow-x: auto;
  overflow-y: hidden;           /* #12 — never scroll/drag vertically */
  touch-action: pan-x;          /* #12 — horizontal pan only on touch */
  overscroll-behavior: none;    /* #4 — don't trigger browser back-swipe */
  scrollbar-width: none;        /* Firefox: hide bar */
  -webkit-overflow-scrolling: touch;
}
.nx-tabs::-webkit-scrollbar { display: none; } /* WebKit: hide bar */
.nx-tab { flex-shrink: 0; }
.nx-tab {
  padding: calc(var(--sp) * 0.5) calc(var(--sp) * 0.833);
  color: var(--text-3);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nx-tab:hover {
  color: var(--text);
}
.nx-tab.is-on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nx-tab-count {
  font-size: calc(10px * var(--app-scale));
  color: var(--text-3);
  background: var(--bg-card);
  padding: 1px 7px;
  border-radius: calc(var(--radius) * 0.667);
}
.nx-tab.is-on .nx-tab-count {
  color: var(--accent);
  background: var(--accent-bg);
}

.nx-tab-panel {
  /* visible by default; hidden via .nx-hidden when tab inactive */
}
.nx-tab-panel.nx-hidden {
  display: none;
}

/* Remove first-card width quirk in bento — auto-fill last row can stretch
   the only card. Force minmax to behave by reducing min width when count low. */
.nx-bento > .nx-card {
  min-width: 0;  /* allow card to shrink to grid track */
}
.nx-bento > .nx-card:only-child {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════
   PRIMITIVES (7.9.0) — centralized media treatments
   Single source of truth so an effect is changed in ONE place instead of
   scattered across feed/profile/thread/lightbox/inline. See docs/PRIMITIVES_AUDIT.md
   ─────────────────────────────────────────────── */

/* .nx-photo — content image (feed tiles, profile photos, chat images).
   The "conversation photo" look: hairline border + soft shadow + radius. */
.nx-photo {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2); /* default/subtle/glass depth — fx-conditioned in effects.css (none=flat, neon=+accent halo) */
  overflow: hidden;
  background: var(--bg-app);
}

/* .nx-avatar — circular avatar (profile, thread, contacts, meta).
   Hairline + soft shadow (the "a1" treatment). Size set by width/height inline
   or via the .nx-avatar-md modifier. (.nx-avatar-sm/-lg archived 2026-06-15,
   unused — see _archived/2026-06-15_g2-avatar-size-modifiers/.) */
.nx-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-1); /* "a1" depth — fx-conditioned in effects.css (none=flat) */
  background: var(--bg-card);
  flex-shrink: 0;
}
.nx-avatar-md { width: 44px; height: 44px; }

/* ── .nx-btn — unified button primitive ──────────────────────────────────────
   Folds .nx-callout-btn (-> primary) and .nx-act-btn (-> secondary), plus the
   lightbox icon button (-> icon, consumer wired later). Variant = body; size /
   tone / width = modifiers -> replaces the scattered inline padding / colour /
   width overrides at call-sites. See PRIMITIVES_AUDIT.md s4.
     [data-variant] primary  · secondary · ghost · icon
     [data-tone]    accent   · danger    · muted        (secondary / ghost swap)
     [data-size=sm] compact step          (2-step scale: default / sm)
     .is-block      full-width block       (width:100%)
     .is-split      label grows, trailing affordance hugs the end
   Legacy classes removed atomically once at 0 refs (MAJOR): .nx-callout-btn was
   removed in P3 cluster 3, .nx-act-btn in cluster 4. ──────────────── */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;                                  /* fixed: micro icon/label gap */
  border: none;
  border-radius: calc(var(--radius) * 0.5);
  font-family: var(--font-mono);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  padding: calc(8px * var(--app-scale)) calc(16px * var(--app-scale));
  font-size: calc(11px * var(--app-scale));
  transition: color .15s, border-color .15s, background .15s, filter .15s;
}
.nx-btn:disabled, .nx-btn[disabled] { opacity: .5; pointer-events: none; }

/* size — compact step (default step is on .nx-btn above) */
.nx-btn[data-size="sm"] {
  padding: calc(7px * var(--app-scale)) calc(14px * var(--app-scale));
  font-size: calc(10px * var(--app-scale));
}

/* width / layout */
.nx-btn.is-block { display: flex; width: 100%; }
.nx-btn.is-split { display: flex; width: 100%; justify-content: space-between; }

/* variant: primary — solid accent CTA (was .nx-callout-btn) */
.nx-btn[data-variant="primary"] {
  background: var(--accent);
  color: var(--fg-on-light);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nx-btn[data-variant="primary"]:hover { filter: brightness(1.15); }

/* variant: secondary — quiet bordered outline (was .nx-act-btn) */
.nx-btn[data-variant="secondary"] {
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.6);
  letter-spacing: .5px;
}
@media (hover: hover) {
  .nx-btn[data-variant="secondary"]:hover { background: var(--bg-card-hover); color: var(--text); }
}

/* variant: ghost — transparent until hover (no border, quiet) */
.nx-btn[data-variant="ghost"] {
  background: transparent;
  color: var(--text-2);
  letter-spacing: .5px;
}
@media (hover: hover) {
  .nx-btn[data-variant="ghost"]:hover { background: var(--bg-card); color: var(--text); }
}

/* variant: icon — square icon affordance (lightbox etc.; consumer wired later) */
.nx-btn[data-variant="icon"] {
  padding: calc(8px * var(--app-scale));
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
}
@media (hover: hover) {
  .nx-btn[data-variant="icon"]:hover { background: var(--bg-card-hover); color: var(--text); }
}

/* tone — colour swap for secondary / ghost (after variants => wins at equal specificity) */
.nx-btn[data-tone="accent"], .nx-btn[data-tone="accent"]:hover { color: var(--accent); border-color: var(--accent-border); }
.nx-btn[data-tone="danger"], .nx-btn[data-tone="danger"]:hover { color: #e07a7a; border-color: rgba(224, 122, 122, .35); }
.nx-btn[data-tone="muted"] { color: var(--text-3); }

/* ── .nx-icon — inline icon box that scales an inner <svg> with App Size.
   Use around raw SVGs (width/height attrs) so the glyph tracks --app-scale
   instead of staying at its hardcoded attribute size. ── */
.nx-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: calc(20px * var(--app-scale)); height: calc(20px * var(--app-scale)); }
.nx-icon svg { width: 100%; height: 100%; display: block; }
.nx-icon-lg { width: calc(24px * var(--app-scale)); height: calc(24px * var(--app-scale)); }

/* ── nx-form — basic form fields (label + input/textarea). Used by edit-profile etc. ── */
.nx-field, .nx-phase-body { display: flex; flex-direction: column; gap: 6px; }
.nx-label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.nx-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.667);
  color: var(--text); font-family: var(--font); font-size: var(--text-base);
  padding: 10px 12px; transition: border-color .15s ease;
}
.nx-input:focus { outline: none; border-color: var(--accent-border); }
textarea.nx-input { resize: vertical; min-height: 64px; line-height: 1.5; }
/* keep autofilled inputs on the dark theme (Chrome/WebKit paint them white otherwise) */
.nx-input:-webkit-autofill,
.nx-input:-webkit-autofill:hover,
.nx-input:-webkit-autofill:focus,
.nx-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset;
  caret-color: var(--text);
  border-color: var(--border);
  transition: background-color 9999s ease 0s;
}
