/* Единый select/dropdown для приложения.
   DOM и поведение остаются у своих компонентов; здесь одна точка правды для
   рамки, активного состояния, меню, строки и отметки выбранного пункта. */
:root {
  --ui-dropdown-height: 1.875rem;
}

input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):where(:not(.cur-year):not(.flatpickr-hour):not(.flatpickr-minute):not(.flatpickr-second)) {
  box-sizing: border-box;
  height: var(--ui-control-height-regular);
  min-height: var(--ui-control-height-regular);
  padding: .45rem .65rem;
  border-width: 1px;
  border-style: solid;
  border-radius: .6rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.2;
}
:where(input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):where(:not(.cur-year):not(.flatpickr-hour):not(.flatpickr-minute):not(.flatpickr-second))) {
  border-color: #cfd6e2;
  background-color: var(--surface, var(--ui-surface));
  color: var(--ink, var(--ui-text));
}
input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):where(:not(.cur-year):not(.flatpickr-hour):not(.flatpickr-minute):not(.flatpickr-second)):hover {
  border-color: #aeb8c8;
}
input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):where(:not(.cur-year):not(.flatpickr-hour):not(.flatpickr-minute):not(.flatpickr-second)):focus {
  border-color: var(--accent, var(--ui-accent));
  outline: 0;
  box-shadow: none;
}

/* Обычные текстовые действия продолжают тот же ряд контролов. Компактные
   text-xs-кнопки таблиц, иконки, вкладки и служебные кнопки сюда не входят. */
:where(button, input[type="submit"], input[type="button"], input[type="reset"]).text-sm.rounded-lg,
a.inline-flex.text-sm.rounded-lg {
  box-sizing: border-box;
  height: var(--ui-control-height-regular);
  min-height: var(--ui-control-height-regular);
  border-radius: .6rem;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
}
input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):disabled {
  background-color: var(--surface-2, var(--ui-surface-muted));
  color: var(--ink-3, var(--ui-text-soft));
  cursor: not-allowed;
}
input::placeholder {
  color: var(--ink-3, var(--ui-text-soft));
  font-weight: 400;
  opacity: .72;
}

/* Два системных уровня высоты общих полей и кнопок: компактный 24px и
   обычный 36px. Класс нужен полям; кнопки используют соответствующие
   `.ui-action--compact` / `.ui-action--regular` из `base.css`. */
input.ui-control--compact {
  height: var(--ui-control-height-compact) !important;
  min-height: var(--ui-control-height-compact) !important;
  max-height: var(--ui-control-height-compact);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-radius: var(--ui-control-radius-compact) !important;
}
/* Одна системная лупа во всех поисковых полях, включая поиск внутри
   `data-searchable`-списков. Иконка всегда стоит перед вводимым текстом. */
