/* ════════════════════════════════════════════════════════════════
   audit-fixes.css — additive visual fixes (UI audit 2026-05-28).
   Loaded LAST so it overrides. Fully reversible: remove the <link>.
   Scope: contrast (WCAG), density, responsive rail-collapse, polish.
═══════════════════════════════════════════════════════════════ */

/* ── P0.1 Contrast: darken low-contrast text tokens ──
   --muted #98a0b0 (~2.6:1 on white) → ~4.6:1; --faint likewise. */
:root,
[data-theme="light"]{
  --muted: #6b7484;
  --faint: #8e97a6;
  --dim:   #515a6b;
}

/* ── P0.2 Density & readability ── */
body { font-size: 14px; }
/* keep dense tables compact in size but give rows breathing room */
table.dt { font-size: 13px; }
table.dt td, table.dt th { padding-top: 9px; padding-bottom: 9px; }
table.dt tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
table.dt tbody tr:hover td { background: var(--surface-3); }
table.dt-enhanced thead th[data-vision-sort-index] { cursor: pointer; user-select: none; }
table.dt-enhanced thead th[data-vision-sort-index]:hover { color: var(--accent); }
table.dt-enhanced thead th.sort-asc::after { content: " ↑"; color: var(--accent); }
table.dt-enhanced thead th.sort-desc::after { content: " ↓"; color: var(--accent); }
.dt-enhancer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}
.dt-enhancer-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dt-enhancer-search {
  min-width: min(360px, 100%);
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dt-enhancer-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.dt-enhancer-search input::placeholder { color: var(--muted); font-weight: 500; }
.dt-enhancer-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.dt-enhancer-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.dt-enhancer-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dt-enhancer-page-size select {
  min-width: 76px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 26px 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.dt-enhancer-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dt-enhancer-report-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}
.dt-enhancer-report-actions .btn {
  min-height: 34px;
  white-space: nowrap;
}
.dt-enhancer-report-actions .i {
  width: 15px;
  height: 15px;
}
.tn-report-viewbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 0 1 390px;
  min-width: 300px;
  gap: 8px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
}
.tn-report-view-select {
  min-width: 160px;
  flex: 1 1 210px;
  display: grid;
  gap: 4px;
}
.tn-report-view-select > span {
  color: var(--dim);
  font-size:  12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tn-report-view-select select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 28px 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}
.tn-report-view-actions {
  display: inline-flex;
  gap: 6px;
}
.tn-report-view-actions .btn {
  min-height: 34px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .tn-report-viewbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    min-width: 0;
    width: 100%;
    margin-left: 0;
  }
  .tn-report-view-select { min-width: 0; width: 100%; }
  .tn-report-view-actions { justify-content: flex-end; }
}
.dt-enhancer-pager .btn[disabled] {
  cursor: not-allowed;
  opacity: .48;
}
.dt-page-hidden { display: none !important; }
/* Filter chips share the same control model; the field remains a native select. */
.dt-enhancer-column-filters { display:flex; flex-wrap:wrap; align-items:center; width:100%; gap:6px; padding:8px 0; border:0; background:transparent; }
.dt-enhancer-filter-details { width:100%; }
.dt-enhancer-filter-details > summary { display:flex; align-items:center; justify-content:space-between; min-height:32px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; color:var(--dim); cursor:pointer; font-size:12px; font-weight:600; }
.dt-enhancer-filter-details[open] > summary { margin-bottom:6px; }
.dt-enhancer-column-title { display:inline-flex; align-items:center; min-height:32px; color:var(--dim); font-size:12px; font-weight:600; margin-right:2px; }
.dt-enhancer-column-filter { display:inline-flex; align-items:center; min-width:0; max-width:100%; gap:0; padding-left:10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 1px 2px #102a2010; }
.dt-enhancer-column-filter span { min-width:0; max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dim); font-size:12px; font-weight:500; }
.dt-enhancer-column-filter span::after { content: ":"; margin-right:2px; }
.dt-enhancer-column-filter select { width:auto; max-width:210px; min-height:32px; border:0; border-radius:0 8px 8px 0; background:transparent; color:var(--text); padding:4px 26px 4px 6px; font:inherit; font-size:12px; font-weight:600; }
.dt-enhancer-column-filter:has(option:checked:not([value=""])) { border-color:var(--accent-line); background:var(--accent-soft); }
.dt-enhancer-column-filter:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.dt-enhancer-column-filter.is-empty { box-shadow:none; background:var(--surface-2); }
.dt-enhancer-column-filter select:disabled { color:var(--muted); cursor:not-allowed; }
@media(max-width:620px) { .dt-enhancer-column-filter { max-width:100%; flex:1 1 160px; } .dt-enhancer-column-filter span { max-width:45%; } .dt-enhancer-column-filter select { min-width:0; flex:1; min-height:40px; } }
.dt-enhancer-reset {
  min-height: 34px;
  margin-left: auto;
  white-space: nowrap;
}
.dt-filter-hidden { display: none !important; }
.t-dim { color: var(--dim); }

