/* CRM Analytics readability correction V4 — presentation only.
   Scope: analytics page. No data, tasks, banking, FNS or API changes. */
body:has(#analyticsSection.active) #vkQualityEntryStableV3 {
  display:inline-flex!important;
  visibility:visible!important;
  font-size:13px!important;
  line-height:1.35!important;
}
#analyticsSection {
  min-width:0!important;
  box-sizing:border-box;
}
#analyticsSection > :is(div,section,article):not(#vkQualityPanelV2):not(#vkQualityTopV2),
#analyticsSection > .lead-statistics-page,
#analyticsSection > .analytics-page-121055,
#analyticsSection > #analyticsTruthV2,
#analyticsSection .at2-shell {
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box;
}
#analyticsSection :is(.analytics-hero-121055,.at2-hero) {
  max-width:none;
}
/* Main analytics typography: originally several KPI labels were 8px. */
#analyticsSection .at2-shell {
  padding:15px 6px 30px!important;
  font-size:13px!important;
  line-height:1.5!important;
  color:#18304e;
}
#analyticsSection .at2-shell :is(p,small,span,em,b,strong,label,th,td,button) {
  overflow-wrap:break-word;
  word-break:normal;
}
#analyticsSection .at2-hero {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px 22px;
  padding:18px 20px!important;
  border-radius:14px;
}
#analyticsSection .at2-hero h1 {
  font-size:23px!important;
  line-height:1.22!important;
  margin:5px 0 6px;
}
#analyticsSection .at2-hero p,
#analyticsSection .at2-section-title p {
  font-size:12px!important;
  line-height:1.5!important;
}
#analyticsSection .at2-hero>div>span,
#analyticsSection .at2-section-title>span {
  font-size:10px!important;
  letter-spacing:.04em;
}
#analyticsSection .at2-live {
  min-width:148px;
  flex-shrink:0;
}
#analyticsSection .at2-live small,
#analyticsSection .at2-live b {
  font-size:11px!important;
  line-height:1.4!important;
}
#analyticsSection .at2-filterbar {
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:end;
  gap:11px!important;
  padding:13px 15px!important;
}
#analyticsSection .at2-filterbar label {
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:11px!important;
  line-height:1.35!important;
  letter-spacing:0!important;
  text-transform:none!important;
  font-weight:700;
  min-width:125px;
  flex:0 1 auto;
}
#analyticsSection .at2-filterbar :is(input,select,button),
#analyticsSection .at2-presets button,
#analyticsSection .at2-refresh {
  font-size:12px!important;
  min-height:34px;
  line-height:1.3!important;
  white-space:normal;
}
#analyticsSection .at2-filterbar :is(input,select) {
  min-width:112px!important;
  max-width:260px;
}
#analyticsSection .at2-presets {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
#analyticsSection .at2-tabs {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  padding:7px;
  min-width:0;
}
#analyticsSection .at2-tabs button {
  font-size:12px!important;
  line-height:1.35!important;
  padding:9px 12px;
  min-height:35px;
}
#analyticsSection .at2-section-title {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:10px 18px;
  margin:12px 0 10px;
}
#analyticsSection .at2-section-title h2 {font-size:19px!important;line-height:1.28!important;}
#analyticsSection .at2-section-title h3 {font-size:16px!important;line-height:1.35!important;}
#analyticsSection .at2-section-title>b {font-size:12px!important;line-height:1.4!important;}
/* Cards become readable rather than 7 microscopic cards in one row. */
#analyticsSection .at2-grid {
  display:grid;
  gap:12px!important;
  min-width:0;
}
#analyticsSection .at2-grid.primary,
#analyticsSection .at2-grid.secondary,
#analyticsSection .at2-grid.outcomes {
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
#analyticsSection .at2-kpi {
  min-width:0;
  min-height:93px;
  padding:14px 16px!important;
  border-radius:12px;
  text-align:left;
}
#analyticsSection .at2-kpi-top {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:flex-start;
  justify-content:space-between;
}
#analyticsSection .at2-kpi-top>b {
  font-size:12px!important;
  line-height:1.4!important;
  font-weight:700;
}
#analyticsSection .at2-kpi strong {
  display:block;
  font-size:25px!important;
  line-height:1.2!important;
  margin:6px 0!important;
}
#analyticsSection .at2-kpi small {
  display:block;
  font-size:11px!important;
  line-height:1.5!important;
}
#analyticsSection .at2-cardblock {
  padding:16px 18px!important;
  border-radius:13px;
  min-width:0;
  max-width:100%;
}
#analyticsSection .at2-cardblock :is(h2,h3) {line-height:1.35!important;}
#analyticsSection .at2-quality {
  max-width:100%;
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
  line-height:1.5!important;
  font-size:11px!important;
  padding:9px 12px;
}
#analyticsSection .at2-quality small {
  display:inline;
  line-height:1.5!important;
  font-size:10px!important;
  overflow-wrap:anywhere;
}
/* Single-day trend legend and chart were compacted into an unreadable line. */
#analyticsSection .at2-chart {
  height:auto!important;
  min-height:0;
  min-width:0;
  width:100%;
  padding:10px 2px 16px;
  font-size:12px!important;
  line-height:1.65!important;
}
#analyticsSection .at2-chart:has(svg){min-height:235px;}
#analyticsSection .at2-chart svg {
  width:100%;
  height:auto;
  min-height:190px;
  max-height:330px;
  overflow:hidden;
  display:block;
}
#analyticsSection .at2-chart :is(p,small,span,div) {
  font-size:12px!important;
  line-height:1.6!important;
}
#analyticsSection .at2-legend {
  display:flex!important;
  justify-content:flex-start!important;
  align-items:center;
  flex-wrap:wrap!important;
  gap:8px 15px!important;
  min-width:0;
  margin-top:12px;
}
#analyticsSection .at2-legend span {
  display:inline-flex!important;
  align-items:center;
  flex-wrap:nowrap;
  gap:6px;
  font-size:12px!important;
  line-height:1.5!important;
  white-space:normal;
  margin:0;
  padding:6px 9px;
  border:1px solid #e2e9f5;
  border-radius:8px;
  background:#f7faff;
}
#analyticsSection .at2-legend i {flex:0 0 9px;width:9px;height:9px;}
#analyticsSection .at2-funnel {gap:10px;}
#analyticsSection .at2-step {grid-template-columns:minmax(180px,1fr) 90px minmax(100px,2fr);gap:12px;min-height:60px;}
#analyticsSection .at2-step b,
#analyticsSection .at2-step small,
#analyticsSection .at2-step>div span {font-size:12px!important;line-height:1.45!important;}
#analyticsSection .at2-step strong {font-size:22px!important;}
#analyticsSection .at2-stack {display:flex;flex-wrap:wrap;gap:8px;}
#analyticsSection .at2-stack button {font-size:12px!important;line-height:1.4!important;min-height:38px;}
#analyticsSection .at2-stack button :is(span,b) {font-size:12px!important;line-height:1.4!important;}
#analyticsSection .at2-tablewrap {overflow-x:auto;max-width:100%;}
#analyticsSection .at2-table {width:100%;font-size:12px!important;}
#analyticsSection .at2-table th {font-size:11px!important;line-height:1.5!important;padding:10px 12px!important;white-space:normal;}
#analyticsSection .at2-table td {font-size:12px!important;line-height:1.5!important;padding:10px 12px!important;}
#analyticsSection .at2-table td small {font-size:11px!important;line-height:1.4!important;}
#analyticsSection .at2-truthbox {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:13px;}
#analyticsSection .at2-truthbox>b {font-size:12px!important;}
#analyticsSection .at2-truthbox span {font-size:11px!important;line-height:1.55!important;overflow-wrap:anywhere;}
#analyticsSection .at2-miniout {gap:7px;}
#analyticsSection .at2-miniout span {font-size:11px!important;line-height:1.5!important;}
#analyticsSection .at2-speedgrid {gap:11px;}
#analyticsSection .at2-speed :is(span,small) {font-size:11px!important;line-height:1.5!important;}
#analyticsSection .at2-speed strong {font-size:20px!important;}
#analyticsSection .at2-helpbox {font-size:13px!important;line-height:1.5!important;}
#analyticsSection .at2-helpbox :is(p,dt,dd,span) {font-size:12px!important;line-height:1.5!important;}
/* Improve legibility of the summary fact cards and table without assuming data shape. */
#analyticsSection .analytics-page-121055,
#analyticsSection .lead-statistics-page {font-size:13px;line-height:1.45;}
#analyticsSection :is(.analytics-page-121055,.lead-statistics-page) :is(table, .data-table) {max-width:100%;}
#analyticsSection :is(.analytics-page-121055,.lead-statistics-page) :is(th,td) {line-height:1.45;}
/* Responsive, never require horizontal scrolling for KPI cards. */
@media(max-width:1250px) {
  #analyticsSection .at2-grid.primary,
  #analyticsSection .at2-grid.secondary,
  #analyticsSection .at2-grid.outcomes {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:850px) {
  #analyticsSection .at2-grid.primary,
  #analyticsSection .at2-grid.secondary,
  #analyticsSection .at2-grid.outcomes {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #analyticsSection .at2-step {grid-template-columns:minmax(0,1fr) 70px;}
  #analyticsSection .at2-step>:last-child {grid-column:1/-1;}
  #analyticsSection .at2-filterbar label {min-width:120px;}
}
@media(max-width:520px) {
  #analyticsSection .at2-shell {padding:10px 1px 20px!important;}
  #analyticsSection .at2-hero {padding:13px!important;}
  #analyticsSection .at2-hero h1 {font-size:19px!important;}
  #analyticsSection .at2-grid.primary,
  #analyticsSection .at2-grid.secondary,
  #analyticsSection .at2-grid.outcomes {grid-template-columns:minmax(0,1fr)!important;}
  #analyticsSection .at2-truthbox {grid-template-columns:minmax(0,1fr)!important;}
  #analyticsSection .at2-cardblock {padding:12px!important;}
  #analyticsSection .at2-tabs button {padding:8px 9px;}
}
