/* ═══ dropdown.css ═══ */
/* DROPDOWN */
.nx-select {
  --_line: var(--color-line);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  width: 100%;
  font-family: var(--font-sans);
}
.nx-select__wrap {
  position: relative;
}

/* pigułka 48 px na jasnoszarym tle — sygnał „to się otwiera”; obrys nie zabiera miejsca */
.nx-select__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  width: 100%;
  height: var(--size-control);
  box-sizing: border-box;
  /* chevron jak w każdym menu (przycisk konta): 16 px, 16 od prawej krawędzi */
  padding: var(--spacing-8) var(--spacing-16) var(--spacing-8) var(--spacing-24);
  border: 0;
  border-radius: var(--radius-full); corner-shape: round;
  box-shadow: inset 0 0 0 1px var(--_line);
  background: var(--color-surface-subtle);
  color: var(--color-fg);
  font: inherit;
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  text-align: left;
  cursor: pointer;
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-select__control:focus {
  outline: none;
}
.nx-select__text {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--spacing-4);
  min-width: 0;
}
.nx-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx-select__value.is-placeholder {
  color: var(--color-fg-muted);
}
.nx-select__required {
  color: var(--color-fg-accent);
}
.nx-select__chevron,
.nx-select__error-icon {
  display: flex;
  flex: none;
}
.nx-select__chevron {
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
  transition: transform 200ms ease-out;
}
.nx-select__error-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-icon-accent);
}

/* Focus / Otwarty: obrys fokus, tekst T2 Bold (tło już szare) */
.nx-select__control:focus-visible,
.nx-select.is-focus .nx-select__control,
.nx-select.is-open .nx-select__control {
  --_line: var(--color-line-focus);
}
.nx-select__control:focus-visible .nx-select__value,
.nx-select.is-focus .nx-select__value,
.nx-select.is-open .nx-select__value {
  color: var(--color-fg);
  font-weight: var(--font-weight-bold);
}
.nx-select.is-open .nx-select__chevron {
  transform: rotate(180deg);
}
/* pierścień dwutonowy tylko w Focus — w Otwarty fokus pokazuje lista (pierścień nachodziłby na nią) */
.nx-select:not(.is-open):not(.is-disabled) .nx-select__control:focus-visible,
.nx-select.is-focus:not(.is-open) .nx-select__control {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-select:not(.is-open):not(.is-disabled) .nx-select__control:focus-visible::after,
.nx-select.is-focus:not(.is-open) .nx-select__control::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: var(--radius-full); corner-shape: round;
  pointer-events: none;
}

/* Lista: 4 px pod polem, na szerokość pola, nad treścią strony. Dwie warstwy: panel (.nx-select__list – ramka,
   tło, padding 8, promień 24) i w nim pozycje (.nx-select__opcje). Przewija się tylko wewnętrzna – pozycje chowają
   się na krawędzi paddingu, nie wjeżdżają pod ramkę */
.nx-select__list {
  position: absolute;
  top: calc(100% + var(--spacing-4));
  left: 0;
  right: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0;
  padding: var(--spacing-8);
  border-radius: var(--radius-24);
  box-shadow: inset 0 0 0 1px var(--color-line), var(--shadow-floating);
  background: var(--color-surface);
}
.nx-select.is-open .nx-select__list {
  display: flex;
}
.nx-select__opcje {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-16); /* promień panelu 24 − padding 8 */
  list-style: none;
}
.nx-select__opcje:focus { outline: none; } /* fokus zostaje na polu (aria-activedescendant) */
/* ponad 5 pozycji: panel maks. 240 px (5 widocznych); panel bez prawego paddingu – rynna paska 16 px:
   pasek 4 px, 7 px od pozycji, 5 px od krawędzi */
.nx-select__list--scroll {
  max-height: 15rem;
  padding-right: 0;
}
.nx-select__list--scroll .nx-select__opcje {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Firefox nie zna ::-webkit-scrollbar — tylko kolory. W Chrome scrollbar-color wyłączyłoby pigułkę 4 px */
@supports (-moz-appearance: none) {
  .nx-select__list--scroll .nx-select__opcje {
    scrollbar-width: thin;
    scrollbar-color: var(--color-line) var(--color-scrollbar-track);
  }
}
.nx-select__list--scroll .nx-select__opcje::-webkit-scrollbar {
  width: 1rem;
}
.nx-select__list--scroll .nx-select__opcje::-webkit-scrollbar-track {
  margin: var(--spacing-16) 0; /* tor zaczyna się i kończy tam, gdzie zaokrąglenie panelu (24 − padding 8) */
  border: 5px solid transparent;
  border-left-width: 7px;
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--color-scrollbar-track) padding-box;
}
.nx-select__list--scroll .nx-select__opcje::-webkit-scrollbar-thumb {
  border: 5px solid transparent;
  border-left-width: 7px;
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--color-line) padding-box;
}