/* ── Calls / conversations operational reports ── */
.calls-ops .grid-2 {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.calls-ops .grid-2 > * { min-width: 0; }
.calls-ops .dt-wrap { max-width: 100%; }
.conversations-new-view .grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.conversations-new-view .grid-2 > * { min-width: 0; }
.conversations-new-view .dt-wrap { max-width: 100%; }
.conversations-new-view .calls-report-pair {
  align-items: start;
}
.today-new-view .grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.today-new-view .grid-2 > * { min-width: 0; }
.today-new-view,
.team-new-view,
.conversations-new-view,
.customers-new-view,
.archi-control-view,
.card{
  min-width: 0;
}
.today-new-view .dt-wrap,
.team-new-view .dt-wrap,
.conversations-new-view .dt-wrap,
.customers-new-view .dt-wrap,
.archi-control-view .dt-wrap,
.new-contour .dt-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.today-new-view .dt-wrap > table.dt,
.team-new-view .dt-wrap > table.dt,
.conversations-new-view .dt-wrap > table.dt,
.customers-new-view .dt-wrap > table.dt,
.archi-control-view .dt-wrap > table.dt,
.new-contour .dt-wrap > table.dt {
  width: max-content;
  min-width: 100%;
  max-width: none;
}
.today-new-view .dt-wrap > table.dt.tn-deals-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.tn-deals-table th,
.tn-deals-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tn-deals-table th:nth-child(1) { width: 20%; }
.tn-deals-table th:nth-child(2) { width: 17%; }
.tn-deals-table th:nth-child(3) { width: 13%; }
.tn-deals-table th:nth-child(4) { width: 14%; }
.tn-deals-table th:nth-child(5) { width: 14%; }
.tn-deals-table th:nth-child(6) { width: 22%; }
.team-command-kpis .compact-metric {
  flex: 1 1 150px;
}
.lead-command-kpis .compact-metric {
  flex: 1 1 150px;
}
.summary-command-kpis .compact-metric {
  flex: 1 1 140px;
}
.control-command-kpis .compact-metric {
  flex: 1 1 150px;
}
#commercialControlRoot .dt-wrap > table.dt {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
#commercialControlRoot table.dt th,
#commercialControlRoot table.dt td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.team-new-view .dt-wrap > table.dt.team-workload-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.team-workload-table th,
.team-workload-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.team-new-view .dt-wrap > table.dt.planned-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.planned-review-table th,
.planned-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.planned-review-table th:first-child { width: 19%; }
.team-workload-table th:nth-child(1) { width: 19%; }
.team-workload-table th:nth-child(2) { width: 12%; }
.team-workload-table th:nth-child(3) { width: 13%; }
.team-workload-table th:nth-child(4) { width: 17%; }
.team-workload-table th:nth-child(5) { width: 17%; }
.team-workload-table th:nth-child(6) { width: 22%; }
.today-new-view .dt-wrap > table.dt.lead-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.lead-review-table th,
.lead-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.lead-review-table th:nth-child(1) { width: 21%; }
.lead-review-table th:nth-child(2) { width: 17%; }
.lead-review-table th:nth-child(3) { width: 14%; }
.lead-review-table th:nth-child(4) { width: 13%; }
.lead-review-table th:nth-child(5) { width: 14%; }
.lead-review-table th:nth-child(6) { width: 21%; }
/* Each line in the lead/deal review cells is a separate target. Neutralize the
   generic negative-margin drill target only in these two operational tables so
   adjacent identity/status/action lines never share a clickable hit region. */
:is(.lead-review-table, .tn-deals-table) td > a,
:is(.lead-review-table, .tn-deals-table) td > .tn-cell-drill,
:is(.lead-review-table, .tn-deals-table) td > div > a,
:is(.lead-review-table, .tn-deals-table) td > .sub > .tn-cell-drill {
  display: block;
  margin: 0;
  padding: 2px 0;
  line-height: 1.35;
}
:is(.lead-review-table, .tn-deals-table) td > .sub,
:is(.lead-review-table, .tn-deals-table) td > .tn-cell-drill + div { margin-top: 4px; }
.today-new-view .dt-wrap > table.dt.top-actions-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.top-actions-table th,
.top-actions-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.top-actions-table th:nth-child(1) { width: 8%; }
.top-actions-table th:nth-child(2) { width: 29%; }
.top-actions-table th:nth-child(3) { width: 18%; }
.top-actions-table th:nth-child(4) { width: 37%; }
.top-actions-table th:nth-child(5) { width: 8%; }
.today-new-view .dt-wrap > table.dt.queue-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.queue-review-table th,
.queue-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.queue-review-table th:nth-child(1) { width: 21%; }
.queue-review-table th:nth-child(2) { width: 12%; }
.queue-review-table th:nth-child(3) { width: 10%; }
.queue-review-table th:nth-child(4) { width: 24%; }
.queue-review-table th:nth-child(5) { width: 14%; }
.queue-review-table th:nth-child(6) { width: 19%; }
.queue-review-table .tn-action-controls { display: flex; flex-wrap: wrap; }
.today-new-view .dt-wrap > table.dt.customer-registry-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.customer-registry-table th,
.customer-registry-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.customer-registry-table th:nth-child(1) { width: 30%; }
.customer-registry-table th:nth-child(2) { width: 15%; }
.customer-registry-table th:nth-child(3) { width: 17%; }
.customer-registry-table th:nth-child(4) { width: 9%; }
.customer-registry-table th:nth-child(5) { width: 12%; }
.customer-registry-table th:nth-child(6) { width: 17%; }
.customers-new-view .dt-wrap > table.dt.actualization-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.actualization-review-table th,
.actualization-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.actualization-review-table th:nth-child(1) { width: 20%; }
.actualization-review-table th:nth-child(2) { width: 20%; }
.actualization-review-table th:nth-child(3) { width: 13%; }
.actualization-review-table th:nth-child(4) { width: 23%; }
.actualization-review-table th:nth-child(5) { width: 12%; }
.actualization-review-table th:nth-child(6) { width: 12%; }
.customers-new-view .dt-wrap > table.dt.classification-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.classification-review-table th,
.classification-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.classification-review-table th:nth-child(1) { width: 24%; }
.classification-review-table th:nth-child(2) { width: 19%; }
.classification-review-table th:nth-child(3) { width: 22%; }
.classification-review-table th:nth-child(4) { width: 21%; }
.classification-review-table th:nth-child(5) { width: 14%; }
.customers-new-view .dt-wrap > table.dt.ltv-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.ltv-review-table th,
.ltv-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.ltv-review-table th:nth-child(1) { width: 36%; }
.ltv-review-table th:nth-child(2) { width: 25%; }
.ltv-review-table th:nth-child(3) { width: 24%; }
.ltv-review-table th:nth-child(4) { width: 15%; }
.brief-section .dt-wrap > table.dt.openlines-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.openlines-review-table th,
.openlines-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.openlines-review-table th:nth-child(1) { width: 24%; }
.openlines-review-table th:nth-child(2) { width: 28%; }
.openlines-review-table th:nth-child(3) { width: 24%; }
.openlines-review-table th:nth-child(4) { width: 10%; }
.openlines-review-table th:nth-child(5) { width: 14%; }
.conversations-new-view .dt-wrap > table.dt.missed-managers-review-table,
.conversations-new-view .dt-wrap > table.dt.missed-details-review-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.missed-managers-review-table th,
.missed-managers-review-table td,
.missed-details-review-table th,
.missed-details-review-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.missed-managers-review-table th:nth-child(1) { width: 25%; }
.missed-managers-review-table th:nth-child(2) { width: 27%; }
.missed-managers-review-table th:nth-child(3) { width: 23%; }
.missed-managers-review-table th:nth-child(4) { width: 25%; }
.missed-details-review-table th:nth-child(1) { width: 32%; }
.missed-details-review-table th:nth-child(2) { width: 20%; }
.missed-details-review-table th:nth-child(3) { width: 25%; }
.missed-details-review-table th:nth-child(4) { width: 23%; }
.conversations-new-view .dt-wrap > table.dt.conversation-quality-evidence-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.conversation-quality-evidence-table th,
.conversation-quality-evidence-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.conversation-quality-evidence-table th:nth-child(1) { width: 29%; }
.conversation-quality-evidence-table th:nth-child(2) { width: 20%; }
.conversation-quality-evidence-table th:nth-child(3) { width: 24%; }
.conversation-quality-evidence-table th:nth-child(4) { width: 27%; }
.conversations-new-view .dt-wrap > table.dt.conversation-intelligence-queue-table,
.conversations-new-view .dt-wrap > table.dt.conversation-intelligence-scorecard-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.conversation-intelligence-scorecard-table th,
.conversation-intelligence-scorecard-table td{
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.conversation-intelligence-scorecard-table th:nth-child(1) { width: 27%; }
.conversation-intelligence-scorecard-table th:nth-child(2) { width: 24%; }
.conversation-intelligence-scorecard-table th:nth-child(3) { width: 25%; }
.conversation-intelligence-scorecard-table th:nth-child(4) { width: 24%; }
.today-new-view .dt-wrap > table.dt.funnel-balance-summary-table,
.today-new-view .dt-wrap > table.dt.funnel-balance-details-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.funnel-balance-summary-table th,
.funnel-balance-summary-table td,
.funnel-balance-details-table th,
.funnel-balance-details-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.funnel-balance-summary-table th:nth-child(1) { width: 20%; }
.funnel-balance-summary-table th:nth-child(2) { width: 23%; }
.funnel-balance-summary-table th:nth-child(3) { width: 23%; }
.funnel-balance-summary-table th:nth-child(4) { width: 14%; }
.funnel-balance-summary-table th:nth-child(5) { width: 20%; }
.funnel-balance-details-table th:nth-child(1) { width: 26%; }
.funnel-balance-details-table th:nth-child(2) { width: 24%; }
.funnel-balance-details-table th:nth-child(3) { width: 19%; }
.funnel-balance-details-table th:nth-child(4) { width: 18%; }
.funnel-balance-details-table th:nth-child(5) { width: 13%; }
.today-new-view .dt-wrap > table.dt.funnel-sources-summary-table,
.today-new-view .dt-wrap > table.dt.funnel-sources-details-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.funnel-sources-summary-table th,
.funnel-sources-summary-table td,
.funnel-sources-details-table th,
.funnel-sources-details-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.funnel-sources-summary-table th:nth-child(1) { width: 18%; }
.funnel-sources-summary-table th:nth-child(2) { width: 23%; }
.funnel-sources-summary-table th:nth-child(3) { width: 22%; }
.funnel-sources-summary-table th:nth-child(4) { width: 22%; }
.funnel-sources-summary-table th:nth-child(5) { width: 15%; }
.funnel-sources-details-table th:nth-child(1) { width: 24%; }
.funnel-sources-details-table th:nth-child(2) { width: 22%; }
.funnel-sources-details-table th:nth-child(3) { width: 18%; }
.funnel-sources-details-table th:nth-child(4) { width: 19%; }
.funnel-sources-details-table th:nth-child(5) { width: 17%; }
.calls-ops table.dt a{
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}
.calls-ops table.dt a:hover{ text-decoration: underline; }

@media (max-width: 1500px) {
  .conversations-new-view .calls-report-pair--wide {
    grid-template-columns: minmax(0, 1fr);
  }
}
.calls-bubble {
  width: var(--size, 64px);
  min-width: var(--size, 64px);
  height: var(--size, 64px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff4b1f, #f4a000);
  color: #fff;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(240, 68, 37, .16);
}
.calls-bubble b {
  max-width: calc(var(--size, 64px) - 12px);
  overflow: hidden;
  font-size: 16px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calls-bubble span {
  max-width: calc(var(--size, 64px) - 12px);
  overflow: hidden;
  font-size:  12px;
  font-weight: 750;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── P0.3 Loading/empty polish ── */
@keyframes af-shimmer { 0%{opacity:.5} 50%{opacity:1} 100%{opacity:.5} }
.registry-sk-row { animation: af-shimmer 1.2s ease-in-out infinite; }

/* ── Responsive: collapse the 380px action rail on narrow viewports ──
   The app already supports `.app.no-inbox`; the manual toggle (#inboxToggleBtn)
   still works to re-open. Below 1280px the center gets the full width. */
@media (max-width: 1280px){
  .app { grid-template-columns: 232px minmax(0,1fr) !important; }
  .app > .inbox { display: none !important; }
  .inbox-toggle-btn { display: inline-flex !important; }
}
/* Mid: trim rail a touch on 1281–1440 to give center more room */
@media (min-width: 1281px) and (max-width: 1440px){
  .app { grid-template-columns: 232px minmax(0,1fr) 320px; }
}
/* Small: keep the production mobile bottom-bar from shell.css.
   The old 64px side-rail override squeezed every page on phones and broke
   the Bitrix-like mobile affordance, so this layer must not reintroduce it. */
@media (max-width: 980px){
  .app { grid-template-columns: minmax(0,1fr) !important; }
  .app > .inbox { display: none !important; }
  .side { width: auto !important; overflow: visible; }
  .dt-enhancer-main,
  .dt-enhancer-controls {
    align-items: stretch;
    justify-content: flex-start;
  }
  .dt-enhancer-search,
  .dt-enhancer-controls,
  .dt-enhancer-pager {
    width: 100%;
  }
  .dt-enhancer-pager {
    justify-content: space-between;
  }
  .calls-ops .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .conversations-new-view .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .today-new-view .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Focus visibility (a11y) ── */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ring-accent);
  outline-offset: 2px;
}

/* NEW drilldown journals keep business status and actions readable. */
.tns-modal .dt .tns-modal-status {
  min-width: 154px;
}
.tns-modal .dt .tns-modal-status .pill {
  margin: 2px 3px 2px 0;
  white-space: nowrap;
}
.tns-modal .dt .tns-modal-action {
  min-width: 112px;
  white-space: nowrap;
}
.tns-modal .dt .tns-modal-action .sub {
  margin-top: 5px;
}
.tns-modal .dt .tns-modal-action .btn-xs {
  white-space: nowrap;
}

/* Controlled CRM cleanup report. */
.cleanup-filter-grid {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(190px, .9fr) minmax(240px, 1.3fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.cleanup-filter-grid .fl { min-width: 0; display: grid; gap: 6px; }
.cleanup-filter-grid .btn { min-height: 42px; }
.cleanup-kpis { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.cleanup-kpi { position: relative; text-align: left; }
.cleanup-kpi .lbl,
.cleanup-kpi .big,
.cleanup-kpi .sub { display: block; }
.cleanup-kpi .big { margin: 8px 0 5px; }
.cleanup-kpi.bad { border-color: color-mix(in srgb, var(--bad) 42%, var(--line)); }
.today-new-view .cleanup-review-card .dt-wrap > table.dt {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.cleanup-review-card .dt th,
.cleanup-review-card .dt td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cleanup-review-card .dt th:first-child { width: 10%; }
.cleanup-review-card .dt th:nth-child(2) { width: 22%; }
.cleanup-review-card .dt th:nth-child(3) { width: 15%; }
.cleanup-review-card .dt th:nth-child(4) { width: 11%; }
.cleanup-review-card .dt th:nth-child(5) { width: 30%; }
.cleanup-review-card .dt th:last-child,
.cleanup-review-card .dt td:last-child {
  width: 12%;
}
.cleanup-actions {
  display: grid;
  gap: 5px;
  white-space: normal;
}
.cleanup-actions .btn,
.cleanup-actions .btn-xs {
  width: 100%;
  margin: 0;
  justify-content: center;
  text-align: center;
}
.cleanup-decision-modal { z-index: 10040; }
.cleanup-decision-modal .manager-modal { width: min(720px, calc(100vw - 32px)); }
.cleanup-decision-evidence { margin: 14px 0; }
.cleanup-decision-evidence p { margin: 8px 0; }
.cleanup-decision-modal .md-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 980px) {
  .cleanup-filter-grid { grid-template-columns: 1fr; }
  .cleanup-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ARCHI follows the same hierarchy and navigation rhythm as the NEW contours. */
.archi-control-view .new-contour-nav {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 8px);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.archi-control-view .new-contour-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.archi-control-view .new-contour-title .i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent);
}
.archi-control-view .new-contour-title b {
  font-size: var(--fs-15);
  color: var(--text);
}
.archi-control-view .new-contour-title span {
  color: var(--dim);
  font-size: var(--fs-12);
  line-height: 1.45;
}
.archi-control-view .new-contour-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.archi-control-view .new-contour-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md, 8px);
  background: var(--surface);
  color: var(--dim);
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}
.archi-control-view .new-contour-tabs a:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.archi-control-view .new-contour-tabs a.active {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.archi-control-view > .kpi-grid {
  margin-top: 16px;
}
.archi-control-view .dt code {
  display: block;
  max-width: 440px;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size:  12px;
  line-height: 1.45;
}

/* Dense management reports scroll instead of collapsing headings and filters. */
.view--burnout-watch .dt-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.view--burnout-watch table.dt {
  min-width: 1160px;
  table-layout: auto;
}
.view--burnout-watch table.dt th {
  white-space: normal;
  line-height: 1.35;
}
.view--burnout-watch table.dt th:nth-child(1) { min-width: 190px; }
.view--burnout-watch table.dt th:nth-child(2) { min-width: 140px; }
.view--burnout-watch table.dt th:nth-child(3) { min-width: 200px; }
.view--burnout-watch table.dt th:nth-child(4),
.view--burnout-watch table.dt th:nth-child(5),
.view--burnout-watch table.dt th:nth-child(6) { min-width: 145px; }
.view--burnout-watch table.dt th:last-child { min-width: 92px; }

/* Operational NEW dashboards must look complete as soon as API data arrives. */
.today-new-view .kpi-grid.stagger > *,
.team-new-view .kpi-grid.stagger > *,
.conversations-new-view .kpi-grid.stagger > *,
.customers-new-view .kpi-grid.stagger > *,
.archi-control-view .kpi-grid.stagger > * {
  animation: none;
}

/* Calls NEW: one executive report per screen, compact filters, fast scanning. */
.conversations-new-view .today-new-entity-toolbar {
  padding: 14px 16px;
}
.conversations-new-view .today-new-entity-toolbar .tn-report-viewbar {
  display: none;
}
.conversations-new-view .calls-filter-grid {
  gap: 9px;
}
.conversations-new-view .calls-filter-grid--main {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}
.conversations-new-view .calls-filter-grid--main .tn-filter-actions {
  grid-column: 1 / -1;
  align-self: end;
  justify-content: flex-end;
  white-space: nowrap;
}
.conversations-new-view .calls-filter-search input {
  min-width: 0;
}
.calls-advanced-filters {
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--r-md, 8px);
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}
.calls-advanced-filters summary {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--dim);
  font-size: var(--fs-12);
  font-weight: 700;
  list-style: none;
  text-transform: uppercase;
  letter-spacing: 0;
}
.calls-advanced-filters summary::-webkit-details-marker {
  display: none;
}
.calls-advanced-filters summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .7;
}
.calls-advanced-filters[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}
.calls-advanced-filters summary b {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.calls-advanced-filters .calls-filter-grid--advanced {
  padding: 0 12px 12px;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
}
/* View navigation: content-sized controls in one desktop row. */
.calls-report-tabs-card { padding: 0; min-width: 0; }
.calls-report-tabs-card .card-hd { margin-bottom: 8px; }
.ui-view-tabs.chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  /* Контракт навигации: зазор 6px, цель 34px. Замер 12.09.2026 на живом
     АРМ цен давал 3px и 32px — ширины и шрифт уже соответствовали. */
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 0 7px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--line);
}
.ui-view-tabs.chips > .chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--dim);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}
.ui-view-tabs.chips > .chip:hover {
  color: var(--text);
  background: var(--surface-2);
}
.ui-view-tabs.chips > .chip.on {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  font-weight: 650;
  box-shadow: none;
}
.ui-view-tabs.chips > .chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.calls-report-screen {
  display: grid;
  gap: 12px;
}
.calls-report-screen-hd {
  padding: 0 4px;
}
.calls-report-screen > .card,
.calls-report-screen .calls-report-pair > .card {
  margin-top: 0;
}
.calls-report-pair--wide {
  align-items: start;
}
.calls-exec-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr);
  gap: 14px;
}
.calls-exec-hero {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 96%, white);
}
.calls-exec-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.calls-exec-metric {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--r-md, 8px);
  background: color-mix(in srgb, var(--surface) 94%, white);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(22, 32, 28, .06);
}
.calls-exec-metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--r-md, 8px) var(--r-md, 8px) 0 0;
  background: var(--accent);
  opacity: .72;
}
.calls-exec-metric.is-warn::before { background: #d59a2b; }
.calls-exec-metric.is-bad::before { background: #d96b64; }
.calls-exec-metric.is-good::before { background: #53b58d; }
.calls-exec-metric span {
  color: var(--dim);
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calls-exec-metric b {
  color: var(--text);
  font-family: var(--font-serif, inherit);
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: 0;
}
.calls-exec-metric em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.25;
}
.calls-exec-metric .i {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  color: var(--accent);
  opacity: .8;
}
.calls-spotlight,
.calls-shortcuts {
  min-width: 0;
}
.calls-spotlight-list {
  display: grid;
  gap: 8px;
}
.calls-spotlight-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--r-md, 8px);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--text);
  text-decoration: none;
}
.calls-spotlight-row:hover,
.calls-shortcut:hover,
.calls-exec-metric:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-1px);
}
.calls-spotlight-row span {
  color: var(--accent);
  font-weight: 800;
}
.calls-spotlight-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: var(--fs-12);
}
.calls-shortcuts {
  grid-column: 1 / -1;
}
.calls-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}
.calls-shortcut {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 13px 36px 13px 13px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: var(--r-md, 8px);
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
  color: var(--text);
  text-decoration: none;
}
.calls-shortcut span {
  color: var(--muted);
  font-size: var(--fs-12);
  line-height: 1.25;
}
.calls-shortcut .i {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.calls-journal-layout {
  display: grid;
  gap: 12px;
}
.calls-journal-hero {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface) 97%, white);
}
.calls-journal-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.calls-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.calls-breakdown-mini {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--r-md, 8px);
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}
.calls-breakdown-mini > b {
  color: var(--text);
  font-size: var(--fs-13);
}
.calls-breakdown-mini a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--text);
  text-decoration: none;
}
.calls-breakdown-mini a:hover span {
  color: var(--accent);
}
.calls-breakdown-mini span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calls-breakdown-mini strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.calls-journal-table td,
.calls-journal-table th {
  white-space: nowrap;
}
.conversations-new-view .dt-wrap > table.calls-journal-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.calls-journal-table th:nth-child(1),
.calls-journal-table td:nth-child(1) { width: 126px; }
.calls-journal-table th:nth-child(2),
.calls-journal-table td:nth-child(2) { width: 190px; }
.calls-journal-table th:nth-child(3),
.calls-journal-table td:nth-child(3) { width: 142px; }
.calls-journal-table th:nth-child(4),
.calls-journal-table td:nth-child(4) { width: 118px; }
.calls-journal-table th:nth-child(5),
.calls-journal-table td:nth-child(5) { width: 128px; }
.calls-journal-table th:nth-child(6),
.calls-journal-table td:nth-child(6) { width: 160px; }
.calls-journal-table th:nth-child(8),
.calls-journal-table td:nth-child(8) { width: 88px; }
.calls-journal-table td,
.calls-journal-table td a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calls-journal-table td a {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}
.conversations-new-view .dt-wrap > table.calls-discipline-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}
.calls-discipline-table th,
.calls-discipline-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calls-discipline-table th:first-child,
.calls-discipline-table td:first-child { width: 220px; }
.calls-discipline-table th:nth-child(2),
.calls-discipline-table td:nth-child(2),
.calls-discipline-table th:nth-child(3),
.calls-discipline-table td:nth-child(3) { width: 96px; }
.calls-discipline-table th:nth-child(4),
.calls-discipline-table td:nth-child(4),
.calls-discipline-table th:nth-child(5),
.calls-discipline-table td:nth-child(5),
.calls-discipline-table th:nth-child(7),
.calls-discipline-table td:nth-child(7) { width: 116px; }
.calls-discipline-table th:nth-child(6),
.calls-discipline-table td:nth-child(6),
.calls-discipline-table th:nth-child(8),
.calls-discipline-table td:nth-child(8) { width: 88px; }
.calls-discipline-table th:nth-child(9),
.calls-discipline-table td:nth-child(9),
.calls-discipline-table th:nth-child(10),
.calls-discipline-table td:nth-child(10) { width: 108px; }

