.traffic-performance-page,
.traffic-performance-page * {
  box-sizing: border-box;
  min-width: 0;
  letter-spacing: 0;
}

.traffic-performance-page [hidden] { display: none !important; }

.traffic-performance-toolbar,
.traffic-connection-band,
.traffic-range-row,
.traffic-table-header,
.traffic-chart-header,
.traffic-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.traffic-performance-toolbar {
  position: relative;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--bs-border-color) 82%, transparent);
  border-radius: 8px;
  background: var(--bostic-surface, #fff);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
}

.traffic-performance-toolbar > .min-w-0 > span.text-muted,
.traffic-card-eyebrow,
.traffic-range-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #2563a9 !important;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.traffic-performance-toolbar h2 { color: var(--bs-emphasis-color); line-height: 1.2; }
.traffic-performance-toolbar p { max-width: 700px; }

.traffic-performance-actions,
.traffic-connection-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.traffic-performance-actions .btn,
.traffic-connection-actions .btn,
.traffic-setup-submit,
.traffic-pagination .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.traffic-connection-band {
  padding: 18px 20px;
  border: 1px solid #dbe1e8;
  border-left: 4px solid #7c8798;
  border-radius: 7px;
  background: #f4f6f8;
}

.traffic-connection-band[data-state="active"] { border-left-color: #16865a; }
.traffic-connection-band[data-state="attention"] { border-left-color: #f59e0b; }
.traffic-connection-band[data-state="error"] { border-left-color: #d94343; }
.traffic-connection-copy { display: flex; align-items: center; gap: 12px; }
.traffic-connection-copy strong,
.traffic-connection-copy small { display: block; }

.traffic-status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: #7c8798;
  box-shadow: 0 0 0 5px rgba(124, 135, 152, 0.14);
}

[data-state="active"] .traffic-status-dot { background: #16865a; box-shadow: 0 0 0 5px rgba(22, 134, 90, 0.15); }
[data-state="attention"] .traffic-status-dot { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.16); }

.traffic-setup-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.traffic-setup-grid .form-label { margin: 0; }
.traffic-setup-submit { min-height: 42px; }

.traffic-loading {
  padding: 24px;
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  background: #fff;
}

.traffic-range-row {
  padding: 15px 18px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
}

.traffic-range-row span,
.traffic-range-row strong { display: block; }
.traffic-range-row strong { color: #202734; font-size: 0.95rem; }

.traffic-segmented,
.traffic-dimension-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d8dee6;
  border-radius: 7px;
  background: #eef1f4;
}

.traffic-segmented button,
.traffic-dimension-tabs button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  color: #52606f;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.traffic-segmented button[aria-pressed="true"],
.traffic-dimension-tabs button[aria-selected="true"] {
  color: #19202a;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 31, 42, 0.14);
}

.traffic-segmented button:focus-visible,
.traffic-dimension-tabs button:focus-visible,
.traffic-table-search input:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }

.traffic-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.traffic-metric-card {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  padding: 18px 16px 62px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.04);
}

.traffic-metric-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e6b79;
  font-size: 0.82rem;
  font-weight: 650;
}

.traffic-metric-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 1rem;
}

