.traffic-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.traffic-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.traffic-card h2 {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: #1f2933;
}

.tracked-site-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tracked-site-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

.tracked-site-link.is-selected {
  border-color: #56B6C6;
  background: #f3fbfc;
}

.tracked-site-current {
  margin-bottom: 1rem;
}

.site-switcher {
  margin-bottom: 1rem;
}

.sites-header-main,
.sites-header-actions,
.site-switcher-controls {
  display: flex;
  align-items: center;
}

.sites-header-main {
  gap: 0.85rem;
  min-width: 0;
}

.sites-header-actions {
  gap: 0.5rem;
  flex: 0 0 auto;
}

.site-switcher-controls {
  gap: 0.5rem;
  min-width: 0;
}

.site-switcher-controls .site-switcher {
  flex: 0 1 290px;
  min-width: 180px;
  margin-bottom: 0;
}

.site-edit-name-row {
  margin: -0.35rem 0 1rem;
}

.site-url-info {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f7f8f9;
}

.site-url-info__label {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
}

.site-url-info__value {
  min-width: 0;
  color: #374151;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.site-limit-banner {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #b9e5ec;
  border-radius: 7px;
  background: #effafd;
}

.site-delete-form {
  margin: 0;
  flex: 0 0 auto;
}

.site-add {
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f7f8f9;
}

.site-rename-form {
  max-width: 480px;
}

.site-switcher .path-range__button {
  width: 100%;
  max-width: none;
  height: auto;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  text-align: left;
}

@media (max-width: 700px) {
  .sites-header-main {
    flex-wrap: wrap;
  }

  .traffic-card .section-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sites-header-actions {
    margin-left: auto;
  }

  .site-switcher-controls {
    flex-basis: 100%;
  }

  .site-switcher-controls .site-switcher {
    flex: 1 1 180px;
  }
}

.site-switcher .path-range__label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.site-switcher .path-range__label strong,
.site-switcher__choice strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2933;
}

.site-switcher .path-range__label span,
.site-switcher__choice span {
  display: block;
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  word-break: break-all;
}

.site-logo,
.site-switcher .path-range__label .site-logo,
.site-switcher__choice .site-logo,
.path-site .path-range__label .site-logo,
.site-picker__option .site-logo {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  position: relative;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border: 1px solid #e1e7ed;
  border-radius: 7px;
  background: #f3f7f8;
  color: #52616d;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  word-break: normal;
}

.site-logo__fallback,
.site-switcher .path-range__label .site-logo__fallback,
.site-switcher__choice .site-logo__fallback,
.path-site .path-range__label .site-logo__fallback,
.site-picker__option .site-logo__fallback {
  display: block;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  word-break: normal;
}

.site-logo__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
  background: #fff;
}

.site-logo--compact {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
}

.site-picker__option {
  display: flex;
  align-items: center !important;
  gap: 0.55rem;
}

.site-picker__option > span:last-child,
.site-picker__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.site-switcher__choice {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.site-switcher__choice .site-switcher__choice-text {
  min-width: 0;
}

.site-switcher__choice .site-switcher__choice-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-switcher .path-site__menu {
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
}

.site-switcher .path-range__option {
  align-items: flex-start;
}

.tracked-site-link strong {
  display: block;
}

.tracked-site-link span {
  color: #6c757d;
  font-size: 0.82rem;
  word-break: break-all;
}

.site-snippet {
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  background: #f4f5f7;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.65rem 0.7rem;
  margin: 0 0 0.65rem;
  color: #1f2933;
}

.traffic-note {
  color: #6c757d;
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
}

.path-tree-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.path-tree-stat {
  min-width: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}

.path-tree-stat__label {
  display: block;
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 600;
}

.path-tree-stat__value {
  display: block;
  margin-top: 0.12rem;
  color: #1f2933;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.path-tree-stat.is-live {
  background: #eef8f1;
  border-color: #8fceb0;
}

.path-tree-stat.is-live .path-tree-stat__label {
  color: #2f7d4a;
}

.dashboard-usage-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  flex: 0 0 auto;
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.8rem;
  color: #72520b;
  background: #fff8e7;
  border: 1px solid #f0d58d;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.dashboard-usage-warning > i {
  margin-top: 0.1rem;
  color: #bd8200;
}