@media (max-width: 1320px) {
  .conversations-new-view .calls-filter-grid--main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .conversations-new-view .calls-filter-grid--main .tn-filter-actions {
    justify-content: flex-start;
  }
  .calls-report-tabs {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
  }
  .calls-exec-layout {
    grid-template-columns: 1fr;
  }
  .calls-exec-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .calls-shortcut-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .calls-journal-kpis,
  .calls-breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calls-advanced-filters .calls-filter-grid--advanced {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .conversations-new-view .calls-filter-grid--main,
  .calls-advanced-filters .calls-filter-grid--advanced {
    grid-template-columns: 1fr;
  }
  .calls-report-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .calls-report-tabs .chip {
    flex: 0 0 auto;
    min-width: 128px;
  }
  .calls-exec-kpis,
  .calls-shortcut-grid,
  .calls-journal-kpis,
  .calls-breakdown-grid {
    grid-template-columns: 1fr;
  }
  .calls-exec-metric {
    min-height: 106px;
  }
  .calls-advanced-filters summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .calls-advanced-filters summary::after {
    position: absolute;
    right: 14px;
  }
}

@media (max-width: 760px) {
  .archi-control-view .new-contour-nav { padding: 15px; }
  .archi-control-view .new-contour-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .archi-control-view .new-contour-title span {
    flex-basis: 100%;
  }
}


/* Реестр сделок: широкая таблица прокручивается внутри себя */
/* Замер до правки: table 1314px, контейнер .dt2 1224px, overflow-x visible у
   всех предков, #body вылезал на 62px. Колонка «Bitrix» была недостижима.
   Рецепт взят с .crm-scroll, где то же самое уже работает. */
.deals-list .dt2,
.deals-list .deals-grid {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}


/* Автопилот: таблица активности менеджеров прокручивается внутри себя */
/* Замер: на #/ops содержимое 1679px в рабочей области 1280px — колонки
   «Проиграно 30д», «План·открытый», «Покрытие», «Действие» уходили за край.
   Таблица .data-table.dt лежит прямо в .ops-loop-board, ни у одного предка
   прокрутки не было. Единственный оставшийся такой экран из 143. */
.ops-loop-board {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}


/* Панели отборов сворачиваются, пока отбор не задан */
/* Замер: три панели по 197px на сводной = 591px до первой цифры при высоте
   рабочей области 982px. Свёрнутая строка занимает 34px. */
.tn-inline-fold {
  border: 1px solid var(--line, #e3dcd1);
  border-radius: 10px;
  background: var(--surface, #fff);
  margin: 0 0 10px;
}
.tn-inline-fold > .tn-inline-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
}
.tn-inline-fold > .tn-inline-summary::-webkit-details-marker { display: none; }
.tn-inline-fold > .tn-inline-summary::after {
  content: "настроить";
  margin-left: auto;
  opacity: .55;
  font-size:  12px;
}
.tn-inline-fold[open] > .tn-inline-summary::after { content: "свернуть"; }
.tn-inline-fold .tn-inline-current { opacity: .7; }
.tn-inline-fold > .tn-inline-filters { border: none; margin: 0; }


/* Плотность строки очереди — гейт ТЗ: одна строка 36–44px, двухстрочная 48–60px.
   Замер 12.09.2026 при 1440x900: строки таблицы очереди были 112px, потому что
   название действия и причина переносились на шесть строк при line-height 18.2px.
   Ограничиваем их двумя строками. Текст не теряется: у каждой ячейки остаётся
   кнопка разбора (.queue-source-explain), которая раскрывает приоритет, причину,
   источник и ожидаемый результат целиком. */
.queue-review-table td:nth-child(1) > div,
.queue-review-table td:nth-child(4) > .queue-source-explain,
.queue-review-table td:nth-child(4) > .sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.queue-review-table td:nth-child(1) > div,
.queue-review-table td:nth-child(4) > .queue-source-explain { -webkit-line-clamp: 2; }
/* Ожидаемый результат — одна строка: это дополнение к причине, а не сама причина.
   Клэмп на нём не срабатывает (внутри свои блочные узлы), поэтому ограничиваем
   высотой; полный текст раскрывает кнопка разбора рядом. */
.queue-review-table td:nth-child(4) > .sub {
  -webkit-line-clamp: 1;
  max-height: 19px;
}

/* Колонка «Работа»: четыре кнопки (Принять / Результат / Карточка / Лента) не
   помещались в 19% ширины и переносились во второй ряд — замер 12.09.2026 дал
   61px содержимого и строку 106px при гейте ТЗ 48–60px для двухстрочной.
   Отдаём колонке 3% от «Причины» и уплотняем сами кнопки. Текст кнопок не
   сокращаем: действие должно читаться словом, а не значком. */
.queue-review-table .tn-action-controls { gap: 4px; align-items: center; }
.queue-review-table .tn-action-controls > * {
  font-size: 12px;
  padding: 4px 8px;
  line-height: 1.25;
  white-space: nowrap;
}

/* Ширины колонок очереди перекомпонованы: «Владелец» и «Срок» короткие, отдаём
   их запас колонке «Работа», чтобы четыре кнопки действия стояли в один ряд.
   Шрифт кнопок возвращён к 12px: ТЗ прямо запрещает уменьшение текста до 10–11px,
   а замер 12.09.2026 показал в этой колонке именно 10px. */
.queue-review-table th:nth-child(2) { width: 10%; }
.queue-review-table th:nth-child(3) { width: 7%; }
.queue-review-table th:nth-child(4) { width: 20%; }
.queue-review-table th:nth-child(6) { width: 28%; }
.today-new-view .queue-review-table td .tn-action-controls button,
.today-new-view .queue-review-table td .tn-action-controls a,
.today-new-view .queue-review-table td .tn-action-controls > * {
  font-size: 12px;
  padding: 4px 7px;
  line-height: 1.3;
  white-space: nowrap;
}
.queue-review-table .tn-action-controls { gap: 4px; }



/* Свёртка конструктора выборки клиентов. Поля отбора убраны под сводку, чтобы
   список клиентов начинался в верхней части экрана: требование ТЗ — первая
   рабочая строка не ниже 420px, до правки она уходила на 1323px.
   Блок раскрывается сам, когда отбор задан (атрибут open ставит презентер). */
.customer-segment-builder-fold > summary,
summary.customer-segment-builder-head { cursor: pointer; list-style: none; }
summary.customer-segment-builder-head::-webkit-details-marker { display: none; }
.customer-segment-builder-fold { margin-top: 10px; }
.customer-segment-builder-fold > summary::after {
  content: "Показать поля отбора";
  margin-left: auto;
  color: var(--accent, #087d68);
  font-size: 12px;
  font-weight: 600;
}
.customer-segment-builder-fold[open] > summary::after { content: "Свернуть поля отбора"; }

/* Плотность таблиц клиентских АРМов. ТЗ задаёт высоту строки 36-60px; замер 12.09 дал
   217px на «Актуализации данных» и 75px на «Классификации» — причина в необрезанном
   многострочном тексте внутри ячеек (пояснения вида «заказ/реализация есть, нет ком…»).
   Строки не прячем и не укорачиваем в данных: ограничиваем показ двумя строками,
   полный текст остаётся в подсказке и в карточке клиента. */
.actualization-review-table td > div,
.actualization-review-table td > span,
.classification-review-table td > div {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.actualization-review-table td .sub,
.classification-review-table td .sub {
  -webkit-line-clamp: 1;
  max-height: 19px;
}
.actualization-review-table td,
.classification-review-table td { vertical-align: top; padding-top: 7px; padding-bottom: 7px; }



/* Плотность «Актуализации данных»: строка была 217px при норме ТЗ 36-60.
   Виновник — плитка-пояснение в колонке «Почему сейчас» высотой 142px:
   у неё длинный текст («заказ/реализация есть, нет коммуникаций…»), и ранее
   заданное -webkit-line-clamp не работало, потому что для него нужен
   display:-webkit-box, а у .pill стоит inline-flex ради выравнивания иконки.
   Ограничиваем высотой с многоточием: полный текст остаётся в подсказке. */
.actualization-review-table td .pill {
  display: block;
  max-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  white-space: normal;
}
/* Ячейка с чекбоксом не должна растягивать строку. */
.actualization-review-table td:first-child { width: 44px; }

/* Строку в 217px держала не плитка, а шестая ячейка: 94 символа голого текста
   («Связаться с клиентом, подтвердить…») в колонке шириной 12 %. Текст без
   обёртки не поддаётся -webkit-line-clamp, поэтому ограничиваем саму ячейку.
   Колонки перераспределены: рекомендация получает больше места, чем 12 %,
   а технические колонки — меньше. */
.actualization-review-table td {
  max-height: 66px;
  overflow: hidden;
}
.actualization-review-table th:nth-child(1) { width: 40px; }
.actualization-review-table th:nth-child(2) { width: 19%; }
.actualization-review-table th:nth-child(3) { width: 17%; }
.actualization-review-table th:nth-child(4) { width: 8%; }
.actualization-review-table th:nth-child(5) { width: 17%; }
.actualization-review-table th:nth-child(6) { width: 14%; }
.actualization-review-table th:nth-child(7) { width: 22%; }

/* Витрина не пересобирается: отличаем «данные часовой давности» от «сборка встала».
   Сервер помечает ответ app_state_cache=stale-fallback, топбар это показывает словами. */
.live.top-live-stuck { color: var(--bad, #b42318); font-weight: 600; }
