/* Statistics views share domestic colors and controls, while each module uses its own visual grammar. */
.stats-visual { padding: 0 24px 20px; }
.visual-kicker { display:flex; justify-content:space-between; align-items:baseline; gap:16px; margin:0 0 18px; color:#516676; }
.visual-kicker strong { font-size:17px; font-weight:500; }
.visual-kicker span { color:#98a3ac; font-size:12px; }
.stats-visual .empty { padding:55px 20px; }
.brand-visual,.trend-visual,.category-visual,.matrix-visual,.agency-visual { min-height:260px; }

/* Brand: named ranking with immediate country drill-down. */
.brand-line { display:grid; grid-template-columns:32px 135px minmax(140px,1fr) 64px; gap:10px 14px; align-items:center; padding:12px 0; border-bottom:1px solid #ebeff2; }
.brand-rank { font:12px Georgia,serif; color:#a7b5c0; }
.brand-name { text-align:left; font-size:16px; color:#445b6e; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-name:hover { color:#3287c8; }
.brand-track { height:8px; background:#edf3f7; }
.brand-track i { display:block; height:100%; background:#74b2df; transition:width .22s ease; }
.brand-total { font-size:13px; font-weight:500; color:#3287c8; text-align:right; }
.brand-country { grid-column:2/5; display:flex; flex-wrap:wrap; gap:6px 13px; }
.brand-country button { padding:0; color:#82909b; font-size:11px; }
.brand-country button:hover { color:#3287c8; text-decoration:underline; }
.brand-country b { font-weight:500; color:#3287c8; }

/* Trend: a single comparison surface; the legend doubles as country drill-down. */
.trend-visual svg { width:100%; height:auto; max-height:325px; overflow:visible; font-size:12px; fill:#8f9aa4; }
.trend-legend { display:flex; justify-content:center; flex-wrap:wrap; gap:8px 22px; border-top:1px solid #edf0f2; padding:13px 0 4px; }
.trend-legend button { display:flex; align-items:center; gap:6px; font-size:12px; }
.trend-legend button:hover { text-decoration:underline; }
.trend-legend i,.category-legend i,.agency-parts i { display:inline-block; width:9px; height:9px; border-radius:50%; }
.trend-legend b { font-weight:500; }

/* Category: proportional rows make the class mix readable at a glance. */
.category-head,.category-line { display:grid; grid-template-columns:110px minmax(180px,1fr) 52px; gap:14px; align-items:center; }
.category-head { border-bottom:1px solid #e6ebef; padding:0 0 8px; color:#a0aab2; font-size:11px; }
.category-head span:last-child { text-align:right; }
.category-line { min-height:42px; border-bottom:1px solid #f0f2f4; }
.class-label { color:#758797; font-size:13px; }
.class-label b { color:#3c617b; font-size:19px; font-weight:400; }
.category-track { display:flex; align-items:center; height:19px; gap:2px; }
.category-track button { height:100%; min-width:5px; border-radius:1px; opacity:.88; transition:opacity .15s,transform .15s; }
.category-track button:hover,.category-track button:focus-visible { opacity:1; transform:scaleY(1.25); }
.class-total { font-size:15px; color:#3287c8; text-align:right; font-weight:500; }
.category-legend { display:flex; flex-wrap:wrap; gap:7px 20px; margin-top:16px; color:#7e8b95; font-size:11px; }
.category-legend span { display:flex; align-items:center; gap:5px; }

/* Brand/category layout: a compact, accessible matrix. */
.stats-visual .matrix-scroll { overflow-x:auto; padding-bottom:8px; }
.stats-visual .matrix-grid { display:grid; width:100%; grid-template-columns:155px repeat(var(--country-count),minmax(100px,1fr)); gap:3px; min-width:max-content; }
.stats-visual .matrix-grid>* { min-height:39px; display:flex; align-items:center; justify-content:center; }
.stats-visual .matrix-corner,.stats-visual .matrix-head { color:#83909b; background:#f5f7f9; font-size:12px; font-weight:400; }
.stats-visual .matrix-label { justify-content:flex-start; padding:0 10px; background:#f9fafb; text-align:left; color:#516779; white-space:nowrap; }
.stats-visual .matrix-label:hover { color:#3287c8; }
.stats-visual .matrix-cell { font-size:13px; font-weight:500; }
.stats-visual .matrix-cell:hover,.stats-visual .matrix-cell:focus-visible { outline:2px solid #3287c8; outline-offset:-2px; }

/* Agency: a restrained register, suitable for scanning institution names. */
.agency-head,.agency-line { display:grid; grid-template-columns:245px minmax(180px,1fr) 62px; gap:18px; align-items:center; }
.agency-head { color:#9aa5ad; font-size:11px; padding:0 0 9px; border-bottom:1px solid #dfe7ec; }
.agency-head span:last-child { text-align:right; }
.agency-line { padding:16px 0; border-bottom:1px solid #edf1f3; }
.agency-line>div:first-child { display:flex; align-items:center; gap:12px; }
.agency-line small { color:#a5b1bb; font:12px Georgia,serif; }
.agency-line strong { color:#536878; font-weight:500; }
.agency-parts { display:flex; flex-wrap:wrap; gap:8px 17px; }
.agency-parts button { display:flex; align-items:center; gap:5px; padding:0; color:#758694; font-size:11px; }
.agency-parts button:hover { color:#3287c8; text-decoration:underline; }
.agency-parts b { color:#3287c8; font-weight:500; }
.agency-total { color:#3287c8; font-size:17px; text-align:right; font-weight:400; }

.data-table-controls { display:flex; justify-content:flex-end; margin:22px 0 0; border-top:1px solid #ebeff2; padding-top:11px; }
.data-table-controls button { font-size:12px; }
.data-table-controls span { margin-left:4px; }
.stats-visual .stats-table { width:100%; margin:12px 0 0; }
.stats-visual .stats-table button:hover { text-decoration:underline; }
@media(max-width:700px){
  .stats-visual { padding:0 15px 15px; }
  .visual-kicker { display:block; }
  .visual-kicker span { display:block; margin-top:4px; }
  .brand-line { grid-template-columns:22px 110px 1fr 52px; gap:7px; }
  .brand-name { font-size:13px; }
  .brand-country { grid-column:2/5; }
  .category-head,.category-line { grid-template-columns:75px minmax(90px,1fr) 35px; gap:8px; }
  .agency-head,.agency-line { grid-template-columns:minmax(110px,1fr) 65px; gap:8px; }
  .agency-head span:nth-child(2),.agency-parts { display:none; }
  .stats-visual .matrix-grid { grid-template-columns:105px repeat(var(--country-count),minmax(70px,1fr)); }
  .stats-visual .stats-table { display:block; overflow-x:auto; }
}
@media(prefers-reduced-motion:reduce){.brand-track i,.category-track button{transition:none}}