/* Pozycja 48 px: hover / aktywna z klawiatury = tło jasnoszare; wybrana + Bold + ptaszek */
.nx-select__option {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--spacing-8);
  height: var(--size-control);
  box-sizing: border-box;
  padding: var(--spacing-12) var(--spacing-24);
  border-radius: var(--radius-16); /* promień panelu 24 − padding 8 */
  color: var(--color-fg);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  cursor: pointer;
  transition: background-color 200ms ease-out;
}
.nx-select__option-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx-select__option svg {
  display: none;
  flex: none;
  color: var(--color-icon-accent);
}
.nx-select__option:hover,
.nx-select__option.is-active,
.nx-select__option.is-selected {
  background: var(--color-surface-subtle);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-select__option.is-selected {
  font-weight: var(--font-weight-bold);
}
.nx-select__option.is-selected svg {
  display: block;
}

/* Błąd: obrys, treść i ikona akcent, bez tła + komunikat */
.nx-select--error .nx-select__control {
  --_line: var(--color-line-error);
  background: none;
}
.nx-select--error .nx-select__value,
.nx-select--error .nx-select__value.is-placeholder {
  color: var(--color-fg-accent);
}
.nx-select__message {
  margin: 0;
  color: var(--color-fg-accent);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Wyłączony */
.nx-select.is-disabled .nx-select__control {
  --_line: var(--color-line-subtle);
  cursor: not-allowed;
}
.nx-select.is-disabled .nx-select__value {
  color: var(--color-fg-on-dark-muted);
}
.nx-select.is-disabled .nx-select__chevron {
  color: var(--color-icon-disabled);
}


/* ═══ etykieta-pola.css ═══ */
/* ETYKIETA POLA */
.nx-field-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-8);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
}
.nx-field-label__text {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-4);
}
.nx-field-label__required {
  color: var(--color-fg-accent);
}
.nx-field-label__optional {
  color: var(--color-fg-muted);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Rozmiar Mały: T1 (przy SWITCHER Mały) */
.nx-field-label--small {
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Ikona podpowiedzi — w Wyłączony gaśnie razem z etykietą */
.nx-field-label__hint {
  position: relative;
  display: flex;
}
.nx-field-label__info {
  position: relative;
  display: flex;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full); corner-shape: round;
  background: none;
  color: var(--color-icon-muted);
  cursor: help;
  transition: color 200ms ease-out;
}
/* Hover: ikona ciemnieje (ikona/podstawowa) */
.nx-field-label__hint:hover .nx-field-label__info,
.nx-field-label__hint.is-hover .nx-field-label__info {
  color: var(--color-icon);
}
.nx-field-label__info:focus {
  outline: none;
}
/* Focus z klawiatury: pierścień dwutonowy jak w pozostałych komponentach */
.nx-field-label__info:focus-visible,
.nx-field-label__hint.is-focus .nx-field-label__info {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-field-label__info:focus-visible::after,
.nx-field-label__hint.is-focus .nx-field-label__info::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

/* dymek 4 px nad ikoną, strzałka (32 px od lewej) nad środkiem ikony */
.nx-field-label__hint > .nx-tooltip {
  position: absolute;
  bottom: calc(100% + var(--spacing-4));
  left: calc(50% - 2rem);
  z-index: 2;
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms ease-out, visibility 0s linear 200ms;
}
/* hover po 300 ms; dymek leży w obszarze hovera, więc nie znika przy przejściu na niego */
.nx-field-label__hint:hover > .nx-tooltip {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms ease-out 300ms, visibility 0s linear 300ms;
}
.nx-field-label__hint:has(:focus-visible) > .nx-tooltip,
.nx-field-label__hint.is-hover > .nx-tooltip,
.nx-field-label__hint.is-focus > .nx-tooltip {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms ease-out;
}
.nx-field-label__hint.is-dismissed > .nx-tooltip {
  visibility: hidden;
  opacity: 0;
}

/* Wyłączony: nazwa, gwiazdka i dopisek gasną */
.nx-field-label.is-disabled .nx-field-label__text,
.nx-field-label.is-disabled .nx-field-label__required,
.nx-field-label.is-disabled .nx-field-label__optional {
  color: var(--color-fg-on-dark-muted);
}
.nx-field-label.is-disabled .nx-field-label__info {
  color: var(--color-icon-disabled);
  cursor: default;
}

/* Tło Ciemne: gwiazdka biała, nie akcent — akcent na czerni może nie mieć 4,5 dla drobnego tekstu */
.nx-field-label--dark,
.nx-field-label--dark .nx-field-label__required {
  color: var(--color-fg-on-dark);
}
.nx-field-label--dark .nx-field-label__optional {
  color: var(--color-fg-on-dark-muted);
}
.nx-field-label--dark .nx-field-label__info {
  color: var(--color-icon-on-dark-muted);
}
.nx-field-label--dark .nx-field-label__hint:hover .nx-field-label__info,
.nx-field-label--dark .nx-field-label__hint.is-hover .nx-field-label__info {
  color: var(--color-icon-on-dark);
}
.nx-field-label--dark.is-disabled .nx-field-label__text,
.nx-field-label--dark.is-disabled .nx-field-label__required,
.nx-field-label--dark.is-disabled .nx-field-label__optional {
  color: var(--color-fg-muted);
}
.nx-field-label--dark.is-disabled .nx-field-label__info {
  color: var(--color-icon-muted);
}

/* Tryb Mobile: ikona podpowiedzi 20 px z celem dotyku 44×44 (niewidoczne powiększenie) */
[data-scale='mobile'] .nx-field-label__info::before {
  content: '';
  position: absolute;
  inset: -0.75rem;
}


/* ═══ tooltip.css ═══ */
/* TOOLTIP */
.nx-tooltip {
  --_bg: var(--color-surface-dark);
  --_fg: var(--color-fg-on-dark);
  display: inline-flex;
  flex-direction: column;
  width: max-content;
  max-width: 17.5rem;
  min-width: 4rem;
}
.nx-tooltip--light {
  --_bg: var(--color-surface);
  --_fg: var(--color-fg);
}

.nx-tooltip__bubble {
  padding: var(--spacing-12) var(--spacing-16);
  border-radius: var(--radius-24);
  background: var(--_bg);
  /* cień/pływający na samym dymku. Nie filter: drop-shadow na całym komponencie — filtr razem z przejściem
     krycia (pokazywanie dymka) dawał w Chrome na macOS prostokątną plamę wokół dymka, ucięty cień i „ducha”
     zostającego po zniknięciu (zgłoszenie użytkownika 2026-10-28). Strzałka 16×8 bez cienia — przy rozmyciu 24
     i kryciu 15 % różnica niewidoczna. */
  box-shadow: var(--shadow-floating);
  color: var(--_fg);
  font-family: var(--font-sans);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* trójkąt 16×8, środek 32 px od krawędzi dymka, nachodzi na dymek 1 px */
.nx-tooltip__arrow {
  display: flex;
  height: 0.5rem;
  margin-top: -1px;
  padding: 0 var(--spacing-24);
  color: var(--_bg);
}
.nx-tooltip--arrow-top .nx-tooltip__arrow {
  margin-top: 0;
  margin-bottom: -1px;
}
.nx-tooltip--arrow-right .nx-tooltip__arrow {
  justify-content: flex-end;
}
.nx-tooltip--light .nx-tooltip__bubble {
  box-shadow: var(--shadow-floating-strong);
}


/* ═══ switcher.css ═══ */
/* SWITCHER */
.nx-switcher {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  width: 100%;
  font-family: var(--font-sans);
}
/* Mały: etykieta obok, pigułka 260 px */
.nx-switcher--sm {
  flex-direction: row;
  align-items: center;
  width: auto;
}
/* Mały ma szerokość z treści (HUG) — etykieta obok pigułki się nie zwija */
.nx-switcher--sm > .nx-field-label {
  flex: none;
  white-space: nowrap;
}

/* kontener: 48 / 40 px; obrys rysowany cieniem wewnętrznym — nie zabiera miejsca
   (strokesIncludedInLayout = false), więc segmenty mają dokładnie szerokość z pliku */
.nx-switcher__control {
  --_pad: var(--spacing-8);
  --_gap: var(--spacing-8);
  --_n: 2;
  --_i: 0;
  --_line: var(--color-line);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--_gap);
  height: var(--size-control);
  box-sizing: border-box;
  padding: var(--_pad);
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--color-surface-subtle);
  box-shadow: inset 0 0 0 1px var(--_line);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-switcher--sm .nx-switcher__control {
  --_pad: var(--spacing-4);
  flex: none;
  width: 16rem;
  height: var(--size-control-sm);
}
/* liczba segmentów i indeks wybranego — z samego HTML, bez JS */
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(3)) {
  --_n: 3;
}
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(2) :checked) {
  --_i: 1;
}
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(3) :checked) {
  --_i: 2;
}
/* 4–5 segmentów — szerokości podglądu */
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(4)) {
  --_n: 4;
}
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(5)) {
  --_n: 5;
}
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(4) :checked) {
  --_i: 3;
}
.nx-switcher__control:has(> .nx-switcher__segment:nth-of-type(5) :checked) {
  --_i: 4;
}

