.disposal-screen {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  color: var(--ink);
  font-family: var(--sans);
}
.disposal-screen h2 {
  font-size: 20px;
}
.disposal-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}
.disposal-filters label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
/* Finding 5 (P1): two classes beats `.disposal-filters label` (one element + one class) on
   specificity, so a checkbox filter renders as a normal inline checkbox with its label text on
   the same line, not the `display: grid` stacked layout the text-control filters use. */
.disposal-filters .disposal-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.disposal-filters input:not([type="checkbox"]),
.disposal-filters select,
.disposal-button {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
}
.disposal-filters select {
  max-width: 280px;
}
.disposal-button {
  cursor: pointer;
  text-align: left;
}
.disposal-button:hover {
  background: var(--blue-wash);
}
.disposal-button:disabled {
  cursor: default;
  color: var(--ink-3);
}
.disposal-screen :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.disposal-warning {
  color: var(--warn);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
}
/* Finding 7 (P3): an empty message paragraph (no error/status text to show) still carries the
   background + padding above, so it drew as a bare grey bar above «Сохранить»/«В архив» on every
   card with nothing to say. Same `:empty` treatment `.disposal-field-error` already gets below. */
.disposal-warning:empty {
  display: none;
}
/* ADR-0221: inline message under the period inputs («с» > «по», span > 366 days). */
.disposal-period-error {
  margin: 8px 0 0;
  color: var(--warn);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 12px;
}
.disposal-period-error[hidden] {
  display: none;
}
.disposal-transfer,
.disposal-muted {
  color: var(--ink-2);
  font-size: 13px;
}
.disposal-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.disposal-total {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.disposal-total span {
  color: var(--ink-2);
  font-size: 13px;
}
.disposal-total strong {
  font-size: 26px;
  overflow-wrap: anywhere;
}
.disposal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.disposal-tabs [aria-selected="true"] {
  color: var(--blue-deep);
  background: var(--blue-wash);
  border-color: var(--blue);
}
.disposal-chart {
  display: grid;
  gap: 16px;
  padding: 12px 0;
}
.disposal-bar-row {
  position: relative;
}
.disposal-bar {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 14px;
  overflow-wrap: anywhere;
  background: linear-gradient(
    to right,
    var(--blue-wash) var(--disposal-bar-size),
    var(--surface) var(--disposal-bar-size)
  );
  border-color: var(--border);
}
.disposal-tooltip {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 6px);
  left: 8px;
  max-width: min(440px, 90%);
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: none;
  overflow-wrap: anywhere;
}
.disposal-tooltip div + div {
  margin-top: 5px;
}
.disposal-table-scroll {
  overflow-x: auto;
}
.disposal-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}
.disposal-table th,
.disposal-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.disposal-table th {
  font-weight: 600;
  color: var(--ink-2);
}
.disposal-table th:first-child {
  min-width: 170px;
  max-width: 340px;
  overflow-wrap: anywhere;
}
.disposal-history {
  padding: 12px;
  background: var(--surface-3);
  border-radius: 8px;
}
.disposal-history h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}
.disposal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.disposal-screen [hidden] {
  display: none !important;
}

/* --- вкладка «Сливы»: список и карточка точки ------------------------------ */
/* `grid-template-columns: minmax(0, 1fr)` — БЕЗ него implicit-колонка
   грида сидит по max-content самого широкого потомка (классический
   grid-min-width:auto blowout): на 390px `.disposal-filters` (flex-wrap)
   считает свою ширину по сумме несжатых фильтров (~667px) и вылезает за
   контейнер, а `.disposal-screen { overflow: auto }` тихо прячет это от
   `document.documentElement.scrollWidth`, оставляя «Показать архив»/
   «Требуют внимания» недостижимыми без ручной внутренней прокрутки. */
.disposal-points {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.disposal-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
.disposal-content {
  min-height: 0;
}

.disposal-badge {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
}
.disposal-badge.caution {
  color: var(--warn);
}
.disposal-badge.attention {
  color: var(--err);
}
.disposal-badge.archived {
  color: var(--ink-3);
}

.disposal-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}
.disposal-card-header h2 {
  margin: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}
.disposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
}
.disposal-card-section {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.disposal-card-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
/* Finding 7 (P3): `.disposal-card-section dl`, not `.disposal-card dl` — the form's «Связь с
   Битриксом» section (`buildCardSection`, via `buildForm`) is a `.disposal-card-section` appended
   straight to the form, never nested inside a `.disposal-card` wrapper (only the READ-ONLY card
   body wraps its sections that way). Under the narrower `.disposal-card dl` selector the form's
   copy of this section fell back to the browser default `dl`/`dd` styling — a 40px `dd` indent. */
.disposal-card-section dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
}
.disposal-card-section dt {
  color: var(--ink-2);
  font-size: 13px;
}
.disposal-card-section dd {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.disposal-history-table td div + div {
  margin-top: 4px;
}

/* --- вкладка «Сливы»: форма правки (Шаг 9 наполняет разметку) ------------- */
.disposal-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 900px) {
  .disposal-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.disposal-form-grid input,
.disposal-form-grid select,
.disposal-form-grid textarea {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}
/* Finding 6 (P2): match the filter/control style — without this, text inputs/selects fell back to
   the tiny UA-default font with the native border, and textareas (phone, contact person, email,
   office, notes…) fell back to the browser's MONOSPACE default (no `font: inherit` anywhere set
   one). Checkboxes (`open_24h`) keep native sizing (`font: inherit` above is harmless for them —
   it doesn't change checkbox rendering; the border/background/padding block below is scoped past
   them), same exception the filter checkboxes get above. */
.disposal-form-grid input:not([type="checkbox"]),
.disposal-form-grid select,
.disposal-form-grid textarea {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 8px 12px;
}
.disposal-form-grid textarea {
  width: 100%;
  resize: vertical;
}
/* Finding 6 (P2): each field row is a bare `<div>` (label, control, error slot) with no layout of
   its own — at narrow widths the label sat inline with the control («Регион[СПб]»). */
.disposal-form-grid > div {
  display: grid;
  gap: 6px;
}
/* Finding 7 (P3): breathing room between «Сохранить»/«В архив»/«Вернуть» — see disposal_points_
   views.js, `buildForm`'s `actionsRow` and the archived-card restore button. */
.disposal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.disposal-field-error {
  margin-top: 4px;
  color: var(--err);
  font-size: 12px;
}
.disposal-field-error:empty {
  display: none;
}
.disposal-conflict {
  padding: 12px;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.disposal-coord-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

/* --- поле адреса с подсказками DaData (Шаг 4 — виджет, здесь — стили) ----- */
.disposal-address {
  position: relative;
  width: 100%;
}
.disposal-address-input {
  width: 100%;
}
.disposal-address-pop {
  position: absolute;
  z-index: 2;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.disposal-address-option {
  padding: 8px 12px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.disposal-address-option[aria-selected="true"] {
  background: var(--blue-wash);
}
.disposal-address-hint {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}
.disposal-address-note {
  padding: 8px 12px;
  color: var(--ink-2);
  font-size: 13px;
}

@media (max-width: 600px) {
  .disposal-screen {
    padding: 16px;
  }
  .disposal-totals {
    grid-template-columns: 1fr;
  }
  .disposal-filters label {
    flex: 1 1 140px;
    min-width: 0;
  }
  .disposal-filters select,
  /* N3 (code review, cycle 2): the search text input never got the same `width: 100%` rule as
     `select` above, so it kept its intrinsic ~194px width while its label shrank to `flex: 1 1
     140px` — at 390px the compact «Показать архив» checkbox label (`.disposal-check`, `inline-
     flex`, immediately above) ended up drawn over the still-wide search box's right edge. */
  .disposal-filters input:not([type="checkbox"]) {
    width: 100%;
    max-width: 100%;
  }
  .disposal-total {
    gap: 6px;
  }
  .disposal-table th,
  .disposal-table td {
    padding: 8px;
  }
  .disposal-card-section dl {
    grid-template-columns: minmax(0, 1fr);
  }
  .disposal-card-header {
    gap: 8px;
  }
}

/* Shared states use absolute positioning elsewhere; this page keeps them in
   document flow so loading/empty/error cannot cover filters or navigation. */
.disposal-screen .state {
  position: static;
  min-height: 180px;
}