.dashboard-usage-warning strong {
  font-weight: 700;
}

.dashboard-usage-warning.is-over-limit {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #f3b6b6;
}

.dashboard-usage-warning.is-over-limit > i {
  color: #b42318;
}

.dashboard-usage-warning__action {
  flex: 0 0 auto;
  align-self: center;
  color: #991b1b;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-usage-warning__action:hover {
  color: #7f1d1d;
}

.path-tree-stat.is-live .path-tree-stat__value {
  color: #1b7a43;
}

.path-tree-page {
  min-width: 0;
}

.path-tree-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.path-tree-toolbar h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.path-tree-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-activity__button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 30px;
  padding: 0 0.65rem;
  border: 1px solid #d9e2e8;
  border-radius: 6px;
  background: #fff;
  color: #344256;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.live-activity__button:hover,
.live-activity__button[aria-expanded="true"] { border-color: #17a878; background: #f2fbf7; }
.live-activity__indicator { width: 8px; height: 8px; border-radius: 50%; background: #18a879; box-shadow: 0 0 0 3px #e4f6ef; animation: live-pulse 1.8s ease-out infinite; }
.live-activity__count { color: #157c5b; font-variant-numeric: tabular-nums; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 5px rgba(24,168,121,0.08); } }
.live-activity__backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(27,39,51,0.22); }
.live-activity__drawer { box-sizing: border-box; position: fixed; z-index: 2001; left: 0; right: 0; bottom: 0; height: 50vh; height: 50dvh; max-height: 50vh; max-height: 50dvh; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #dce3e9; border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(20,35,48,0.18); padding: 1.2rem 1.25rem; transform: translateY(0); animation: live-drawer-in 180ms ease-out; }
.live-activity__drawer[hidden], .live-activity__backdrop[hidden] { display: none; }
@keyframes live-drawer-in { from { transform: translateY(24px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.live-activity__drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: .9rem; border-bottom: 1px solid #e7edf1; }
.live-activity__drawer-head h2 { margin: 0; color: #1f2933; font-size: 1.05rem; font-weight: 700; }
.live-activity__drawer-head p { margin: .25rem 0 0; color: #687586; font-size: .83rem; }
.live-activity__close { border: 0; background: transparent; color: #647386; font-size: 1.7rem; line-height: 1; }
.live-activity__list { overflow: auto; padding: .25rem 0; }
.live-activity__session { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(220px, 2fr); gap: 1rem; align-items: start; padding: .8rem .25rem; border-bottom: 1px solid #edf1f4; }
.live-activity__session strong { display: block; color: #253343; font-size: .86rem; }
.live-activity__session small { display: block; margin-top: .2rem; color: #7a8796; font-size: .74rem; }
.live-activity__session-location { display: flex; align-items: center; justify-content: flex-start; gap: .55rem; }
.live-activity__session-location strong { min-width: 0; }
.live-activity__flag { flex: 0 0 auto; font-size: 1rem; line-height: 1; }
.live-activity__pages { display: flex; flex-wrap: wrap; gap: .3rem; }
.live-activity__page { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; padding: .2rem .5rem; background: #f1f7f8; color: #176f7a; font-size: .75rem; }
.live-activity__empty { padding: 1.2rem .25rem; margin: 0; color: #6b7786; font-size: .88rem; }
@media (max-width: 640px) { .live-activity__session { grid-template-columns: 1fr 1fr; gap: .5rem; } .live-activity__pages { grid-column: 1 / -1; } }

.path-range {
  position: relative;
}

.path-range__button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1;
  white-space: nowrap;
}

.path-range__button:hover,
.path-range__button[aria-expanded="true"] {
  border-color: #1a8a96;
  background: #f4fbfc;
}
.path-range__button--static:hover { border-color: #e5e7eb; background: #fff; }

.path-site .path-range__button {
  max-width: min(280px, 46vw);
}

.path-site .path-range__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-site__menu {
  left: 0;
  right: auto;
  width: max-content;
  min-width: 160px;
  max-width: 280px;
}

.path-view__menu {
  left: 0;
  right: auto;
  width: max-content;
  min-width: 140px;
}

.path-site__add {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.38rem 0.55rem;
  border-radius: 6px;
  color: #2c3e50;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.path-site__add:hover {
  background: #f3fbfc;
  color: #2c3e50;
}

.path-site__limit {
  padding: 0.4rem 0.55rem 0.3rem;
  color: #6c757d;
  font-size: 0.78rem;
  line-height: 1.4;
}

.path-site__limit a {
  color: #56B6C6;
  font-weight: 700;
  text-decoration: none;
}

.path-site__limit a:hover {
  text-decoration: underline;
}

.path-range__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  width: 240px;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
}

.path-range__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.38rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #2c3e50;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  text-align: left;
}

.path-range__option:hover,
.path-range__option.is-selected {
  background: #e7f4f6;
}

.path-range__rule {
  height: 1px;
  margin: 0.3rem 0.35rem;
  background: rgba(0, 0, 0, 0.08);
}

.path-range__custom {
  padding: 0.35rem 0.55rem 0.45rem;
}

.path-range__custom p {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2c3e50;
}

.path-range__custom label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.4rem;
  color: #6c757d;
  font-size: 0.68rem;
  font-weight: 600;
}

.path-range__custom input {
  width: 100%;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  color: #2c3e50;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
}

.path-range__apply {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: #1a8a96;
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: normal;
}

.path-range__error {
  margin: 0 0 0.35rem;
  color: #b02a37;
  font-size: 0.72rem;
  font-weight: 600;
}

.path-tree-toolbar p {
  margin: 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.path-tree-stage {
  position: relative;
  min-width: 0;
  background: #f7f8f9;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.path-tree-toolbar .btn {
  height: 30px;
  padding: 0 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.path-tree-zoom {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 0.35rem;
}

.path-tree-zoom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
  line-height: 1;
}

.path-tree-zoom button i {
  font-size: 0.85rem;
}

.path-tree-zoom button:hover:not(:disabled) {
  border-color: #1a8a96;
  background: #f4fbfc;
  color: #1a8a96;
}

.path-tree-zoom button:disabled {
  opacity: 0.4;
}

.path-tree-wrap {
  overflow: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.path-tree-wrap.is-panning {
  cursor: grabbing;
}

.path-tree-scale {
  position: relative;
  overflow: hidden;
}

.path-tree-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: top left;
}

.path-tree-svg {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  overflow: visible;
}

.path-tree-node {
  position: absolute;
  box-sizing: border-box;
  width: 112px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 2px 5px;
  z-index: 1;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}

.path-tree-node.is-selected {
  border-color: #1a8a96;
}

.path-tree-pop {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  max-width: 220px;
  padding: 0.45rem 0.6rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.path-tree-pop__title {
  margin: 0 0 0.35rem;
  color: #1f2933;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.path-tree-pop__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.72rem;
  line-height: 1.45;
}

.path-tree-pop__row strong {
  color: #1f2933;
  font-weight: 600;
}

.path-tree-node--entry {
  border-color: #1a8a96;
}

.path-tree-node--other {
  border-style: dashed;
}

.path-tree-node--section {
  padding: 2px 4px;
  border-radius: 5px;
  background: #f6faf9;
  border-color: #d3e4df;
}

.path-tree-node--section .path-tree-node__path {
  font-size: 0.58rem;
}

.path-tree-node--section .path-tree-node__meta {
  font-size: 0.52rem;
}

.path-tree-node--click {
  width: 72px;
  padding: 1px 4px;
  border-radius: 5px;
  background: #fbfaf7;
  border-color: #e6dfd0;
}

.path-tree-node--click .path-tree-node__path {
  font-size: 0.56rem;
  font-weight: 600;
}

.path-tree-node--click .path-tree-node__meta {
  font-size: 0.5rem;
  line-height: 1.1;
}

.path-tree-node--source {
  width: 84px;
  padding: 3px 4px 2px;
  text-align: center;
}

.path-tree-node__source-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.path-tree-node--source .path-tree-node__path {
  min-width: 0;
  font-size: 0.62rem;
  text-align: center;
}

.path-tree-node--source .path-tree-node__meta {
  font-size: 0.5rem;
}

.path-tree-node__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.path-tree-node__mark svg path {
  stroke: #1a8a96;
}

.path-tree-node__mark svg,
.path-tree-node__mark img {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.path-tree-node__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #e7f4f6;
  color: #1a8a96;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.path-tree-node__path {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.66rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
  color: #2c3e50;
}

.path-tree-node__meta,
.path-tree-node__more {
  color: #6c757d;
  font-size: 0.54rem;
  line-height: 1.15;
}

.path-tree-node__more {
  margin-top: 0.15rem;
}

.path-tree-node__section {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  color: #3d4f5f;
  overflow-wrap: anywhere;
}

.path-tree-node__button {
  margin-top: 0.28rem;
  padding-top: 0.22rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.path-tree-node__button-label {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: #2c3e50;
  overflow-wrap: anywhere;
}

.path-tree-node__button-meta {
  font-size: 0.7rem;
  line-height: 1.3;
  color: #6c757d;
}

.path-tree-empty {
  margin: 1.5rem;
  color: #6c757d;
}

@media (max-width: 700px) {
  .path-tree-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .traffic-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  html:has(.path-tree-page),
  body:has(.path-tree-page) {
    height: 100%;
    overflow: hidden;
  }

  .main-content:has(.path-tree-page) {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .main-content:has(.path-tree-page) .dashboard-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.5rem 0.75rem 0.6rem;
  }

  .path-tree-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .path-flow {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .path-tree-stats {
    flex: 0 0 auto;
  }

  .main-content:has(.path-tree-page) .path-tree-toolbar {
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
  }

  .path-tree-stage {
    flex: 1 1 auto;
    min-height: 0;
  }

  .path-tree-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  .path-tree-scale {
    position: absolute;
    top: 0;
    left: 0;
  }

  html.view-classic:has(.path-tree-page),
  html.view-classic body:has(.path-tree-page) {
    height: auto;
    overflow: auto;
  }

  html.view-classic .main-content:has(.path-tree-page) {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  html.view-classic .main-content:has(.path-tree-page) .dashboard-content {
    display: block;
    height: auto;
    overflow: visible;
  }

  html.view-classic .path-tree-page {
    display: block;
    overflow: visible;
  }
}

html.view-classic .path-flow {
  display: none;
}

.classic-view {
  display: none;
}

.classic-view__stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

html.view-classic .classic-view {
  display: block;
  padding-bottom: 1.25rem;
}

html.view-bubbles:has(.path-tree-page),
html.view-bubbles body:has(.path-tree-page) {
  height: auto;
  overflow: auto;
}

html.view-bubbles .main-content:has(.path-tree-page) {
  height: auto;
  max-height: none;
  overflow: visible;
}

html.view-bubbles .main-content:has(.path-tree-page) .dashboard-content {
  display: block;
  height: auto;
  overflow: visible;
}

html.view-bubbles .path-tree-page { display: block; overflow: visible; }
html.view-bubbles .path-flow,
html.view-bubbles .classic-view { display: none; }

.bubbles-view { display: none; padding-bottom: 1.25rem; }
html.view-bubbles .bubbles-view { display: block; }
.bubbles-view__stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bubbles-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 310px); gap: 0.85rem; align-items: start; }

/* Page Journeys replaces the old crowded tree with a route map and a complete route index. */
.journeys-panel, .journeys-detail { color: #1f2933; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.path-flow > .path-tree-stats .path-tree-stat { background: #fff; border-color: #e5e7eb; }
.path-flow > .path-tree-stats .path-tree-stat__label { color: #6b7280; }
.path-flow > .path-tree-stats .path-tree-stat__value { color: #1f2933; }
.path-flow > .path-tree-stats .path-tree-stat.is-live { background: #eef8f1; border-color: #8fceb0; }
.path-flow > .path-tree-stats .path-tree-stat.is-live .path-tree-stat__label { color: #2f7d4a; }
.journeys-panel { margin-top: 0.75rem; }
.journeys-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: #fff; border-bottom: 1px solid #e5e7eb; }
.journeys-head h2 { margin: 0; color: #1f2933; font-size: 1.2rem; font-weight: 700; }
.journeys-head p { margin: 0.25rem 0 0; color: #667085; font-size: 0.88rem; }
.journeys-head p strong { color: #344054; }
.journeys-toggle { display: flex; flex-wrap: nowrap; gap: 0.55rem; }
.journeys-toggle button { min-width: 205px; padding: 0.55rem 0.85rem; color: #344054; text-align: center; background: #fff; border: 1px solid #d0d5dd; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.journeys-toggle button.is-selected { color: #126b75; background: #effafb; border-color: #56b6c6; }
.journeys-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 0.85fr); background: #f7f8f9; }
.journeys-graph { position: relative; min-width: 0; min-height: 600px; padding: 0.5rem 0.75rem 0; overflow: hidden; border-right: 1px solid #e5e7eb; }
.journeys-graph svg { display: block; width: 100%; height: 600px; overflow: hidden; }
.journeys-edge { fill: none; stroke: #168b97; stroke-opacity: 0.14; stroke-linecap: round; transition: opacity 160ms, stroke-opacity 160ms; }
.journeys-edge.is-related { stroke-opacity: 0.78; }
.journeys-edge.is-dimmed { stroke-opacity: 0.045; }
.journeys-node { cursor: pointer; }
.journeys-node rect { fill: #fff; stroke: #cbd5df; stroke-width: 1.5; transition: fill 140ms, stroke 140ms; }
.journeys-node.is-entry rect { fill: #f2fbfc; stroke: #b7dfe4; }
.journeys-node:hover rect, .journeys-node.is-selected rect { fill: #e8f7f9; stroke: #168b97; }
.journeys-node__name { fill: #1f2933; font-size: 16px; font-weight: 650; }
.journeys-graph__caption { fill: #526476; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; }
.journeys-node__count { fill: #667085; font-size: 14px; }
.journeys-node.is-selected .journeys-node__count { fill: #126b75; }
.journeys-routes-head { grid-column: 1 / -1; padding: 1rem 1.15rem 0; background: #fff; }
.journeys-routes-head h3 { margin: 0; color: #1f2933; font-size: 1rem; font-weight: 700; }
.journeys-routes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; align-content: start; padding: 1.15rem; border-top: 1px solid #e5e7eb; background: #fff; }
.journeys-route-column { min-width: 0; padding: 0.2rem; background: transparent; border-radius: 0; }
.journeys-route-column h3 { display: flex; align-items: center; justify-content: center; min-height: 1.5rem; margin: 0 0 0.55rem; color: #344054; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-align: center; text-transform: uppercase; }
.journeys-route { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; width: 100%; margin: 0 0 0.45rem; padding: 0.52rem 0.65rem; color: #344054; text-align: left; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.journeys-route:hover, .journeys-route.is-selected { color: #126b75; background: #effafb; border-color: #56b6c6; }
.journeys-route__path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }
.journeys-route__count { flex: 0 0 auto; color: #667085; font-size: 0.76rem; }
.journeys-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.85rem 1.25rem; color: #667085; background: #fff; border-top: 1px solid #e5e7eb; font-size: 0.83rem; }
.journeys-foot > div { display: flex; align-items: center; gap: 0.6rem; }
.journeys-foot p { margin: 0; }
.journeys-legend__dot { width: 10px; height: 10px; border-radius: 50%; background: #56bdc7; }
.journeys-legend__line { width: 34px; height: 4px; margin-left: 0.7rem; background: #168b97; border-radius: 4px; }
.journeys-detail { display: grid; grid-template-columns: minmax(245px, 1.15fr) minmax(0, 2fr); margin: 0.75rem 0 1.25rem; padding: 1.1rem 1.25rem; gap: 1.25rem; }
.journeys-main > .journeys-detail { display: block; min-width: 0; margin: 0; padding: 1rem; border: 0; border-radius: 0; background: #fff; overflow: visible; }
.journeys-detail__title h2 { margin: 0.18rem 0 0.2rem; color: #1f2933; font-size: 1.45rem; font-weight: 700; overflow-wrap: anywhere; }
.journeys-detail__title p { margin: 0; color: #667085; font-size: 0.88rem; }
.journeys-kicker { color: #168b97; font-size: 0.72rem; letter-spacing: 0.15em; font-weight: 800; text-transform: uppercase; }
.journeys-detail__metrics { display: flex; gap: 0.6rem; margin-top: 0.85rem; }
.journeys-metric { min-width: 100px; padding: 0.65rem 0.75rem; background: #f7f8f9; border: 1px solid #e5e7eb; border-radius: 8px; }
.journeys-metric strong, .journeys-metric span { display: block; }
.journeys-metric strong { color: #1f2933; font-size: 1.2rem; }
.journeys-metric span { color: #667085; font-size: 0.78rem; }
.journeys-detail__groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.journeys-main > .journeys-detail .journeys-detail__groups { grid-template-columns: 1fr; gap: 0.75rem; }
.journeys-detail__group h3 { margin: 0.05rem 0 0.45rem; color: #1f2933; font-size: 0.95rem; }
.journeys-detail__row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0; color: #667085; border-bottom: 1px solid #e5e7eb; font-size: 0.85rem; }
.journeys-detail__row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journeys-detail__row strong { color: #344054; }
.journeys-no-data, .journeys-empty { color: #667085; }
html:has(.path-tree-page), body:has(.path-tree-page) { scroll-behavior: smooth; }
@media (min-width: 1024px) {
  html:not(.view-classic):not(.view-bubbles):has(.path-tree-page), body:not(.view-classic):not(.view-bubbles):has(.path-tree-page) { height: auto; min-height: 100%; overflow: auto; }
  html:not(.view-classic):not(.view-bubbles) .main-content:has(.path-tree-page) { height: auto; max-height: none; min-height: 100vh; overflow: visible; }
  html:not(.view-classic):not(.view-bubbles) .main-content:has(.path-tree-page) .dashboard-content { display: block; height: auto; overflow: visible; }
  html:not(.view-classic):not(.view-bubbles) .path-tree-page, html:not(.view-classic):not(.view-bubbles) .path-flow { display: block; overflow: visible; }
  html:not(.view-classic):not(.view-bubbles) .path-tree-stats { display: grid; }
}
@media (max-width: 1050px) {
  .journeys-main { grid-template-columns: minmax(0, 1fr); }
  .journeys-graph { border-right: 0; border-bottom: 1px solid #e5e7eb; }
  .journeys-main > .journeys-detail { border-bottom: 1px solid #e5e7eb; }
  .journeys-routes { grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 180px; }
  .journeys-main > .journeys-detail .journeys-detail__groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journeys-main > .journeys-detail { display: grid; grid-template-columns: minmax(245px, 1.15fr) minmax(0, 2fr); gap: 1.25rem; }
}
@media (max-width: 650px) {
  .journeys-head { align-items: flex-start; flex-direction: column; }
  .journeys-toggle { width: 100%; }
  .journeys-toggle button { min-width: 0; flex: 1 1 0; font-size: 0.78rem; }
  .journeys-routes, .journeys-detail__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journeys-main > .journeys-detail { display: block; }
  .journeys-main > .journeys-detail .journeys-detail__groups { grid-template-columns: 1fr; }
  .journeys-graph { min-height: 480px; overflow-x: auto; }
  .journeys-graph svg { width: 760px; height: 480px; }
}
.bubbles-stage, .bubbles-detail { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; min-width: 0; }
.bubbles-stage { background: #fff; border-color: #e5e7eb; }
.bubbles-stage { overflow: hidden; display: flex; flex-direction: column; height: 560px; min-height: 0; }
.bubbles-stage__intro { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem 0.8rem; border-bottom: 1px solid #edf0f2; }
.bubbles-kicker { color: #168b97; font-size: 0.64rem; line-height: 1.2; letter-spacing: 0.13em; font-weight: 800; }
.bubbles-stage__intro h2 { margin: 0.25rem 0 0; color: #1e2935; font-size: 1.05rem; font-weight: 700; }
.bubbles-stage__hint { color: #77818d; font-size: 0.72rem; }
.bubbles-canvas { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 48% 43%, #eaf7fa 0, #f5f9fb 55%, #f8fafb 100%); }
.bubbles-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 1; }
.bubbles-edge { fill: none; stroke: rgba(73, 160, 174, 0.42); stroke-linecap: round; }
.bubbles-nodes { position: relative; }
.flow-bubble { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.55rem; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--bubble-color, #8b82e8), var(--bubble-color-light, #61b9df)); box-shadow: 0 8px 18px rgba(17, 42, 54, 0.14), 0 0 22px rgba(23, 143, 189, 0.18); cursor: pointer; text-align: center; transition: transform 180ms ease, box-shadow 180ms ease; z-index: 2; }
.flow-bubble:hover { transform: scale(1.055); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28), 0 0 38px var(--bubble-glow, rgba(0, 126, 158, 0.38)); }
.flow-bubble.is-selected { border-color: rgba(255, 255, 255, 0.82); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3), 0 0 42px var(--bubble-glow, rgba(0, 126, 158, 0.42)); z-index: 3; }
.flow-bubble:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.flow-bubble__name { position: relative; max-width: 100%; overflow: hidden; color: var(--bubble-ink, #fff); font-size: 0.9rem; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 4px rgba(13, 34, 44, 0.26); z-index: 1; }
.flow-bubble__count { position: relative; color: var(--bubble-ink, #fff); font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(13, 34, 44, 0.26); z-index: 1; }
.flow-bubble__sessions { position: relative; color: var(--bubble-ink-muted, rgba(255, 255, 255, 0.9)); font-size: 0.72rem; font-weight: 650; line-height: 1; text-shadow: 0 1px 4px rgba(13, 34, 44, 0.26); z-index: 1; }
.bubbles-legend { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.1rem; border-top: 1px solid #edf0f2; background: #fff; color: #697582; font-size: 0.68rem; }
.bubbles-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.bubbles-legend span:last-child { margin-left: auto; }
.bubbles-legend__dot { width: 9px; height: 9px; border-radius: 50%; background: #62c2ce; box-shadow: 0 0 0 3px #e5f7f8; }
.bubbles-legend__line { width: 20px; height: 3px; border-radius: 2px; background: #087b91; }
.bubbles-legend__clicks { gap: 0.5rem !important; }
.bubbles-legend__gradient { width: 62px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #f47b12 0%, #f99b50 35%, #5dc2d6 68%, #178fbd 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.bubbles-detail { padding: 1rem 1.05rem; }
.bubbles-detail__top { display: flex; align-items: center; justify-content: space-between; }
.bubbles-detail__path { margin: 0.8rem 0 0.2rem; color: #1e2935; font-size: 1.25rem; font-weight: 750; overflow-wrap: anywhere; }
.bubbles-detail__summary { margin: 0; color: #737e89; font-size: 0.76rem; }
.bubbles-detail__metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin: 0.65rem 0 0.8rem; }
.bubbles-detail__metric { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 0.4rem; padding: 0.4rem 0.55rem; border: 1px solid #e9eef0; border-radius: 8px; background: #f8fafb; }
.bubbles-detail__metric strong { color: #263643; font-size: 0.9rem; }
.bubbles-detail__metric span { color: #7b858f; font-size: 0.64rem; }
.bubbles-detail__heading { margin: 0.85rem 0 0.3rem; color: #35414c; font-size: 0.76rem; font-weight: 750; }
.bubbles-detail__heading--next { margin-top: 1.05rem; }
.bubbles-detail__row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.7rem; padding: 0.52rem 0; border-bottom: 1px solid #eff2f3; }
.bubbles-detail__label { min-width: 0; overflow: hidden; color: #586572; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.bubbles-detail__row strong { flex: 0 0 auto; color: #283744; font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.bubbles-detail__footnote, .bubbles-empty { margin: 0.6rem 0 0; color: #89929b; font-size: 0.68rem; line-height: 1.45; }
.bubbles-empty--canvas { position: absolute; inset: 40% 1rem auto; text-align: center; }

@media (max-width: 1000px) {
  .bubbles-layout { grid-template-columns: 1fr; }
  .bubbles-stage { height: 520px; }
  .bubbles-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
  .bubbles-detail__top, .bubbles-detail__path, .bubbles-detail__summary, .bubbles-detail__metrics, .bubbles-detail__footnote { grid-column: 1 / -1; }
  .bubbles-detail__heading--next { margin-top: 0.85rem; }
}

@media (max-width: 700px) {
  .bubbles-view__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bubbles-stage { height: 490px; }
  .bubbles-stage__hint { display: none; }
  .bubbles-legend { gap: 0.6rem; flex-wrap: wrap; }
  .bubbles-legend span:last-child { margin-left: 0; }
  .bubbles-detail { display: block; }
}

.classic-chart,
.classic-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.classic-chart {
  position: relative;
  padding: 0.85rem 1rem 0.7rem;
}

.classic-chart__head,
.classic-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eef0f2;
}

.classic-chart__head h2,
.classic-card__head h2 {
  margin: 0;
  color: #1f2933;
  font-size: 0.92rem;
  font-weight: 600;
}

.classic-chart__head strong,
.classic-card__unit {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
}

.classic-chart svg {
  display: block;
  width: 100%;
  height: 240px;
}

.classic-chart__legend:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  padding: 0.35rem 0 0.1rem 1.75rem;
  color: #6b7280;
  font-size: 0.72rem;
}

.classic-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.classic-chart__legend-link,
.classic-card__site-link {
  color: inherit;
  text-decoration: none;
}

.classic-chart__legend-link:hover,
.classic-card__site-link:hover {
  color: #087f8c;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.classic-chart__legend-link:focus-visible,
.classic-card__site-link:focus-visible {
  border-radius: 0.15rem;
  outline: 2px solid #087f8c;
  outline-offset: 2px;
}

.classic-chart__legend-swatch {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.classic-line {
  fill: none;
  stroke: #1a8a96;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.classic-hit {
  fill: transparent;
}

.classic-guide {
  stroke: #1a8a96;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.classic-marker {
  fill: #fff;
  stroke: #1a8a96;
  stroke-width: 2;
  pointer-events: none;
}

.classic-axis {
  fill: #6b7280;
  font-size: 11px;
}

.classic-grid {
  stroke: #eef0f2;
  stroke-width: 1;
}

.classic-tip {
  position: absolute;
  z-index: 2;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #1f2933;
  font-size: 0.75rem;
  line-height: 1.35;
  pointer-events: none;
  white-space: pre-line;
}

.classic-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.classic-card {
  min-width: 0;
  padding: 0.85rem 1rem 0.35rem;
}

.classic-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.classic-card ol.is-scrollable {
  max-height: 21.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.classic-card ol.is-scrollable:focus-visible {
  outline: 2px solid #1593a3;
  outline-offset: 2px;
}

.classic-card__table-wrap {
  max-width: 100%;
  max-height: 23rem;
  overflow: auto;
}

.classic-card__comparison {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.classic-card__comparison thead .classic-card__comparison-metric,
.classic-card__comparison tbody .classic-card__comparison-label {
  width: 45%;
}

.classic-card__comparison th,
.classic-card__comparison td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #f3f4f6;
}

.classic-card__comparison thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.classic-card__comparison thead .classic-card__comparison-metric {
  text-align: left;
}

.classic-card__comparison-title {
  color: #1f2933;
  font-size: 0.92rem;
  font-weight: 600;
}

.classic-card__comparison-unit {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
}

.classic-card__comparison-label {
  max-width: 0;
  overflow: hidden;
  color: #1f2933;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.classic-card__comparison-label .classic-row__icon {
  flex: 0 0 auto;
}

.classic-card__comparison-label .classic-row__label-content {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.classic-card__comparison-label .classic-row__name {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-card__comparison-value {
  color: #1f2933;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.classic-card__comparison-empty {
  padding: 0.65rem 0.55rem !important;
  color: #6b7280;
  text-align: left;
}

.classic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.4rem;
  box-sizing: border-box;
  padding: 0.38rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.classic-row__label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: #1f2933;
  font-size: 0.82rem;
  font-weight: 600;
}

.classic-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #1a8a96;
  font-size: 0.95rem;
  line-height: 1;
}

.classic-row__icon img {
  display: block;
  width: 16px;
  height: 16px;
}

.classic-row__flag {
  font-size: 0.95rem;
}

.classic-row__value {
  color: #1f2933;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.classic-empty {
  margin: 0.2rem 0 0.7rem;
  color: #6b7280;
  font-size: 0.8rem;
}

@media (max-width: 800px) {
  .classic-cards {
    grid-template-columns: 1fr;
  }
}