/* Pigułka wyboru: jedna warstwa nad segmentami, przycięta do kształtu pigułki (clip-path).
   Niesie białe kopie etykiet w tym samym układzie co segmenty — w każdej klatce przepływu tekst
   pod pigułką jest biały, poza nią grafitowy. Krawędzie (--_l, --_r) animują się osobno. */
@property --_l {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 0px;
}
@property --_r {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 0px;
}
.nx-switcher__indicator {
  --_w: calc((100% - 2 * var(--_pad) - (var(--_n) - 1) * var(--_gap)) / var(--_n));
  --_l: calc(var(--_pad) + var(--_i) * (var(--_w) + var(--_gap)));
  --_r: calc(var(--_pad) + (var(--_n) - 1 - var(--_i)) * (var(--_w) + var(--_gap)));
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--_gap);
  padding: var(--_pad);
  border-radius: inherit; corner-shape: inherit;
  background: var(--color-surface-accent);
  color: var(--color-fg-on-accent);
  clip-path: inset(var(--_pad) var(--_r) var(--_pad) var(--_l) round var(--radius-full));
  opacity: 0;
  pointer-events: none;
  transition: --_l 400ms var(--ease-brand), --_r 400ms var(--ease-brand), opacity 200ms ease-out;
}
.nx-switcher__indicator-text {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 var(--spacing-16);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  white-space: nowrap;
}
.nx-switcher__control:has(:checked) .nx-switcher__indicator {
  opacity: 1;
}
/* przepływ: krawędź prowadząca rusza pierwsza, tylna dochodzi 120 ms później — pigułka się
   wyciąga w stronę nowej opcji i dopiero potem kurczy (kierunek ustawia mount() w data-dir) */
.nx-switcher__control[data-dir='fwd'] .nx-switcher__indicator {
  transition: --_r 380ms var(--ease-brand), --_l 380ms var(--ease-brand) 120ms, opacity 200ms ease-out;
}
.nx-switcher__control[data-dir='back'] .nx-switcher__indicator {
  transition: --_l 380ms var(--ease-brand), --_r 380ms var(--ease-brand) 120ms, opacity 200ms ease-out;
}
/* z „Brak” (nic nie wybrane) pigułka pojawia się w miejscu, bez przelotu od pierwszej opcji */
.nx-switcher__control[data-dir='none'] .nx-switcher__indicator {
  transition: opacity 200ms ease-out;
}

