/* Customer-only presentation boundary. Shared table behaviour remains authoritative. */
.customers-new-view {
  --new-line:var(--line); --new-muted:var(--muted); --new-surface:var(--surface);
  color:var(--ink); font-variant-numeric:tabular-nums;
}
.customers-new-view #customersNewRoot > .progressive-section > summary,
.customers-new-view .customer-queue-help > summary { padding:9px 12px!important; font-size:11px; }
.customers-new-view .progressive-section { margin-top:8px!important; }
/* Expansion uses the table's attachment contract, never another customer row. */
.customers-new-view .classification-explain-row > td { position:static!important; padding:0!important; background:var(--surface-2)!important; }
.customers-new-view .mk-tabl-karta table.mk-dannye td > .classification-explain-slot {
  display:block!important; width:auto!important; max-width:none!important; max-height:none!important;
  overflow:visible!important; white-space:normal!important; -webkit-line-clamp:unset!important;
}
.customers-new-view .classification-review-table tbody td > div { max-width:none; }
#body .customers-new-view table.mk-dannye.classification-review-table { width:100%!important; min-width:1120px!important; table-layout:fixed!important; }
#body .customers-new-view table.classification-review-table th { width:auto!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Клиент"] { width:18%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Класс / RFM"] { width:15%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Цикл и вовлеченность"] { width:16%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Риск и оплата"] { width:16%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Динамика"] { width:12%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Менеджер"] { width:11%!important; }
#body .customers-new-view table.classification-review-table th[data-table-workspace-label="Экономика"] { width:18%!important; }
#body .customers-new-view table.classification-review-table th.bulk-cell { width:42px!important; min-width:42px!important; }
#body .customers-new-view .classification-review-table :is(th,td) { overflow-wrap:normal!important; word-break:normal!important; hyphens:none!important; }
.customers-new-view .classification-review-table td > div { display:block!important; }
#body .customers-new-view .classification-review-table tr.classification-explain-row > td { padding:0!important; }
.customers-new-view .overview-context-strip { margin:6px 0 14px!important; }