input[type="search"] {
  padding-left: 2.15rem !important;
  background-image: url("/static/search.svg?v=1");
  background-repeat: no-repeat;
  background-position: .7rem 50%;
  background-size: .9rem .9rem;
}
/* Составные поиски уже имеют собственную рамку-контейнер. */
.package-search input,
.ss-panel .ss-search {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
/* Поиск «Претензий» — составное поле: рамка и высота принадлежат внешней
   оболочке с иконкой, внутренний input не должен получать их второй раз. */
.pretensii-page .toolbar > .search {
  box-sizing: border-box;
  height: 2.25rem;
  min-height: 2.25rem;
  padding-block: 0;
}
.pretensii-page .toolbar > .search:focus-within {
  border-color: var(--accent, var(--ui-accent));
  box-shadow: none;
}
.pretensii-page .toolbar > .search > .search-input,
.pretensii-page .toolbar > .search > .search-input:hover,
.pretensii-page .toolbar > .search > .search-input:focus {
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0 0 0 1.45rem !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: url("/static/search.svg?v=1");
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: .95rem .95rem;
  box-shadow: none;
  outline: 0;
}

select:not([multiple]):not([size]) {
  box-sizing: border-box;
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  padding: .35rem 2rem .35rem .65rem;
  border: 1px solid #cfd6e2;
  border-radius: .6rem;
  appearance: none;
  background-color: var(--surface, var(--ui-surface));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: .8rem;
  color: var(--ink, var(--ui-text));
  font-family: inherit;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
select:not([multiple]):not([size]):hover { border-color: #aeb8c8; }
select:not([multiple]):not([size]):focus {
  border-color: var(--accent, var(--ui-accent));
  outline: 0;
  box-shadow: none;
}
select:disabled {
  background-color: var(--surface-2, var(--ui-surface-muted));
  color: var(--ink-3, var(--ui-text-soft));
  cursor: not-allowed;
}
select option {
  color: var(--ink, var(--ui-text));
  font-size: .75rem;
  font-weight: 400;
}
select option:checked { font-weight: 400; }
select optgroup {
  color: #0f172a;
  font-size: .72rem;
  font-weight: 600;
}
select[multiple],
select[size] {
  border: 1px solid #cfd6e2;
  border-radius: .6rem;
  background: var(--surface, var(--ui-surface));
  color: var(--ink, var(--ui-text));
  font-weight: 400;
}
/* Табличный inline-select остаётся низким, но использует ту же геометрию и палитру. */
table select:not([multiple]):not([size]),
select[data-inline]:not([multiple]):not([size]),
select.cell:not([multiple]):not([size]),
select.fill-src:not([multiple]):not([size]) {
  min-height: 1.875rem;
  padding: .3rem 1.65rem .3rem .5rem;
  background-position: right .45rem center;
  background-size: .7rem;
  font-size: .72rem;
}
table input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]),
input[data-inline]:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]) {
  min-height: 1.875rem;
  padding: .3rem .5rem;
  font-size: .72rem;
}