/* segment: rozmiar to wyłącznie padding — tekst T2 w obu rozmiarach */
.nx-switcher__segment {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 2rem;
  box-sizing: border-box;
  padding: var(--spacing-4) var(--spacing-16);
  border-radius: var(--radius-full); corner-shape: round;
  color: var(--color-fg-muted);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  white-space: nowrap;
  cursor: pointer;
  /* hover: 0,2 s jak ON_HOVER w prototypie */
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nx-switcher--sm .nx-switcher__segment {
  height: var(--spacing-32); /* 40 − 2 × 4 */
  padding: var(--spacing-4) var(--spacing-16);
}
.nx-switcher__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* Hover nieaktywnego segmentu: szara pigułka, tekst czarny (grafit na szarym = 4,26) */
.nx-switcher__segment:hover,
.nx-switcher__segment.is-hover {
  background: var(--color-surface-segment-hover);
  color: var(--color-fg);
}

/* Wybrany segment: tło i biały tekst daje warstwa pigułki nad nim; bez hovera */
.nx-switcher__segment:has(:checked) {
  background: none;
  cursor: default;
}

/* Focus z klawiatury: pierścień na całej pigułce (grupa radio = jedno miejsce fokusu) */
.nx-switcher__control:has(:focus-visible),
.nx-switcher.is-focus .nx-switcher__control {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-switcher__control:has(:focus-visible)::after,
.nx-switcher.is-focus .nx-switcher__control::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

/* Błąd: obrys + komunikat pod pigułką */
.nx-switcher--error .nx-switcher__control {
  --_line: var(--color-line-error);
}
.nx-switcher__message {
  margin: 0;
  color: var(--color-fg-accent);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Wyłączony: obrys i segmenty gasną, pigułka wyboru Grafit Light, bez interakcji */
.nx-switcher.is-disabled .nx-switcher__control {
  --_line: var(--color-line-subtle);
}
.nx-switcher.is-disabled .nx-switcher__indicator {
  background: var(--color-surface-disabled);
  color: var(--color-fg-on-dark);
}
.nx-switcher.is-disabled .nx-switcher__segment,
.nx-switcher.is-disabled .nx-switcher__segment:hover {
  background: none;
  color: var(--color-fg-on-dark-muted);
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .nx-switcher__indicator,
  .nx-switcher__segment {
    transition: none !important;
  }
}

/* Tryb Mobile (SWITCHER): kontener 56 (padding 8), segmenty równe, min. 40 — cel dotyku;
   na całą szerokość pola. Podpowiedź zostaje w etykiecie (cel dotyku powiększony w ETYKIECIE POLA) —
   osobny cel 44×44 obok pigułki. */
[data-scale='mobile'] .nx-switcher__control {
  --_pad: var(--spacing-4);
  height: 3.5rem; /* 56 = 48 + 2 × 4 */
}
[data-scale='mobile'] .nx-switcher__segment {
  height: var(--size-control); /* 48 */
  padding: var(--spacing-8) var(--spacing-24);
}
[data-scale='mobile'] .nx-switcher__indicator-text {
  padding: 0 var(--spacing-24);
}


/* ═══ przelacznik.css ═══ */
/* PRZEŁĄCZNIK — tylko w kodzie (ruch i proporcje wg „Liquid toggle”, bencho.dev; kolory marki z tokenów) */
.nx-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-8);
  font-family: var(--font-sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nx-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* tor 48 × 24 (2:1), odstęp 4 ze wszystkich stron, kulka = wysokość toru − 2 × odstęp (16) */
.nx-toggle__track {
  --_pad: var(--spacing-4);
  --_h: 1.5rem;
  --_knob: calc(var(--_h) - 2 * var(--_pad));
  position: relative;
  flex: none;
  width: var(--size-control);
  height: var(--_h);
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--color-surface-subtle);
  /* obrys/subtelny — wyłączony tor widoczny na bieli; cieniem wewnętrznym, nie zabiera miejsca (jak w SWITCHER) */
  box-shadow: inset 0 0 0 1px var(--color-line-subtle);
  transition: background-color 450ms var(--ease-brand), box-shadow 450ms var(--ease-brand);
}
.nx-toggle__knob {
  position: absolute;
  top: var(--_pad);
  left: var(--_pad);
  width: var(--_knob);
  height: var(--_knob);
  transition: transform 450ms var(--ease-brand);
}
.nx-toggle__drop {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--color-surface-neutral);
  transition: background-color 450ms var(--ease-brand);
}

/* włączony: tor w kolorze akcentu, kulka biała po prawej — 4,68; bez obrysu */
.nx-toggle__input:checked + .nx-toggle__track {
  background: var(--color-surface-accent);
  box-shadow: none;
}
.nx-toggle__input:checked + .nx-toggle__track .nx-toggle__knob {
  transform: translateX(calc(3rem - 2 * var(--_pad) - var(--_knob)));
}
.nx-toggle__input:checked + .nx-toggle__track .nx-toggle__drop {
  background: var(--color-surface);
}

/* kropla: rozciąga się w stronę ruchu i sprężyście wraca */
.nx-toggle.is-stretching .nx-toggle__drop {
  animation: nx-toggle-kropla 550ms var(--ease-brand);
}
.nx-toggle[data-dir='fwd'] .nx-toggle__drop {
  transform-origin: left center;
}
.nx-toggle[data-dir='back'] .nx-toggle__drop {
  transform-origin: right center;
}
@keyframes nx-toggle-kropla {
  30% { transform: scale(1.36, 0.86); }
  60% { transform: scale(0.95, 1.04); }
  80% { transform: scale(1.02, 0.99); }
}

/* hover: ciemniejsza kulka (wyłączony) / ciemniejsza akcent toru (włączony) */
.nx-toggle:hover .nx-toggle__drop,
.nx-toggle.is-hover .nx-toggle__drop {
  background: var(--color-surface-neutral-hover);
}
.nx-toggle:hover .nx-toggle__input:checked + .nx-toggle__track,
.nx-toggle.is-hover .nx-toggle__input:checked + .nx-toggle__track {
  background: var(--color-surface-accent-hover);
}
.nx-toggle:hover .nx-toggle__input:checked + .nx-toggle__track .nx-toggle__drop,
.nx-toggle.is-hover .nx-toggle__input:checked + .nx-toggle__track .nx-toggle__drop {
  background: var(--color-surface);
}

/* focus z klawiatury: pierścień dwutonowy jak we wszystkich komponentach */
.nx-toggle__input:focus-visible + .nx-toggle__track,
.nx-toggle.is-focus .nx-toggle__track {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-toggle__input:focus-visible + .nx-toggle__track::after,
.nx-toggle.is-focus .nx-toggle__track::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

.nx-toggle--etykieta-lewa .nx-toggle__label {
  order: -1;
}
.nx-toggle__label {
  color: var(--color-fg);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
}

/* wyłączony: tor i kulka gasną, bez interakcji */
.nx-toggle.is-disabled {
  cursor: default;
  pointer-events: none;
}
.nx-toggle.is-disabled .nx-toggle__drop {
  background: var(--color-surface-disabled);
}
.nx-toggle.is-disabled .nx-toggle__input:checked + .nx-toggle__track {
  background: var(--color-surface-disabled);
}
.nx-toggle.is-disabled .nx-toggle__input:checked + .nx-toggle__track .nx-toggle__drop {
  background: var(--color-surface);
}
.nx-toggle.is-disabled .nx-toggle__label {
  color: var(--color-fg-muted);
}

@media (prefers-reduced-motion: reduce) {
  .nx-toggle.is-stretching .nx-toggle__drop {
    animation: none;
  }
  .nx-toggle__knob {
    transition-duration: 1ms;
  }
}


/* ═══ checkbox.css ═══ */
/* CHECKBOX. Kółko 20 px (rozmiar/kontrolka-wyboru), ptaszek zamiast kropki (RADIO) */
.nx-checkbox {
  position: relative;
  display: inline-flex;
  flex: none;
  width: var(--size-choice);
  height: var(--size-choice);
}
/* natywny input leży na kółku — klik, Spacja i Tab działają bez skryptu */
.nx-checkbox__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  /* bez wyglądu systemowego — Safari rysuje natywny input w stałym rozmiarze ok. 14 px
     i klik w prawą / dolną część kółka by nie trafiał */
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius-full); corner-shape: round;
  opacity: 0;
  cursor: pointer;
}
.nx-checkbox__box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-full); corner-shape: round;
  box-shadow: inset 0 0 0 1px var(--color-line);
  background: transparent;
  color: var(--color-icon-on-dark);
  transition:
    background-color 200ms ease-out,
    box-shadow 200ms ease-out;
}
.nx-checkbox__box svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 200ms ease-out,
    transform 200ms ease-out;
}