.customers-new-view .cohort-properties { border-color:var(--line); }
.customers-new-view [data-cohort-preview],.customers-new-view [data-control-id="customer.action-source"] { background:var(--accent)!important; color:#fff!important; border-color:var(--accent)!important; }
.customers-new-view .cust360-context-bar { display:flex; align-items:center; justify-content:space-between; padding:4px 0 10px; font-size:11px; color:var(--muted); }
@media(prefers-reduced-motion:reduce) {
  .customers-new-view * {scroll-behavior: auto !important; animation: none !important; transition: none !important;}
}

/* The resolved customer owner opts in. Portals inherit that marker from their
   opener; unrelated CRM, procurement and report surfaces keep their own skin. */
[data-customer-ui] {
  /* The palette belongs to maket.css; this layer owns customer composition only. */
  --customer-ink:var(--ink, #17231f); --customer-muted:var(--muted, #55655f);
  color:var(--customer-ink); font-variant-numeric:tabular-nums;
}
[data-customer-ui="workspace"] { background:var(--ground, #f7faf9); }
[data-customer-ui] :is(.customers-new-view,.crm-workspace) { color:var(--customer-ink); }
[data-customer-ui] :is(th,td).bulk-cell { width:42px!important; min-width:42px!important; max-width:42px!important; padding:8px!important; }
[data-customer-ui] .bulk-cell input[type=checkbox] { width:18px!important; height:18px!important; min-width:18px!important; min-height:18px!important; accent-color:var(--accent, #0f7a64); }
[data-customer-ui] .cust360-origin-context { margin:0 0 12px; border-bottom:1px solid var(--line, #dde7e3); color:var(--muted, #55655f); font-size:12px; }
[data-customer-ui] .cust360-origin-context > summary { cursor:pointer; padding:10px 0; }
/* One frame and one body scroll owner. Existing form/footer and focus contracts
   are untouched; these selectors cannot theme another contour's modal. */
.customer-cross-sell-preview .ui-surface-facts { grid-template-columns:1fr 1fr; }
.customer-cross-sell-preview .customer-preview-evidence { padding:14px 0; font-size:12px; color:var(--muted, #55655f); }
.customer-cross-sell-preview .customer-preview-evidence p { overflow-wrap:anywhere; }
[data-customer-ui] .customer-admin-context { margin:8px 0 14px; font-size:12px; color:var(--muted, #55655f); }
[data-customer-ui] .customer-report-method { margin:10px 0; font-size:12px; color:var(--muted, #55655f); }
[data-customer-ui] .customer-report-method > summary { cursor:pointer; }
[data-customer-ui] .cohort-properties > section { min-width:0; }
[data-customer-ui] .cohort-properties [data-operation-help-content] { min-width:0; max-width:100%; }
[data-customer-ui] .cohort-properties :is(.operation-help-context,.operation-help-tools,.operation-help-list) { min-width:0; max-width:100%; overflow-wrap:anywhere; }
[data-customer-ui] .cohort-properties .operation-help-tools { flex-wrap:wrap; }
[data-customer-ui] .cohort-properties :is(input,select,textarea) { min-width:0; max-width:100%; }
[data-customer-ui] [data-cohort-action-availability] { padding:10px 12px; border-left:3px solid var(--warn,#8b6209); background:var(--warn-soft,#fbf3e2); color:var(--warn-ink,#7a5407); font-size:12px; line-height:1.5; }
[data-customer-ui] #crossSellRoot .cross-sell-table { min-width:1100px!important; }
[data-customer-ui] #crossSellRoot .cross-sell-table td[data-label="Действие"] { min-width:170px; }
[data-customer-ui] #crossSellRoot .cross-sell-table td[data-label="Действие"] button { white-space:normal; min-width:145px; }
/* Natural business minimums apply only before a user has resized the table.
   No nth-child assumptions: bulk insertion and column reorder stay supported. */
[data-customer-ui] table.mk-dannye:not(.mk-resized) th:is([data-table-workspace-label^="Клиент"],[data-table-workspace-label="Партнёр"],[data-table-workspace-label="Вася"],[data-table-workspace-label="Лицо"],[data-mk-kol="srez"]) { min-width:190px; width:220px; }
[data-customer-ui] .mk-dannye input[type=checkbox] { width:18px!important; height:18px!important; min-width:18px!important; min-height:18px!important; accent-color:var(--accent, #0f7a64); }
[data-customer-ui] .sv-arm > .mk-ekran-put,
[data-customer-ui] #svodEkran .mk-ekran-put { display:none; }
[data-customer-ui] .sv-svodka-definition { flex:1; min-width:180px; }
[data-customer-ui] .sv-svodka-definition summary { cursor:pointer; color:var(--muted); }
[data-customer-ui] .sv-svodka-definition-content { display:flex; flex-wrap:wrap; gap:8px 16px; padding-top:10px; }
[data-customer-ui] .customer-presets-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 16px; }
[data-customer-ui] .customer-loading { padding:28px; background:#fff; border:1px solid var(--line, #dde7e3); border-radius:10px; color:var(--muted, #55655f); }
[data-customer-ui] .customer-loading b { color:var(--ink, #17231f); }
#body[data-customer-ui] .mk-dannye :is(th,td).bulk-cell input[type=checkbox] { width:18px!important; height:18px!important; min-width:18px!important; min-height:18px!important; }
[data-customer-ui] .mk-relsa-verh > .mk-listanie { margin-left:auto; }
[data-customer-ui] .customer-overview-method { margin:8px 0; font-size:12px; color:var(--muted, #55655f); }
[data-customer-ui] .customer-overview-method > summary { padding:8px 0; cursor:pointer; }
[data-customer-ui] .customer-report-method > summary { cursor:pointer; padding:8px 0; color:var(--muted, #55655f); font-size:12px; }
[data-customer-ui] .vision-reference-table tbody :is(td[data-vision-heatmap-tone],tr[data-vision-heatmap-tone] > td:first-child) { background-image:none!important; box-shadow:none!important; }
[data-customer-ui] .customer-admin-context { font-size:12px; color:var(--muted, #55655f); margin:0 0 14px; }
#body[data-customer-ui] #customersNewRoot > .customer-report-kpis[hidden] { display:none!important; }
#body[data-customer-ui] .customers-new-view .customer-report-kpis {
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  grid-auto-flow:row;
  gap:8px;
  margin:8px 0 12px;
  padding:0;
  overflow:visible;
}
#body[data-customer-ui] .customers-new-view .customer-report-kpis > .customer-kpi { padding:10px 12px; }
#body[data-customer-ui] .customers-new-view .customer-report-kpis .mk-plitka-stolb {
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  width:100%;
}
#body[data-customer-ui] .customers-new-view .customer-report-kpis .mk-plitka-chislo {
  margin:0;
  font-size:clamp(18px, 2vw, 24px);
  white-space:nowrap;
  overflow-wrap:normal;
  overflow-x:auto;
}
#body[data-customer-ui] .customers-new-view .customer-report-kpis :is(.mk-plitka-imja, .mk-plitka-pod) {
  white-space:normal;
  overflow-wrap:anywhere;
}
/* The report denominator belongs to the result header and stays above the table controls. */
#body[data-customer-ui] [data-customers-new="reports"] #customersNewRoot article.mk-panel > .mk-glavnaja > .mk-levo {
  flex-flow:row wrap;
  align-items:baseline;
  gap:2px 10px;
}
#body[data-customer-ui] [data-customers-new="reports"] #customersNewRoot article.mk-panel > .mk-glavnaja .mk-imja { white-space:normal; }
#body[data-customer-ui] [data-customers-new="reports"] #customersNewRoot article.mk-panel > .mk-glavnaja .mk-pojasnenie {
  position:static;
  flex:0 1 auto;
  width:auto;
  max-width:100%;
  height:auto;
  padding:0;
  border:0;
  background:none;
  box-shadow:none;
  visibility:visible;
  opacity:1;
  overflow:visible;
  white-space:normal;
  overflow-wrap:anywhere;
  -webkit-line-clamp:unset;
}
#body[data-customer-ui] .customer-report-toolbar { display:grid!important; grid-template-columns:minmax(0,.85fr) minmax(0,1.4fr); align-items:start; gap:6px 12px; padding-block:8px; }
#body[data-customer-ui] .customer-report-toolbar > .mk-form { margin:0; gap:10px; }
#body[data-customer-ui] .customer-report-toolbar .tn-filter-search { flex:1 1 180px; }
#body[data-customer-ui] .customer-report-toolbar .mk-detail-actions { margin:0; }
#body[data-customer-ui] .customer-report-toolbar > [aria-label="Уровень агрегации"] { grid-column:1/-1; order:3; justify-content:flex-start; }
#body[data-customer-ui] .customer-report-toolbar > .customer-report-picker[open] { grid-column:1/-1; }
@media(max-width:1100px) {
  #body[data-customer-ui] .customer-report-toolbar { grid-template-columns:minmax(0,1fr); }
}
.customer-risk-row td:first-child{min-width:220px;max-width:340px;white-space:normal;overflow-wrap:break-word}
.customer-risk-row td:first-child a{display:block;max-width:100%;white-space:normal;overflow-wrap:break-word}