.traffic-metric-icon-sessions { color: #2563a9; background: #e8f2ff; }
.traffic-metric-icon-users { color: #147858; background: #def7ec; }
.traffic-metric-icon-new { color: #b85e00; background: #fff0dc; }
.traffic-metric-icon-engagement { color: #8b4ac7; background: #f2e9fb; }
.traffic-metric-icon-events { color: #a54866; background: #fbe8ef; }

.traffic-metric-card > strong {
  display: block;
  margin: 13px 0 3px;
  color: #202734;
  font-size: 1.65rem;
  line-height: 1.1;
}

.traffic-metric-card > small { display: block; color: #6b7785; }
.traffic-metric-spark { position: absolute; right: 10px; bottom: 4px; left: 10px; height: 54px; }

.traffic-visual-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.traffic-chart-card {
  margin: 0;
  border-color: #dde3ea;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.045);
}

.traffic-chart-card .card-header {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom-color: #e5e9ee;
  background: #fff;
}

.traffic-chart-card .card-body { padding: 12px 16px 16px; }
.traffic-chart-main { grid-column: span 8; }
.traffic-chart-audience { grid-column: span 4; }
.traffic-chart-channels { grid-column: span 8; }
.traffic-chart-devices { grid-column: span 4; }
.traffic-chart-header { flex-wrap: wrap; }
.traffic-chart-header h5 { color: #202734; font-size: 1rem; }

.traffic-chart-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #596777;
  font-size: 0.76rem;
  font-weight: 650;
}

.traffic-chart { width: 100%; }
.traffic-chart-large { height: 330px; }
.traffic-chart-donut { height: 270px; }
.traffic-chart-bars { height: 290px; }

.traffic-chart-empty {
  display: grid;
  min-height: 220px;
  margin: 0;
  place-items: center;
  color: #73808e;
  text-align: center;
}

.traffic-table-card { border-color: #dde3ea; border-radius: 8px; }
.traffic-table-card .card-header { padding: 18px; background: #fff; }
.traffic-table-header { flex-wrap: wrap; }
.traffic-table-search { width: min(360px, 100%); }
.traffic-table-wrap { margin-top: 18px; overflow-x: auto; }
.traffic-table-wrap table { width: 100%; min-width: 790px; table-layout: fixed; }
.traffic-table-wrap th:first-child,
.traffic-table-wrap td:first-child { width: 34%; overflow: hidden; }
.traffic-table-wrap th:not(:first-child):not(:last-child),
.traffic-table-wrap td:not(:first-child):not(:last-child) { width: 13%; white-space: nowrap; }
.traffic-table-wrap th:last-child,
.traffic-table-wrap td:last-child { width: 14%; white-space: nowrap; }

.traffic-row-action-cell { text-align: right; }

.traffic-inspect-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.traffic-inspect-link:focus-visible,
.traffic-detail-actions .btn:focus-visible,
.traffic-peer-link:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.traffic-landing-link,
.traffic-dimension-value {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
}

.traffic-landing-link {
  color: #2563a9;
  font-weight: 650;
  text-decoration: none;
}

.traffic-landing-link-label,
.traffic-dimension-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-landing-link .ti { flex: 0 0 auto; font-size: 0.92rem; }
.traffic-landing-link:hover { color: #174f86; text-decoration: underline; }
.traffic-landing-link:focus-visible { border-radius: 3px; outline: 2px solid #f59e0b; outline-offset: 3px; }
.traffic-pagination { flex-wrap: wrap; }

html[data-pc-theme="dark"] .traffic-performance-toolbar,
body[data-pc-theme="dark"] .traffic-performance-toolbar,
html[data-pc-theme="dark"] .traffic-range-row,
body[data-pc-theme="dark"] .traffic-range-row,
html[data-pc-theme="dark"] .traffic-metric-card,
body[data-pc-theme="dark"] .traffic-metric-card,
html[data-pc-theme="dark"] .traffic-chart-card,
body[data-pc-theme="dark"] .traffic-chart-card,
html[data-pc-theme="dark"] .traffic-chart-card .card-header,
body[data-pc-theme="dark"] .traffic-chart-card .card-header,
html[data-pc-theme="dark"] .traffic-table-card .card-header,
body[data-pc-theme="dark"] .traffic-table-card .card-header,
html[data-pc-theme="dark"] .traffic-loading,
body[data-pc-theme="dark"] .traffic-loading {
  border-color: #3b4655;
  background: #202731;
}

html[data-pc-theme="dark"] .traffic-performance-toolbar,
body[data-pc-theme="dark"] .traffic-performance-toolbar { box-shadow: 0 10px 28px rgba(3, 8, 15, 0.24); }

html[data-pc-theme="dark"] .traffic-connection-band,
body[data-pc-theme="dark"] .traffic-connection-band { border-color: #3c4655; background: #252d38; }

html[data-pc-theme="dark"] .traffic-connection-band[data-state="active"],
body[data-pc-theme="dark"] .traffic-connection-band[data-state="active"] { border-left-color: #16865a; }

html[data-pc-theme="dark"] .traffic-connection-band[data-state="attention"],
body[data-pc-theme="dark"] .traffic-connection-band[data-state="attention"] { border-left-color: #f59e0b; }

html[data-pc-theme="dark"] .traffic-connection-band[data-state="error"],
body[data-pc-theme="dark"] .traffic-connection-band[data-state="error"] { border-left-color: #d94343; }

html[data-pc-theme="dark"] .traffic-range-row strong,
body[data-pc-theme="dark"] .traffic-range-row strong,
html[data-pc-theme="dark"] .traffic-performance-toolbar h2,
body[data-pc-theme="dark"] .traffic-performance-toolbar h2,
html[data-pc-theme="dark"] .traffic-connection-copy strong,
body[data-pc-theme="dark"] .traffic-connection-copy strong,
html[data-pc-theme="dark"] .traffic-metric-card > strong,
body[data-pc-theme="dark"] .traffic-metric-card > strong,
html[data-pc-theme="dark"] .traffic-chart-header h5,
body[data-pc-theme="dark"] .traffic-chart-header h5 { color: #f3f6f9; }

html[data-pc-theme="dark"] .traffic-performance-toolbar p,
body[data-pc-theme="dark"] .traffic-performance-toolbar p,
html[data-pc-theme="dark"] .traffic-connection-copy small,
body[data-pc-theme="dark"] .traffic-connection-copy small,
html[data-pc-theme="dark"] .traffic-metric-heading,
body[data-pc-theme="dark"] .traffic-metric-heading,
html[data-pc-theme="dark"] .traffic-metric-card > small,
body[data-pc-theme="dark"] .traffic-metric-card > small { color: #aeb8c5 !important; }

html[data-pc-theme="dark"] .traffic-segmented,
html[data-pc-theme="dark"] .traffic-dimension-tabs,
body[data-pc-theme="dark"] .traffic-segmented,
body[data-pc-theme="dark"] .traffic-dimension-tabs { border-color: #455162; background: #1d242d; }

html[data-pc-theme="dark"] .traffic-segmented button[aria-pressed="true"],
html[data-pc-theme="dark"] .traffic-dimension-tabs button[aria-selected="true"],
body[data-pc-theme="dark"] .traffic-segmented button[aria-pressed="true"],
body[data-pc-theme="dark"] .traffic-dimension-tabs button[aria-selected="true"] { color: #fff; background: #36404d; }

html[data-pc-theme="dark"] .traffic-chart-badge,
body[data-pc-theme="dark"] .traffic-chart-badge { color: #aeb8c5; }

html[data-pc-theme="dark"] .traffic-landing-link,
body[data-pc-theme="dark"] .traffic-landing-link { color: #8ec5ff; }

html[data-pc-theme="dark"] .traffic-landing-link:hover,
body[data-pc-theme="dark"] .traffic-landing-link:hover { color: #c4e1ff; }

.traffic-detail-loading,
.traffic-detail-empty {
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
  color: #647180;
  text-align: center;
}

.traffic-detail-loading strong,
.traffic-detail-loading span { display: block; }

.traffic-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.055);
}

.traffic-detail-heading { min-width: 0; }

.traffic-detail-heading h2 {
  max-width: 900px;
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
  color: #202734;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.25;
}

.traffic-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  color: #697686;
}

.traffic-detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.traffic-detail-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 10px; }
.traffic-detail-actions .btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; }

.traffic-detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.traffic-detail-metric {
  padding: 16px;
  border: 1px solid #dde3ea;
  border-top: 3px solid var(--traffic-metric-accent, #2563a9);
  border-radius: 7px;
  background: #fff;
}

.traffic-detail-metric span,
.traffic-detail-metric small { display: block; color: #6b7785; }
.traffic-detail-metric span { font-size: 0.78rem; font-weight: 650; }
.traffic-detail-metric strong { display: block; margin: 9px 0 3px; color: #202734; font-size: 1.45rem; line-height: 1; }
.traffic-detail-metric:nth-child(2) { --traffic-metric-accent: #16865a; }
.traffic-detail-metric:nth-child(3) { --traffic-metric-accent: #d97706; }
.traffic-detail-metric:nth-child(4) { --traffic-metric-accent: #8b5cf6; }
.traffic-detail-metric:nth-child(5) { --traffic-metric-accent: #0f8b8d; }
.traffic-detail-metric:nth-child(6) { --traffic-metric-accent: #c24168; }

.traffic-detail-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.traffic-detail-chart-card,
.traffic-detail-peer-card { margin: 0; border-color: #dde3ea; border-radius: 8px; }
.traffic-detail-chart-card .card-header,
.traffic-detail-peer-card .card-header { padding: 16px 18px; border-bottom-color: #e5e9ee; background: #fff; }
.traffic-detail-chart-card .card-body { padding: 12px 16px 16px; }
.traffic-detail-chart { width: 100%; height: 300px; }
.traffic-detail-share-chart { height: 250px; }

.traffic-detail-chart-copy {
  margin: 0;
  color: #6b7785;
  font-size: 0.82rem;
  line-height: 1.55;
}

.traffic-detail-insight {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid #d6e2f0;
  border-left: 4px solid #2563a9;
  border-radius: 7px;
  background: #eef5fc;
}

.traffic-detail-insight > i { color: #2563a9; font-size: 1.3rem; }
.traffic-detail-insight strong,
.traffic-detail-insight span { display: block; }
.traffic-detail-insight strong { color: #202734; }
.traffic-detail-insight span { margin-top: 2px; color: #5e6b79; }

.traffic-detail-peer-wrap { overflow-x: auto; }
.traffic-detail-peer-wrap table { min-width: 720px; }
.traffic-detail-peer-wrap th:first-child,
.traffic-detail-peer-wrap td:first-child { width: 42%; max-width: 0; }
.traffic-peer-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-peer-link { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; }
.traffic-peer-row-current { background: #fff7e8; }

html[data-pc-theme="dark"] .traffic-detail-loading,
body[data-pc-theme="dark"] .traffic-detail-loading,
html[data-pc-theme="dark"] .traffic-detail-empty,
body[data-pc-theme="dark"] .traffic-detail-empty,
html[data-pc-theme="dark"] .traffic-detail-hero,
body[data-pc-theme="dark"] .traffic-detail-hero,
html[data-pc-theme="dark"] .traffic-detail-metric,
body[data-pc-theme="dark"] .traffic-detail-metric,
html[data-pc-theme="dark"] .traffic-detail-chart-card,
body[data-pc-theme="dark"] .traffic-detail-chart-card,
html[data-pc-theme="dark"] .traffic-detail-peer-card,
body[data-pc-theme="dark"] .traffic-detail-peer-card,
html[data-pc-theme="dark"] .traffic-detail-chart-card .card-header,
body[data-pc-theme="dark"] .traffic-detail-chart-card .card-header,
html[data-pc-theme="dark"] .traffic-detail-peer-card .card-header,
body[data-pc-theme="dark"] .traffic-detail-peer-card .card-header {
  border-color: #3b4655;
  background: #202731;
}

html[data-pc-theme="dark"] .traffic-detail-heading h2,
body[data-pc-theme="dark"] .traffic-detail-heading h2,
html[data-pc-theme="dark"] .traffic-detail-metric strong,
body[data-pc-theme="dark"] .traffic-detail-metric strong { color: #f3f6f9; }

html[data-pc-theme="dark"] .traffic-detail-meta,
body[data-pc-theme="dark"] .traffic-detail-meta,
html[data-pc-theme="dark"] .traffic-detail-metric span,
body[data-pc-theme="dark"] .traffic-detail-metric span,
html[data-pc-theme="dark"] .traffic-detail-metric small,
body[data-pc-theme="dark"] .traffic-detail-metric small,
html[data-pc-theme="dark"] .traffic-detail-chart-copy,
body[data-pc-theme="dark"] .traffic-detail-chart-copy { color: #aeb8c5; }

html[data-pc-theme="dark"] .traffic-detail-insight,
body[data-pc-theme="dark"] .traffic-detail-insight { border-color: #36516d; border-left-color: #69a9ec; background: #243446; }
html[data-pc-theme="dark"] .traffic-detail-insight > i,
body[data-pc-theme="dark"] .traffic-detail-insight > i { color: #8ec5ff; }
html[data-pc-theme="dark"] .traffic-detail-insight strong,
body[data-pc-theme="dark"] .traffic-detail-insight strong { color: #f3f6f9; }
html[data-pc-theme="dark"] .traffic-detail-insight span,
body[data-pc-theme="dark"] .traffic-detail-insight span { color: #b8c2cf; }
html[data-pc-theme="dark"] .traffic-peer-row-current,
body[data-pc-theme="dark"] .traffic-peer-row-current { background: #3a3325; }

@media (max-width: 1199.98px) {
  .traffic-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .traffic-chart-main,
  .traffic-chart-channels { grid-column: span 7; }
  .traffic-chart-audience,
  .traffic-chart-devices { grid-column: span 5; }
  .traffic-detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .traffic-performance-toolbar,
  .traffic-connection-band,
  .traffic-range-row { align-items: stretch; flex-direction: column; }
  .traffic-performance-toolbar { padding: 18px; }
  .traffic-performance-actions,
  .traffic-connection-actions { width: 100%; }
  .traffic-performance-actions .btn,
  .traffic-connection-actions .btn { flex: 1 1 190px; min-height: 44px; }
  .traffic-setup-grid { grid-template-columns: 1fr; }
  .traffic-setup-submit { width: 100%; min-height: 44px; }
  .traffic-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .traffic-chart-main,
  .traffic-chart-audience,
  .traffic-chart-channels,
  .traffic-chart-devices { grid-column: 1 / -1; }
  .traffic-dimension-tabs { width: 100%; overflow-x: auto; }
  .traffic-dimension-tabs button { flex: 1 0 auto; min-height: 44px; }
  .traffic-inspect-link { min-height: 44px; }
  .traffic-detail-hero { align-items: stretch; flex-direction: column; }
  .traffic-detail-actions { width: 100%; }
  .traffic-detail-actions .btn { flex: 1 1 190px; min-height: 44px; }
  .traffic-detail-chart-grid { grid-template-columns: 1fr; }
  .traffic-peer-link { min-height: 44px; }
}

@media (max-width: 575.98px) {
  .traffic-metrics { grid-template-columns: 1fr; }
  .traffic-segmented { width: 100%; }
  .traffic-segmented button { flex: 1 1 0; min-height: 44px; padding-inline: 6px; }
  .traffic-chart-card .card-header { align-items: flex-start; }
  .traffic-chart-card .card-body { padding-inline: 10px; }
  .traffic-chart-large { height: 290px; }
  .traffic-chart-donut { height: 250px; }
  .traffic-chart-bars { height: 280px; }
  .traffic-pagination .btn { min-height: 44px; }
  .traffic-detail-hero { padding: 18px; }
  .traffic-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .traffic-detail-metric { padding: 14px; }
  .traffic-detail-chart { height: 275px; }
  .traffic-detail-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .traffic-performance-page * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