/* Zaznaczony / pośredni: akcent, biały znak */
.nx-checkbox__input:checked ~ .nx-checkbox__box,
.nx-checkbox__input:indeterminate ~ .nx-checkbox__box,
.nx-checkbox.is-mixed .nx-checkbox__box {
  box-shadow: none;
  background: var(--color-surface-accent);
}
.nx-checkbox__input:checked:not(:indeterminate) ~ .nx-checkbox__box [data-icon='checkbox-tick'],
.nx-checkbox__input:indeterminate ~ .nx-checkbox__box [data-icon='checkbox-dash'],
.nx-checkbox.is-mixed .nx-checkbox__box [data-icon='checkbox-dash'] {
  opacity: 1;
  transform: none;
}

/* Hover: obrys czarny / ciemniejsza akcent */
.nx-checkbox:hover .nx-checkbox__box,
.nx-checkbox.is-hover .nx-checkbox__box {
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
}
.nx-checkbox:hover .nx-checkbox__input:is(:checked, :indeterminate) ~ .nx-checkbox__box,
.nx-checkbox.is-mixed:hover .nx-checkbox__box,
.nx-checkbox.is-hover .nx-checkbox__input:checked ~ .nx-checkbox__box,
.nx-checkbox.is-hover.is-mixed .nx-checkbox__box {
  box-shadow: none;
  background: var(--color-surface-accent-hover);
}

/* Focus z klawiatury: czarny pas 2 px, 2 px od kółka + biały pas na zewnątrz */
.nx-checkbox > .nx-checkbox__input:focus-visible ~ .nx-checkbox__box,
.nx-checkbox.is-focus .nx-checkbox__box {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-checkbox > .nx-checkbox__input:focus-visible ~ .nx-checkbox__box::after,
.nx-checkbox.is-focus .nx-checkbox__box::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

/* Błąd: obrys akcent 2 px (tylko niezaznaczony) */
.nx-checkbox--error .nx-checkbox__input:not(:checked) ~ .nx-checkbox__box {
  box-shadow: inset 0 0 0 2px var(--color-line-error);
}

/* Wyłączony */
.nx-checkbox__input:disabled {
  cursor: not-allowed;
}
.nx-checkbox__input:disabled ~ .nx-checkbox__box {
  box-shadow: inset 0 0 0 1px var(--color-line-subtle);
  background: var(--color-surface-subtle);
}
.nx-checkbox__input:disabled:is(:checked, :indeterminate) ~ .nx-checkbox__box,
.nx-checkbox.is-mixed .nx-checkbox__input:disabled ~ .nx-checkbox__box {
  box-shadow: none;
  background: var(--color-surface-disabled);
}


/* ═══ button-primary-maly.css ═══ */
/* BUTTON PRIMARY MAŁY */
.nx-button-small {
  --_bg: var(--color-surface-accent);
  --_bg-hover: var(--color-surface-accent-hover);
  --_fg: var(--color-fg-on-accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--size-control);
  box-sizing: border-box;
  padding: var(--spacing-12) var(--spacing-32);
  border: 0;
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--_bg);
  color: var(--_fg);
  font-family: var(--font-sans);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-hover) var(--ease-brand), transform var(--duration-press) var(--ease-brand);
}
/* Z ikoną po lewej (ramka 20): odstęp 8, lewy padding 24 – ikona optycznie wyrównuje brakujące 8 */
.nx-button-small--ikona {
  gap: var(--spacing-8);
  padding-left: var(--spacing-24);
}
.nx-button-small svg {
  flex: none;
}
.nx-button-small--dark {
  --_bg: var(--color-surface-dark);
  --_bg-hover: var(--color-surface-dark-hover);
  --_fg: var(--color-fg-on-dark);
}
.nx-button-small--light {
  --_bg: var(--color-surface);
  --_bg-hover: var(--color-surface-hover);
  --_fg: var(--color-fg);
}

.nx-button-small:hover,
.nx-button-small.is-hover,
.nx-button-small:active,
.nx-button-small.is-active {
  background: var(--_bg-hover);
}
.nx-button-small:active,
.nx-button-small.is-active {
  transform: scale(0.97);
}

/* Focus z klawiatury: czarny pas 2 px, 2 px od elementu + biały pas 2 px na zewnątrz */
.nx-button-small:focus {
  outline: none;
}
.nx-button-small:focus-visible,
.nx-button-small.is-focus {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-button-small:focus-visible::after,
.nx-button-small.is-focus::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

/* Skala=Mobile: pełna szerokość treści (350), tekst wyśrodkowany, padding 10/30 (T2 23 px + 10 + 10 = min. 44) */
[data-scale='mobile'] .nx-button-small {
  display: flex;
  width: 100%;
  padding: var(--spacing-8) var(--spacing-32);
}


/* ═══ button-icon.css ═══ */
/* BUTTON ICON */
.nx-button-icon {
  --_bg: var(--color-surface-neutral);
  --_bg-hover: var(--color-surface-neutral-hover);
  --_fg: var(--color-icon-on-dark);
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--size-control);
  height: var(--size-control);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full); corner-shape: round;
  background: var(--_bg);
  color: var(--_fg);
  cursor: pointer;
  transition: background-color var(--duration-hover) var(--ease-brand), transform var(--duration-press) var(--ease-brand);
}
.nx-button-icon--dark {
  --_bg: var(--color-surface-dark);
  --_bg-hover: var(--color-surface-dark-hover);
}
.nx-button-icon--akcent {
  --_bg: var(--color-surface-accent);
  --_bg-hover: var(--color-surface-accent-hover);
}
/* na Light ikona czarna  */
.nx-button-icon--light {
  --_bg: var(--color-surface);
  --_bg-hover: var(--color-surface-hover);
  --_fg: var(--color-icon);
}

