.traffic-live-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.traffic-live-status .updated-at { display: block; }
.traffic-hero { align-items: center; }
.traffic-live { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; white-space: nowrap; }
.traffic-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #269b7110; }
.traffic-live.is-error { color: var(--red); }
.traffic-live.is-error .traffic-live-dot { background: var(--red); }
.traffic-controls { position: static; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.traffic-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.traffic-controls input { width: 143px; height: 38px; padding: 0 8px; font-size: 12px; }
.traffic-status { min-height: 18px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.traffic-status.is-error { color: var(--red); }
.traffic-demo { margin: -8px 0 22px; padding: 12px 16px; background: #fff9ef; border: 1px solid #f0dfc6; border-radius: 8px; color: var(--amber); font-size: 12px; }
.traffic-layout, .traffic-details { display: grid; gap: 22px; align-items: stretch; }
.traffic-layout { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.traffic-details { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
.traffic-card { display: flex; flex-direction: column; height: 400px; max-height: 400px; min-width: 0; min-height: 0; overflow: hidden; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.traffic-card .panel-heading { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 12px; min-height: 66px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.traffic-card .panel-heading .eyebrow { margin-bottom: 4px; font-size: 9px; }
.traffic-card h2 { margin: 0; color: var(--text); font-size: 16px; }
.traffic-caption { max-width: 52%; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; }
.traffic-chart-wrap { position: relative; flex: 1; min-height: 0; margin: 8px 12px 0; }
.traffic-chart-wrap svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.traffic-chart-wrap svg text { font-family: inherit; font-size: 12px; fill: var(--muted); }
.traffic-chart-wrap svg .chart-grid { stroke: var(--line); stroke-width: 1; }
.traffic-chart-wrap svg .chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.traffic-chart-wrap svg .chart-point { fill: var(--surface, #fff); stroke-width: 1.5; pointer-events: none; vector-effect: non-scaling-stroke; }
.traffic-chart-wrap svg .chart-point.active { fill: currentColor; stroke-width: 2; }
.traffic-chart-wrap svg:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.traffic-chart-footer { display: flex; flex: none; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding: 12px 18px; color: var(--muted); font-size: 10px; }
.traffic-series-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.traffic-series-source { width: 94px; flex: none; font-size: 10px; color: var(--muted); }
.traffic-chart-notes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
#metrikaTrafficStatus.is-error { color: var(--red); }
.traffic-series { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); font-size: 11px; cursor: pointer; }
.traffic-series input { width: 13px; height: 13px; margin: 0; accent-color: var(--series-color); cursor: pointer; }
.traffic-series strong { margin-left: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.traffic-series-visitors { --series-color: #6a64f6; }
.traffic-series-visits { --series-color: #269b71; }
.traffic-series-views { --series-color: #df9636; }
.traffic-series-yandexVisitors { --series-color: #3185c6; }
.traffic-series-yandexVisits { --series-color: #ca5b9d; }
.traffic-series-yandexViews { --series-color: #92704b; }
.traffic-legend-dot { display: inline-block; flex: none; width: 7px; height: 7px; background: var(--series-color); border-radius: 50%; }
.traffic-series input:not(:checked) ~ .traffic-legend-dot { opacity: .3; }
.traffic-series input:not(:checked) ~ span { color: var(--muted); }
.traffic-tooltip { position: fixed; z-index: 200; max-width: 210px; pointer-events: none; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-size: 11px; line-height: 1.6; }
.traffic-chart-empty { position: absolute; top: 38%; left: 0; width: 100%; text-align: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.traffic-sources { flex: 1; min-height: 0; overflow: auto; padding: 0 18px 8px; scrollbar-gutter: stable; overflow-anchor: none; }
.traffic-source { position: relative; padding: 7px 0; border-bottom: 1px solid var(--line); }
.traffic-source:last-child { border: 0; }
.traffic-source-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; }
.traffic-source-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.traffic-source-label > small { margin-left: 6px; color: var(--muted); font-size: 10px; }
.traffic-source-value { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.traffic-source-value small { display: inline-block; min-width: 37px; margin-left: 8px; font-size: 10px; font-weight: 400; color: var(--muted); text-align: right; }
.traffic-source-meter { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; margin: 0; accent-color: var(--accent); border: 0; }
.traffic-table-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; overflow-anchor: none; }
.traffic-table { width: 100%; min-width: 430px; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.traffic-table th { position: sticky; z-index: 1; top: 0; padding: 10px 12px; background: var(--surface-soft); color: var(--muted); text-align: right; font-size: 10px; font-weight: 500; white-space: nowrap; }
.traffic-table td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.traffic-table th:first-child, .traffic-table td:first-child { text-align: left; }
.traffic-table tbody tr:hover { background: #faf9ff; }
.traffic-table td small { margin-left: 7px; color: var(--green); font-size: 9px; }
.traffic-top-table { table-layout: fixed; min-width: 480px; }
.traffic-top-table th:first-child { width: 32px; padding-right: 4px; }
.traffic-top-table th:nth-child(2), .traffic-top-table td:nth-child(2) { text-align: left; }
.traffic-top-table th:nth-child(n+3) { width: 90px; }
.traffic-top-table .traffic-rank { color: var(--muted); padding-right: 4px; }
.traffic-domain-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-table .traffic-table-empty { padding: 26px 16px; color: var(--muted); text-align: center; white-space: normal; }
.traffic-footnote { margin: 18px 0 0; max-width: 950px; color: var(--muted); font-size: 11px; line-height: 1.7; }
@media(max-width:1050px) { .traffic-layout { grid-template-columns: minmax(0, 1fr); } }
@media(max-width:800px) { .traffic-details { grid-template-columns: minmax(0, 1fr); } }
@media(max-width:700px) {
  .traffic-hero { align-items: flex-start; flex-direction: column; gap: 18px; }
  .traffic-hero h1 { font-size: 36px; }
  .traffic-controls .view-controls { width: 100%; }
  .traffic-controls .view-control { flex-wrap: wrap; }
  .traffic-controls input { width: 132px; }
  .traffic-layout, .traffic-details { gap: 16px; }
  .traffic-card .panel-heading { padding: 14px; }
  .traffic-chart-footer { padding: 12px 14px; }
  .traffic-series-controls { gap: 10px 14px; }
  .traffic-series { font-size: 10px; }
  .traffic-series strong { font-size: 12px; }
  .traffic-sources { padding: 0 14px 8px; }
  .traffic-caption { max-width: 50%; }
}