.ss-field,
.choice-trigger,
.page-choice-trigger {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .35rem .65rem;
  border: 1px solid #cfd6e2;
  border-radius: .6rem;
  outline: 0;
  background: var(--surface, var(--ui-surface));
  color: var(--ink, var(--ui-text));
  font-family: inherit;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.ss-wrap {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  vertical-align: bottom;
}
.ss-caret,
.ms-caret {
  display: block;
  width: .875rem;
  height: .875rem;
  flex: 0 0 .875rem;
  color: #475569;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}
.ss-wrap[data-open] .ss-caret,
.ms[open] .ms-caret { transform: rotate(180deg); }
/* Короткое «Все/Всё» не должно схлопывать фильтр до ширины одного слова.
   Класс ставит общий select-компонент, если среди вариантов есть такой пункт. */
select.ui-all-choice:not([multiple]):not([size]),
.ss-wrap.ss-all-choice,
details.ms .ms-summary,
.ui-all-choice-trigger {
  min-width: 6.875rem;
}
.ss-wrap.ss-all-choice:not(.w-full):not(.flex-1):not(.grow) {
  width: auto;
}

/* Мультиселект с чекбоксами продолжает тот же визуальный компонент: такая же
   плашка, меню, строки и фиолетовое выбранное состояние. */
.ms {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.ms-summary {
  box-sizing: border-box;
  display: flex;
  width: max-content;
  max-width: min(18rem, calc(100vw - 1rem));
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .35rem .65rem;
  border: 1px solid #cfd6e2;
  border-radius: .6rem;
  outline: 0;
  background: var(--surface, var(--ui-surface));
  color: var(--ink, var(--ui-text));
  font-family: inherit;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
}
.ms-summary::-webkit-details-marker { display: none; }
.ms-summary:hover { border-color: #aeb8c8; }
.ms[open] > .ms-summary,
.ms-summary:focus-visible { border-color: var(--accent, var(--ui-accent)); }
.ms-text { min-width: 0; }
.ms-menu {
  position: absolute;
  z-index: 1000;
  width: max-content;
  min-width: 100%;
  max-width: min(22rem, calc(100vw - 1rem));
  max-height: min(17rem, 50vh);
  margin-top: .3rem;
  padding: .3rem;
  overflow-y: auto;
  border: 1px solid #dbe1ea;
  border-radius: .7rem;
  background: var(--surface, var(--ui-surface));
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.ms-options { display: grid; gap: .1rem; }
.ms-option {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  align-items: center;
  gap: .55rem;
  padding: .42rem .5rem;
  border-radius: .45rem;
  color: var(--ink-2, #475569);
  font-family: inherit;
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
}
.ms-option:hover {
  background: #f1f3f8;
  color: var(--accent, var(--ui-accent));
}
.ms-option:has(.ms-item:checked) {
  background: var(--accent-soft, var(--ui-accent-soft));
  color: var(--accent, var(--ui-accent));
}
.ms-all-option {
  margin-bottom: .2rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #edf0f5;
  border-radius: .45rem .45rem 0 0;
}
.ms-check {
  box-sizing: border-box;
  width: .9rem;
  height: .9rem;
  flex: 0 0 .9rem;
  margin: 0;
  border: 1px solid #c3cad6;
  border-radius: .25rem;
  appearance: none;
  background: #fff;
  cursor: pointer;
}
.ms-check::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.2 2.8 2.8 6.2-6.3'/%3E%3C/svg%3E") center / .7rem no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.2 2.8 2.8 6.2-6.3'/%3E%3C/svg%3E") center / .7rem no-repeat;
}
.ms-check:checked,
.ms-check:indeterminate {
  border-color: var(--accent, var(--ui-accent));
  background: var(--accent, var(--ui-accent));
}
.ms-check:checked::after { opacity: 1; }
.ms-check:indeterminate::after {
  width: .45rem;
  height: 1.5px;
  margin: calc(50% - .75px) auto 0;
  opacity: 1;
  border-radius: 999px;
  -webkit-mask: none;
  mask: none;
}
.ms-check:focus-visible {
  outline: 2px solid var(--accent-soft, var(--ui-accent-soft));
  outline-offset: 1px;
}
.ms-footer {
  position: sticky;
  bottom: -.3rem;
  margin: .25rem -.3rem -.3rem;
  padding: .4rem;
  border-top: 1px solid #edf0f5;
  background: var(--surface, var(--ui-surface));
}
.ms-apply {
  display: inline-flex;
  width: 100%;
  height: 1.875rem;
  align-items: center;
  justify-content: center;
  padding: .3rem .65rem;
  border: 0;
  border-radius: .5rem;
  background: var(--accent, var(--ui-accent));
  color: #fff;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
}
.ms-apply:hover { background: var(--accent-hover, var(--ui-accent-hover)); }
.ss-wrap > .ss-field:disabled {
  background: var(--surface-2, var(--ui-surface-muted));
  color: var(--ink-3, var(--ui-text-soft));
  cursor: not-allowed;
}
.ss-wrap.ss-compact > .ss-field {
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  padding: .3rem .5rem;
  font-size: .72rem;
}
/* Слот сдачи FBM после инициализации — уже не native select, а эта кнопка.
   Поэтому компактность задаётся видимому trigger, а не скрытому исходному полю. */
.ss-wrap.ss-handover-time {
  flex: 0 0 4.9rem;
  width: 4.9rem;
  vertical-align: middle;
}
.ss-wrap.ss-compact.ss-handover-time > .ss-field,
#ship-list button.fbm-slot-control {
  box-sizing: border-box;
  height: 1.125rem;
  min-height: 1.125rem;
  max-height: 1.125rem;
  padding: 0 .4rem;
  border-radius: .5rem;
  gap: .25rem;
  font-size: .7rem;
  line-height: .875rem;
}
#ship-list button.fbm-slot-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ss-wrap.ss-invalid > .ss-field {
  border-color: #e11d48;
}
.ss-field:hover,
.choice-trigger:hover,
.page-choice-trigger:hover {
  border-color: #aeb8c8;
}
.ss-wrap:focus-within > .ss-field,
.ss-wrap[data-open] > .ss-field,
.choice-trigger:focus-visible,
.choice[data-open] .choice-trigger,
.page-choice-trigger:focus-visible,
.page-choice[data-open] .page-choice-trigger {
  border-color: var(--accent, var(--ui-accent));
}

.ss-panel,
.choice-menu,
.page-choice-menu {
  padding: .3rem;
  border: 1px solid #dbe1ea;
  border-radius: .7rem;
  background: var(--surface, var(--ui-surface));
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.ss-panel {
  width: max-content;
  min-width: 100%;
  max-width: min(22rem, calc(100vw - 1rem));
}
.ss-panel .ss-search {
  padding: .5rem .55rem;
  border-bottom: 1px solid #edf0f5;
  font-size: .75rem;
}
.ss-panel--plain .ss-list {
  max-height: min(17rem, 50vh);
}
.ss-group {
  color: #0f172a;
}

.ss-opt,
.choice-option,
.page-choice-option {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .42rem .5rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--ink-2, #475569);
  font-family: inherit;
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.ss-opt:hover,
.ss-opt:focus-visible,
.choice-option:hover,
.page-choice-option:hover {
  background: #f1f3f8;
  color: var(--accent, var(--ui-accent));
  outline: 0;
}
.ss-opt-disabled,
.ss-opt-disabled:hover,
.ss-opt-disabled:focus-visible {
  background: transparent;
  color: var(--ink-3, var(--ui-text-soft));
  cursor: not-allowed;
  opacity: .65;
}
.ss-opt[aria-selected="true"],
.choice-option[aria-selected="true"],
.page-choice-option[aria-selected="true"] {
  background: var(--accent-soft, var(--ui-accent-soft));
  color: var(--accent, var(--ui-accent));
  font-weight: 400;
}

.ss-opt-check,
.choice-option::after,
.page-choice-option::after {
  display: block;
  width: .85rem;
  height: .85rem;
  flex: 0 0 .85rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.2 2.8 2.8 6.2-6.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.2 2.8 2.8 6.2-6.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ss-opt-check svg { display: none; }
.ss-empty {
  padding: .55rem;
  color: var(--ink-3, var(--ui-text-soft));
  font-size: .75rem;
  text-align: center;
}
.choice-option::after,
.page-choice-option::after {
  content: "";
  opacity: 0;
}
.choice-option[aria-selected="true"]::after,
.page-choice-option[aria-selected="true"]::after {
  opacity: 1;
}

/* Внутри карточек «Претензий» ширина остаётся контекстной, но системная высота
   и рамка не меняются от страницы к странице. Мини-редактор в строке — исключение. */
.pretensii-page .monitor-actions .page-choice-trigger,
.claim-status-choice .page-choice-trigger {
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  padding: .35rem .65rem;
  font-size: .78rem;
}
.inline-version-choice .page-choice-trigger {
  height: var(--ui-dropdown-height);
  min-height: var(--ui-dropdown-height);
  padding: .3rem .5rem;
  font-size: .72rem;
}

/* Единая плашка-фильтр во всех разделах. Сюда входят ссылки статусов WMS,
   быстрые периоды, фильтры претензий и radio-чипы репрайсера. Бейджи статуса
   внутри таблиц и обычные кнопки действий остаются отдельными компонентами. */
:is(.ui-filter-chip, .org-chip, .pretensii-page .chip) {
  box-sizing: border-box;
  display: inline-flex;
  height: 1.875rem;
  min-height: 1.875rem;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f0f2f7;
  color: #59616f;
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.ui-filter-row.ui-filter-row--fit {
  width: auto;
}
:is(.ui-filter-chip, .org-chip, .pretensii-page .chip):hover {
  border-color: transparent;
  background: #e7eaf1;
  color: var(--ui-filter-active, #4a5567);
}
.ui-filter-chip.is-stocked:not(.is-active) {
  border-color: #86efac;
  background: #ecfdf5;
  color: #065f46;
}
.ui-filter-chip.is-stocked:not(.is-active):hover {
  border-color: #6ee7b7;
  background: #d1fae5;
  color: #065f46;
}
:is(.ui-filter-chip, .org-chip, .pretensii-page .chip):focus-visible,
.org-chip:focus-within {
  outline: 2px solid var(--accent-line, var(--ui-accent-line));
  outline-offset: 1px;
  box-shadow: none;
}
:is(.ui-filter-chip.is-active, .org-chip.org-chip-on, .pretensii-page .chip.on) {
  border-color: var(--ui-filter-active, #4a5567);
  background: var(--ui-filter-active, #4a5567);
  color: #fff;
  font-weight: 550;
  box-shadow: none;
}
:is(.ui-filter-chip.is-active, .org-chip.org-chip-on, .pretensii-page .chip.on):hover {
  border-color: var(--ui-filter-active, #4a5567);
  background: var(--ui-filter-active, #4a5567);
  color: #fff;
}
/* Нейтральная группа использует то же выбранное состояние: фильтры не должны
   конкурировать цветом с основными действиями. */
.ui-filter-row--neutral .ui-filter-chip.is-active,
.ui-filter-row--neutral .ui-filter-chip.is-active:hover {
  border-color: var(--ui-filter-active, #4a5567);
  background: var(--ui-filter-active, #4a5567);
  color: #fff;
  box-shadow: none;
}
.ui-filter-chip > .ui-filter-count,
.pretensii-page .chip-ct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 3px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}
.ui-filter-chip.is-active > .ui-filter-count,
.pretensii-page .chip.on .chip-ct {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.ui-filter-row--neutral .ui-filter-chip.is-active > .ui-filter-count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.ui-filter-chip.is-muted,
.org-chip-off {
  opacity: .55;
}
.org-chip-off {
  cursor: not-allowed;
}
.org-chip.org-chip-off:hover {
  border-color: transparent;
  background: #f0f2f7;
  color: #59616f;
}

/* Ручное обновление / синхронизация: единая высота и нарисованная круговая
   стрелка. Уже цветные кнопки сохраняют контекстный цвет, а белые и текстовые
   получают отдельную светло-фиолетовую заливку — их нельзя путать с селекторами. */
.ui-refresh-action {
  box-sizing: border-box;
  display: inline-flex;
  height: 2.25rem;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: .6rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.ui-refresh-action.bg-white,
.ui-refresh-action:not([class*="bg-"]) {
  border-color: #c4b5fd !important;
  background: #ede9fe !important;
  color: #6d28d9 !important;
}
.ui-refresh-action.bg-white:hover,
.ui-refresh-action:not([class*="bg-"]):hover {
  border-color: #a78bfa !important;
  background: #ddd6fe !important;
  color: #5b21b6 !important;
}
.ui-refresh-action::before {
  content: "";
  display: block;
  width: .9rem;
  height: .9rem;
  flex: 0 0 .9rem;
  background: currentColor;
  -webkit-mask: url("/static/refresh.svg?v=1") center / contain no-repeat;
  mask: url("/static/refresh.svg?v=1") center / contain no-repeat;
}
.ship-actions .ui-refresh-action--idle-text {
  position: relative;
  width: 8rem;
}
.ship-actions .ui-refresh-action--idle-text::before {
  position: absolute;
  left: .45rem;
}
.ui-refresh-action--idle-text:not(.is-refreshing):not([aria-busy="true"])::before {
  visibility: hidden;
}
.ship-actions .ui-refresh-action--idle-text:is(.is-refreshing, [aria-busy="true"]) {
  padding-right: .15rem;
  padding-left: 1.55rem;
}
/* ⭐⭐ ЗАНЯТАЯ КНОПКА НЕ ПРИНИМАЕТ ПОВТОРНЫХ НАЖАТИЙ — правило общее для ЛЮБОГО долгого
   действия, а не только для кнопок с круговой стрелкой (боевой день 06.09: «Отгрузить
   всё» работала 80 секунд без единого признака работы, и её нажали второй раз).
   ⚠️ Ключ — `[data-ui-refresh][aria-busy]`, то есть само состояние занятости, поэтому
   защита достаётся и кнопкам без иконки обновления. Вращение ниже остаётся привязанным
   к `.ui-refresh-action`: стрелка есть не у всех, а блокировка нужна всем. */
.ui-refresh-action.is-refreshing,
.ui-refresh-action[aria-busy="true"],
[data-ui-refresh].is-refreshing,
[data-ui-refresh][aria-busy="true"] {
  pointer-events: none;
  cursor: wait;
  opacity: .72;
}
.ui-refresh-action.is-refreshing::before,
.ui-refresh-action[aria-busy="true"]::before {
  animation: ui-refresh-spin .75s linear infinite;
}
.ship-actions .ui-refresh-action.ui-action--compact {
  height: 1.75rem;
  min-height: 1.75rem;
  padding: .3rem .55rem;
  border-radius: .45rem;
  font-size: .7rem;
}
@keyframes ui-refresh-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ui-refresh-action.is-refreshing::before,
  .ui-refresh-action[aria-busy="true"]::before { animation-duration: 1.5s; }
}

/* Выгрузка таблиц — вторичное действие: спокойный мятный фон не спорит с
   фиолетовыми основными кнопками. Формат остаётся обычной частью подписи. */
.ui-export-action {
  box-sizing: border-box;
  display: inline-flex;
  height: 2.25rem;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border: 1px solid #98d7ad;
  border-radius: .6rem;
  background: #dcf7e5;
  color: #334155;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ui-export-action::before {
  content: "";
  display: block;
  width: .9rem;
  height: .9rem;
  flex: 0 0 .9rem;
  background: #168447;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4M5 19h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4M5 19h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ui-export-action:hover {
  border-color: #72c48e;
  background: #c9f0d6;
  color: #1f3f2d;
}
.ui-export-action:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

/* Единая мобильная плотность контролов: dropdown уже равен 30px на всех ширинах;
   поля и кнопки уменьшаются до него на телефоне. Меню вариантов и зоны чекбоксов
   не уменьшаем — там важнее удобное попадание пальцем. */
@media (max-width: 767px) {
  input:is(:not([type]), [type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"], [type="date"], [type="datetime-local"], [type="month"], [type="week"], [type="time"]):where(:not(.cur-year):not(.flatpickr-hour):not(.flatpickr-minute):not(.flatpickr-second)) {
    height: 1.875rem;
    min-height: 1.875rem;
    padding: .35rem .55rem;
    font-size: .75rem;
  }
  select:not([multiple]):not([size]) {
    height: var(--ui-dropdown-height);
    min-height: var(--ui-dropdown-height);
    padding: .35rem 1.7rem .35rem .55rem;
    background-position: right .5rem center;
    background-size: .72rem;
    font-size: .75rem;
  }
  :where(button, input[type="submit"], input[type="button"], input[type="reset"]).text-sm.rounded-lg,
  a.inline-flex.text-sm.rounded-lg,
  .ui-action--regular,
  .ui-refresh-action,
  .ui-export-action {
    height: 1.875rem;
    min-height: 1.875rem;
    padding-top: .32rem;
    padding-bottom: .32rem;
    font-size: .75rem;
  }
  /* Верхние действия FBMP/FBS/FF получают ОДНУ итоговую геометрию в последнем
     загружаемом CSS: тип элемента (a/button/summary) и refresh не меняют высоту. */
  .wms-context-tools .wms-context-action.is-mobile-compact {
    box-sizing: border-box;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    padding: .35rem .7rem;
    border-radius: .55rem;
    font-size: .78rem;
    font-weight: 400;
    line-height: 1;
  }
  .wms-context-actions-disclosure[open] .wms-context-search input {
    box-sizing: border-box;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
  }
  .wms-context-tools .ui-refresh-action.is-mobile-compact {
    gap: .3rem;
  }
  .wms-context-tools .ui-refresh-action.is-mobile-compact::before {
    width: .7rem;
    height: .7rem;
    flex-basis: .7rem;
  }
  .ss-field,
  .choice-trigger,
  .page-choice-trigger,
  .ms-summary,
  .pretensii-page .toolbar > .search {
    height: var(--ui-dropdown-height);
    min-height: var(--ui-dropdown-height);
    padding-top: .35rem;
    padding-bottom: .35rem;
    font-size: .75rem;
  }
  .ui-filter-chip,
  .shipments-status,
  .wms-filter-chip {
    box-sizing: border-box;
    height: 1.875rem;
    min-height: 1.875rem;
    align-items: center;
    padding: .26rem .55rem;
    font-size: .7rem;
  }
  .ui-segmented,
  .ui-segmented-item {
    height: 1.875rem;
    font-size: .75rem;
  }
  .ui-segmented-item { padding-right: .6rem; padding-left: .6rem; }
}

@media (max-width: 480px) {
  .wms-context-actions-disclosure[open] .wms-context-search input {
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
  }
  .wms-context-tools .wms-context-action.is-mobile-compact {
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
    padding: .28rem .45rem;
    font-size: .68rem;
  }
}