/* hover zmienia tylko tło – ikona się nie powiększa (spójnie z resztą przycisków narzędzia, decyzja 2026-11-06) */
.nx-button-icon svg {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
}
.nx-button-icon svg * {
  vector-effect: non-scaling-stroke;
}
.nx-button-icon:hover,
.nx-button-icon.is-hover,
.nx-button-icon:active,
.nx-button-icon.is-active {
  background: var(--_bg-hover);
}
.nx-button-icon:active,
.nx-button-icon.is-active {
  transform: scale(0.97);
}
.nx-button-icon:active svg,
.nx-button-icon.is-active svg {
  transform: none;
}

.nx-button-icon:focus {
  outline: none;
}
.nx-button-icon:focus-visible,
.nx-button-icon.is-focus {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-button-icon:focus-visible::after,
.nx-button-icon.is-focus::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: inherit; corner-shape: inherit;
  pointer-events: none;
}

/* Wyłączony (tylko Wariant=Grafit) — koniec toru karuzeli; aria-disabled, zostaje w kolejności Tab.
   Na ciemnym: tło/panel-przejrzysty + ikona/wyciszona; na jasnym (kontener albo przycisk z data-tlo="jasne"):
   tło/na-akcencie + ikona/na-ciemnym — jak kursor toru. Oba szkło/małe (blur 3,5 px).
   Bez hovera i wciśnięcia; element nieaktywny — poza wymogiem kontrastu WCAG (decyzje użytkownika 2026-10-27/28). */
.nx-button-icon[aria-disabled='true'] {
  background: var(--color-surface-panel-translucent);
  color: var(--color-icon-muted);
  cursor: default;
  transform: none;
  -webkit-backdrop-filter: blur(calc(var(--blur-glass-sm) / 2));
  backdrop-filter: blur(calc(var(--blur-glass-sm) / 2));
}
[data-tlo='jasne'] .nx-button-icon[aria-disabled='true'],
.nx-button-icon[aria-disabled='true'][data-tlo='jasne'] {
  background: var(--color-surface-on-accent);
  color: var(--color-icon-on-dark);
}
.nx-button-icon[aria-disabled='true'] svg {
  transform: none;
}


/* ═══ pole-wieloliniowe.css ═══ */
/* POLE WIELOLINIOWE */
.nx-textarea {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  width: 100%;
  font-family: var(--font-sans);
}

/* kontrolka 120 px (ok. 4 linie), promień 20, tekst od góry; obrys nie zabiera miejsca */
.nx-textarea__control {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-16);
  min-height: 7.5rem;
  max-height: 15rem;
  box-sizing: border-box;
  padding: var(--spacing-12) var(--spacing-32) var(--spacing-12) var(--spacing-24);
  position: relative;
  border-radius: var(--radius-24);
  box-shadow: inset 0 0 0 1px var(--color-line);
  background: transparent;
}
.nx-textarea__input {
  flex: 1;
  min-width: 0;
  min-height: 5.5rem; /* 4 linie T2 */
  max-height: 13.5rem; /* 240 − padding */
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-fg);
  font: inherit;
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  resize: none;
  field-sizing: content; /* rośnie z treścią; dalej przewija */
}
.nx-textarea__input::placeholder {
  color: var(--color-fg-muted);
  opacity: 1;
}
.nx-textarea__input:focus {
  outline: none;
}

/* Focus: tło jasnoszare, obrys fokus, tekst T2 Bold */
.nx-textarea__control:focus-within,
.nx-textarea.is-focus .nx-textarea__control {
  background: var(--color-surface-subtle);
  box-shadow: inset 0 0 0 1px var(--color-line-focus);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-textarea__input:focus,
.nx-textarea.is-focus .nx-textarea__input {
  font-weight: var(--font-weight-bold);
}
.nx-textarea__input:focus::placeholder {
  font-weight: var(--font-weight-medium);
}
/* + pierścień dwutonowy; promień pasa = 20 + 6 */
.nx-textarea:not(.is-disabled) .nx-textarea__control:has(.nx-textarea__input:focus-visible),
.nx-textarea.is-focus .nx-textarea__control {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-textarea:not(.is-disabled) .nx-textarea__control:has(.nx-textarea__input:focus-visible)::after,
.nx-textarea.is-focus .nx-textarea__control::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: calc(var(--radius-24) + 0.375rem);
  pointer-events: none;
}

/* Błąd: obrys + ikona (u góry) + komunikat */
.nx-textarea--error .nx-textarea__control {
  padding-right: var(--spacing-8);
  box-shadow: inset 0 0 0 1px var(--color-line-error);
}
.nx-textarea--error .nx-textarea__input {
  color: var(--color-fg-accent);
}
.nx-textarea__error-icon {
  display: flex;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-icon-accent);
}
.nx-textarea__message {
  margin: 0;
  color: var(--color-fg-accent);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Wyłączony */
.nx-textarea.is-disabled .nx-textarea__control {
  background: var(--color-surface-subtle);
  box-shadow: inset 0 0 0 1px var(--color-line-subtle);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-textarea.is-disabled .nx-textarea__input,
.nx-textarea.is-disabled .nx-textarea__input::placeholder {
  color: var(--color-fg-on-dark-muted);
  cursor: not-allowed;
}


/* ═══ pole-tekstowe.css ═══ */
/* POLE TEKSTOWE */
.nx-text-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  width: 100%;
}

/* kontrolka 48 px, obrys 1 px wewnątrz wysokości (strokesIncludedInLayout = false) */
.nx-text-field__control {
  display: flex;
  align-items: center;
  gap: var(--spacing-16);
  height: var(--size-control);
  box-sizing: border-box;
  padding: var(--spacing-8) var(--spacing-32) var(--spacing-8) var(--spacing-24);
  position: relative;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full); corner-shape: round;
  background: transparent;
}

.nx-text-field__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
}
.nx-text-field__input::placeholder {
  color: var(--color-fg-muted);
  opacity: 1;
}
.nx-text-field__input:focus {
  outline: none;
}

.nx-text-field__icon,
.nx-text-field__error-icon {
  display: flex;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}
.nx-text-field__icon {
  color: var(--color-icon);
}

/* Focus: tło jasnoszare, obrys fokus, wartość T2 Bold */
.nx-text-field__control:focus-within,
.nx-text-field.is-focus .nx-text-field__control {
  border-color: var(--color-line-focus);
  background: var(--color-surface-subtle);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-text-field__input:focus,
.nx-text-field.is-focus .nx-text-field__input {
  font-weight: var(--font-weight-bold);
}
.nx-text-field__input:focus::placeholder {
  font-weight: var(--font-weight-medium);
}
/* + pierścień dwutonowy jak w pozostałych komponentach (pole aria-disabled ma pierścień na POLE WYŁĄCZONE);
   kontrolka ma prawdziwy obrys 1 px, więc biały pas zaczyna się 7 px od krawędzi wypełnienia */
.nx-text-field:not(.is-disabled) .nx-text-field__control:has(.nx-text-field__input:focus-visible),
.nx-text-field.is-focus .nx-text-field__control {
  outline: 2px solid var(--color-line-focus);
  outline-offset: 2px;
}
.nx-text-field:not(.is-disabled) .nx-text-field__control:has(.nx-text-field__input:focus-visible)::after,
.nx-text-field.is-focus .nx-text-field__control::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 2px solid var(--color-line-on-dark);
  border-radius: var(--radius-full); corner-shape: round;
  pointer-events: none;
}

/* Błąd: obrys + ikona + komunikat (trzy sygnały, nie sam kolor) */
.nx-text-field--error .nx-text-field__control {
  padding-right: var(--spacing-8);
  border-color: var(--color-line-error);
}
.nx-text-field--error .nx-text-field__input {
  color: var(--color-fg-accent);
}
.nx-text-field__error-icon {
  color: var(--color-icon-accent);
}
/* tekst pomocniczy pod polem (wymagania, np. długość hasła) – stały, nie znika przy błędzie */
.nx-text-field__podpowiedz {
  margin: 0;
  color: var(--color-fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-t1);
  line-height: var(--text-t1--line-height);
}
/* „Pokaż hasło”: oko przy prawej krawędzi pola, 36 px (cel ≥ 24), pierścień fokusu jak w przyciskach */
.nx-text-field__control:has(.nx-text-field__pokaz) {
  padding-right: var(--spacing-4);
}
.nx-text-field__pokaz {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--size-control-sm);
  height: var(--size-control-sm);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full); corner-shape: round;
  background: transparent;
  color: var(--color-icon);
  cursor: pointer;
  transition: background-color 150ms ease;
}
.nx-text-field__pokaz:hover {
  background: var(--color-surface-subtle);
}
.nx-text-field__pokaz svg {
  width: 1.25rem;
  height: 1.25rem;
}
.nx-text-field__message {
  margin: 0;
  color: var(--color-fg-accent);
  font-family: var(--font-sans);
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}

/* Wyłączony: gaśnie wszystko */
.nx-text-field.is-disabled .nx-text-field__control {
  border-color: var(--color-line-subtle);
  background: var(--color-surface-subtle);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}
.nx-text-field.is-disabled .nx-text-field__input,
.nx-text-field.is-disabled .nx-text-field__input::placeholder,
.nx-text-field.is-disabled .nx-text-field__icon {
  color: var(--color-fg-on-dark-muted);
  font-weight: var(--font-weight-medium); /* fokus pola aria-disabled nie pogrubia wartości */
  cursor: not-allowed;
}

/* Tryb Mobile (POLE TEKSTOWE): etykieta w środku pola (ETYKIETA W POLU), bez tekstu
   zastępczego, bez pierścienia fokusu — fokus pokazuje szare tło, czarny obrys i miniatura etykiety */
[data-scale='mobile'] .nx-text-field > .nx-field-label {
  display: none;
}
[data-scale='mobile'] .nx-text-field__input::placeholder {
  color: transparent;
}
[data-scale='mobile'] .nx-text-field:not(.is-disabled) .nx-text-field__control:has(.nx-text-field__input:focus-visible) {
  outline: none;
}
[data-scale='mobile'] .nx-text-field:not(.is-disabled) .nx-text-field__control:has(.nx-text-field__input:focus-visible)::after {
  display: none;
}
[data-scale='mobile'] .nx-text-field.is-disabled .nx-float-label,
[data-scale='mobile'] .nx-text-field.is-disabled .nx-float-label__required {
  color: var(--color-fg-on-dark-muted);
}


/* ═══ etykieta-w-polu.css ═══ */
/* ETYKIETA W POLU. Tylko tryb Mobile; stoi po kontrolce (input) w tym samym rodzicu. */
.nx-float-label {
  display: none;
}
[data-scale='mobile'] .nx-float-label {
  position: absolute;
  top: 0.75rem;
  left: var(--spacing-24);
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  max-width: calc(100% - var(--size-control));
  padding: 0;
  color: var(--color-fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  white-space: nowrap;
  pointer-events: none;
  transition:
    top 250ms ease-out,
    padding 250ms ease-out,
    font-size 250ms ease-out,
    line-height 250ms ease-out;
}
.nx-float-label__required {
  color: var(--color-fg-accent);
}
.nx-float-label__optional {
  font-size: var(--text-t1);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-t1--line-height);
}
/* miniatura: fokus albo wpisana wartość — S1 na krawędzi (połowa interlinii nad ramką, jak na komputerze), podkład pod nią */
[data-scale='mobile'] :focus ~ .nx-float-label,
[data-scale='mobile'] :not(:placeholder-shown) ~ .nx-float-label {
  top: calc(var(--text-s1--line-height) / -2);
  padding: 0 var(--spacing-4);
  background: var(--color-surface);
  font-size: var(--text-s1);
  line-height: var(--text-s1--line-height);
}
[data-scale='mobile'] :focus ~ .nx-float-label .nx-float-label__optional,
[data-scale='mobile'] :not(:placeholder-shown) ~ .nx-float-label .nx-float-label__optional {
  font-size: var(--text-s1);
  line-height: var(--text-s1--line-height);
}
/* pole w fokusie jest szare: podkład biały do krawędzi (6 px), dalej jasnoszary — twardy stop */
[data-scale='mobile'] :focus ~ .nx-float-label {
  background: linear-gradient(var(--color-surface) 0.375rem, var(--color-surface-subtle) 0.375rem);
  /* akcent na jasnym szarym tle – osobny token (--color-fg-accent-on-subtle), żeby trzymać 4,5 */
  --color-fg-accent: var(--color-fg-accent-on-subtle);
  --color-icon-accent: var(--color-icon-accent-on-subtle);
}


/* ═══ etykieta w polu – narzędzie Nitpix (2026-11-06) ═══ */
/* POLE TEKSTOWE i POLE WIELOLINIOWE z etykietą w polu (--etykieta-w-polu): etykieta stoi w środku pustego pola jak tekst
   zastępczy; po fokusie, z wpisaną albo autouzupełnioną wartością przenosi się na ramkę (S1, środek na linii obrysu).
   Tekst zastępczy (np. „np. anna@firma.pl”) widać dopiero w fokusie, pod uniesioną etykietą. Pierścień fokusu zostaje. */
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) :is(.nx-text-field__input, .nx-textarea__input)::placeholder {
  color: transparent;
}
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) :is(.nx-text-field__input, .nx-textarea__input):focus::placeholder {
  color: var(--color-fg-muted);
}
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) .nx-float-label {
  position: absolute;
  top: 0.75rem; /* 48 px pole: (48 − 2 obrysu − 24 interlinii) / 2 = 11 ≈ 12 */
  left: var(--spacing-24);
  display: flex;
  align-items: center;
  gap: var(--spacing-4);
  max-width: calc(100% - var(--size-control));
  padding: 0;
  border-radius: var(--radius-4);
  color: var(--color-fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-t2);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-t2--line-height);
  white-space: nowrap;
  pointer-events: none;
  transition: top 200ms ease-out, left 200ms ease-out, padding 200ms ease-out, font-size 200ms ease-out, line-height 200ms ease-out, color 200ms ease-out;
}
.nx-textarea--etykieta-w-polu .nx-float-label {
  top: var(--spacing-12); /* jak padding pola – w miejscu pierwszej linii tekstu */
}
.nx-float-label__name {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* uniesiona: na ramce; podkład w kolorze tła pod etykietą zasłania linię obrysu (do linii + 1 px), niżej przezroczysty –
   w fokusie widać szare tło pola */
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) :is(:focus, :not(:placeholder-shown), :autofill) ~ .nx-float-label {
  top: calc(var(--text-s1--line-height) / -2);
  left: var(--spacing-16); /* tekst etykiety w linii z wartością (20 − podkład 4) */
  padding: 0 var(--spacing-4);
  background: linear-gradient(var(--etykieta-tlo, var(--okno-tlo, var(--color-surface))) calc(50% + 1px), transparent calc(50% + 1px));
  font-size: var(--text-s1);
  line-height: var(--text-s1--line-height);
}
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) :is(:focus, :not(:placeholder-shown), :autofill) ~ .nx-float-label .nx-float-label__optional {
  font-size: var(--text-s1);
  line-height: var(--text-s1--line-height);
}
/* w fokusie etykieta w kolorze tekstu – mocniejszy sygnał, które pole jest aktywne */
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu) :focus ~ .nx-float-label {
  color: var(--color-fg);
}
:is(.nx-text-field--etykieta-w-polu, .nx-textarea--etykieta-w-polu).is-disabled .nx-float-label {
  color: var(--color-fg-on-dark-muted);
}

/* DROPDOWN z etykietą w polu (bez etykiety nad polem): bez wyboru etykieta stoi w polu jako tekst zastępczy
   (.nx-select__value.is-placeholder), a ten element jest tylko dla czytnika. Po wyborze: w filtrach widać samą
   wartość, w formularzach (--etykieta-na-ramce) etykieta przenosi się na ramkę jak w polu tekstowym. */
.nx-select__etykieta {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nx-select--etykieta-na-ramce:has(.nx-select__value:not(.is-placeholder)) .nx-select__etykieta {
  top: calc(var(--text-s1--line-height) / -2);
  left: var(--spacing-16);
  width: auto;
  height: auto;
  max-width: calc(100% - var(--size-control));
  padding: 0 var(--spacing-4);
  overflow: hidden;
  clip-path: none;
  border-radius: var(--radius-4);
  background: linear-gradient(var(--etykieta-tlo, var(--okno-tlo, var(--color-surface))) calc(50% + 1px), transparent calc(50% + 1px));
  color: var(--color-fg-muted);
  font-size: var(--text-s1);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-s1--line-height);
  text-overflow: ellipsis;
  pointer-events: none;
}
.nx-select--etykieta-na-ramce.is-open .nx-select__etykieta {
  color: var(--color-fg);
}

@media (prefers-reduced-motion: reduce) {
  .nx-float-label { transition-property: color; }
}
html.animacje-stop .nx-float-label { transition: none; }

/* autouzupełnianie przeglądarki (Chrome, Safari): bez niebieskiego / żółtego prostokąta w polu – tło pola zostaje
   przezroczyste (przejście tła trwa „wiecznie”, więc kolor przeglądarki nigdy się nie pojawia), tekst w kolorze pola */
:is(.nx-text-field__input, .nx-textarea__input):is(:-webkit-autofill, :autofill) {
  -webkit-text-fill-color: var(--color-fg);
  caret-color: var(--color-fg);
  transition: background-color 600000s 0s, color 600000s 0s;
}
