:root {
  --bg: #07090d;
  --text: #eef3ff;
  --muted: #9ea9bd;
  --line: rgba(255, 255, 255, .14);
  --blue: #55c7ff;
  --green: #70f0b1;
  --red: #ff5f6d;
  --amber: #ffc857;
  --purple: #b58cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

body[data-ga-page="attribution_map"] {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
radial-gradient(circle at 18% 14%, rgba(85, 199, 255, .16), transparent 34%),
radial-gradient(circle at 84% 18%, rgba(112, 240, 177, .12), transparent 28%),
radial-gradient(circle at 48% 84%, rgba(181, 140, 255, .12), transparent 34%),
var(--bg);
  overflow-x: hidden;
}

.app {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 8px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr min(300px, 32%);
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.hero > div:first-child {
  display: contents;
}

.hero .eyebrow,
.hero h1 {
  grid-column: 1 / -1;
}

.hero p {
  grid-column: 1;
  grid-row: 3;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .94;
  letter-spacing: -.07em;
}

.hero p {
  margin: 14px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.hero-card {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .035));
  box-shadow: var(--shadow);
}

.hero-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr 340px;
  gap: 18px;
  align-items: start;
}

.panel,
.map-shell {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035));
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.panel-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -.02em;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.summary {
  padding: 18px;
}

.summary-name {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 0 0 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(0, 0, 0, .16);
}

.metric strong {
  display: block;
  font-size: 20px;
  letter-spacing: -.04em;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.controls {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

button {
  border: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.primary-btn {
  height: 54px;
  border-radius: 18px;
  background: var(--btn-primary-bg, #3d8fd6);
  border: 1px solid var(--btn-primary-border, #3580c4);
  color: var(--btn-primary-text, #fff);
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 8px 24px rgba(61, 143, 214, 0.35);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--btn-primary-bg-hover, #3580c4);
  border-color: var(--btn-primary-bg-hover, #3580c4);
  box-shadow: 0 10px 28px rgba(61, 143, 214, 0.42);
}

.secondary-btn {
  height: 42px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 13px;
  font-weight: 800;
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, .13);
}

.map-shell {
  padding: clamp(14px, 2vw, 24px);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035)),
    radial-gradient(circle at 50% 0%, rgba(85, 199, 255, .15), transparent 45%);
}

.map-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 14px;
}

.map-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 520px;
  min-width: 0;
  flex-wrap: wrap;
}

.map-top-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ga-date-picker {
  position: relative;
}

.ga-date-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ga-date-picker-trigger:hover,
.ga-date-picker-trigger[aria-expanded="true"] {
  border-color: rgba(85, 199, 255, .45);
  background: rgba(85, 199, 255, .08);
}

.ga-date-picker-icon {
  font-size: 14px;
  line-height: 1;
}

.ga-date-picker-caret {
  color: var(--muted);
  font-size: 11px;
}

.ga-date-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: rgba(10, 12, 18, .98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

.ga-date-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ga-date-preset {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ga-date-preset:hover {
  border-color: rgba(85, 199, 255, .35);
  background: rgba(85, 199, 255, .08);
}

.ga-date-preset.is-active {
  border-color: rgba(112, 240, 177, .45);
  background: rgba(112, 240, 177, .10);
  color: #b8f5d6;
}

.ga-date-custom {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

.ga-date-custom-title {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.ga-date-custom-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ga-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.ga-date-field input {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 12px;
}

.ga-date-apply {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #55c7ff, #70f0b1);
  color: #071018;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.attribution-view-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(0, 0, 0, .24);
}

.attribution-view-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.attribution-view-btn.is-active {
  background: rgba(85, 199, 255, .16);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(85, 199, 255, .28);
}

.attribution-metric-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(0, 0, 0, .24);
}

.attribution-metric-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.attribution-metric-btn.is-active {
  background: rgba(112, 240, 177, .14);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(112, 240, 177, .28);
}

.status {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  background: rgba(0, 0, 0, .20);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

#statusText {
  min-width: 0;
}

.status-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px var(--amber);
  flex: 0 0 auto;
}

.status.active .status-light {
  background: var(--green);
  box-shadow: 0 0 22px var(--green);
}

.status.issue .status-light {
  background: var(--red);
  box-shadow: 0 0 22px var(--red);
}

.mode-note {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .18);
  white-space: nowrap;
  max-width: min(100%, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-note strong {
  color: var(--text);
}

#nodesLayer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#nodesLayer .node {
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  text-align: left;
  color: inherit;
}

.flow-map {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    #090d14;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    inset 0 0 80px rgba(85, 199, 255, .08),
    0 24px 100px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 12.5% 12.5%;
  mask-image: radial-gradient(circle at 50% 50%, black 58%, transparent 94%);
  pointer-events: none;
}

svg.lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.flow-path {
  fill: none;
  stroke: rgba(109, 230, 255, .75);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(109, 230, 255, .75));
  stroke-dasharray: 10 10;
  opacity: 0;
  transition: opacity 280ms ease;
  animation: dashMove 900ms linear infinite;
}

.flow-path.visible {
  opacity: 1;
}

.flow-path.upstream {
  stroke: rgba(181, 140, 255, .78);
  filter: drop-shadow(0 0 8px rgba(181, 140, 255, .75));
  stroke-width: 2.4;
}

.flow-path.issue {
  stroke: rgba(255, 95, 109, .9);
  filter: drop-shadow(0 0 10px rgba(255, 95, 109, .8));
}

@keyframes dashMove {
  to {
    stroke-dashoffset: -20;
  }
}

.node:not(.form):not(.visible) {
  opacity: 0;
  pointer-events: none;
}

.node {
  position: absolute;
  z-index: 5;
  width: 118px;
  min-height: 78px;
  transform: translate(-50%, -50%) scale(.96);
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1a2230, #111722);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 16px 50px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 220ms ease;
  opacity: .78;
}

.node:hover {
  transform: translate(-50%, -50%) scale(1.02);
  border-color: rgba(85, 199, 255, .46);
}

.node.visible {
  opacity: 1;
}

.node.active {
  transform: translate(-50%, -50%) scale(1.05);
  border-color: rgba(109, 230, 255, .75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 0 28px rgba(109, 230, 255, .32),
    0 24px 70px rgba(0, 0, 0, .38);
}

.node.issue {
  border-color: rgba(255, 95, 109, .75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 0 28px rgba(255, 95, 109, .32),
    0 24px 70px rgba(0, 0, 0, .38);
}

.node.form {
  width: 158px;
  min-height: 110px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(112, 240, 177, .28), rgba(85, 199, 255, .13)),
    linear-gradient(145deg, #1a2230, #111722);
  border-color: rgba(112, 240, 177, .45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 0 40px rgba(112, 240, 177, .20),
    0 30px 90px rgba(0, 0, 0, .46);
  opacity: 1;
}

.node.source-google {
  background: linear-gradient(145deg, rgba(85, 199, 255, .25), rgba(17, 24, 39, .92));
}

.node.source-meta {
  background: linear-gradient(145deg, rgba(181, 140, 255, .28), rgba(17, 24, 39, .92));
}

.node.source-email {
  background: linear-gradient(145deg, rgba(112, 240, 177, .22), rgba(17, 24, 39, .92));
}

.node.source-direct {
  background: linear-gradient(145deg, rgba(255, 200, 87, .24), rgba(17, 24, 39, .92));
}

.node.source-referral {
  background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(17, 24, 39, .92));
}

.node.source-linkedin {
  background: linear-gradient(145deg, rgba(85, 199, 255, .18), rgba(181, 140, 255, .20), rgba(17, 24, 39, .92));
}

.node.source-x {
  background: linear-gradient(145deg, rgba(255, 255, 255, .14), rgba(17, 24, 39, .94));
}

.node.source-reddit {
  background: linear-gradient(145deg, rgba(255, 69, 0, .28), rgba(255, 120, 48, .14), rgba(17, 24, 39, .92));
}

.node.source-other {
  background: linear-gradient(145deg, rgba(160, 174, 192, .22), rgba(120, 130, 150, .12), rgba(17, 24, 39, .92));
  border-color: rgba(160, 174, 192, .32);
}

.node.upstream-node {
  width: 104px;
  min-height: 66px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.82);
}

.node.upstream-node.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.node-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(85, 199, 255, .14);
  border: 1px solid rgba(85, 199, 255, .28);
  font-size: 10px;
  font-weight: 950;
  margin-bottom: 8px;
}

.node-title {
  font-weight: 950;
  font-size: 12px;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.node-meta {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  margin-top: 4px;
}

.node-value {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 900;
  font-size: 12px;
}

.mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.flow-particle {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue), 0 0 34px rgba(85, 199, 255, .6);
  pointer-events: none;
  opacity: 0;
}

.right-panel-content {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.detail-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(0, 0, 0, .16);
}

.detail-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.source-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 12px;
  transition: 160ms ease;
}

.source-row.active {
  color: var(--text);
  border-color: rgba(85, 199, 255, .38);
  background: rgba(85, 199, 255, .09);
}

.source-row-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
}

.source-row small {
  color: var(--muted);
  text-align: right;
}

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

  .right-panel {
    grid-column: 1 / -1;
  }

  .app.attribution-logged-in .layout--logged-in {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .app.attribution-logged-in .layout--logged-in .right-panel {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 880px) {
  .hero {
    display: block;
  }

  .hero > div:first-child {
    display: block;
  }

  .hero-card {
    margin-top: 18px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .map-top {
    flex-direction: column;
    align-items: stretch;
  }

  .map-top-actions {
    flex-direction: column;
    align-items: stretch;
    flex-basis: auto;
    width: 100%;
  }

  .map-top-controls {
    justify-content: flex-start;
  }

  .mode-note {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
  }

  .ga-date-picker,
  .ga-date-picker-trigger {
    width: 100%;
  }

  .ga-date-picker-menu {
    left: 0;
    right: 0;
    width: auto;
  }

  .mode-note {
    text-align: left;
  }

  .node {
    width: 104px;
    min-height: 72px;
  }

  .node.form {
    width: 138px;
  }
}

.flow-map.is-loading #nodesLayer,
.flow-map.is-loading svg.lines {
  opacity: 0.35;
  filter: blur(1px);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.map-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.map-loader[hidden] {
  display: none !important;
}

.map-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-loader__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(85, 199, 255, .14), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(112, 240, 177, .08), transparent 55%),
    rgba(7, 9, 13, .72);
  backdrop-filter: blur(10px);
}

.map-loader__paths {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  overflow: visible;
  pointer-events: none;
}

.map-loader__path {
  fill: none;
  stroke: rgba(109, 230, 255, .55);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-dasharray: 3 5;
  filter: drop-shadow(0 0 4px rgba(109, 230, 255, .65));
  animation: loader-path-flow 1.8s linear infinite;
}

.map-loader__path--b { animation-delay: .15s; stroke: rgba(112, 240, 177, .55); }
.map-loader__path--c { animation-delay: .3s; stroke: rgba(181, 140, 255, .55); }
.map-loader__path--d { animation-delay: .45s; }
.map-loader__path--e { animation-delay: .6s; stroke: rgba(255, 200, 87, .55); }
.map-loader__path--f { animation-delay: .75s; stroke: rgba(112, 240, 177, .55); }

@keyframes loader-path-flow {
  to { stroke-dashoffset: -16; }
}

.map-loader__orbit {
  position: absolute;
  left: 50%;
  top: 44%;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}

.map-loader__orbit--outer {
  width: min(68%, 420px);
  aspect-ratio: 1;
  animation: loader-orbit-spin 14s linear infinite;
}

.map-loader__orbit--inner {
  width: min(46%, 280px);
  aspect-ratio: 1;
  animation: loader-orbit-spin 9s linear infinite reverse;
}

@keyframes loader-orbit-spin {
  to { rotate: 360deg; }
}

.map-loader__node {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
  animation: loader-node-pulse 1.6s ease-in-out infinite;
}

.map-loader__node--g { top: -7px; left: calc(50% - 7px); background: #55c7ff; color: #55c7ff; }
.map-loader__node--b { top: calc(50% - 7px); right: -7px; background: #70f0b1; color: #70f0b1; animation-delay: .2s; }
.map-loader__node--p { bottom: -7px; left: calc(50% - 7px); background: #b58cff; color: #b58cff; animation-delay: .4s; }
.map-loader__node--a { top: calc(50% - 7px); left: -7px; background: #ffc857; color: #ffc857; animation-delay: .6s; }
.map-loader__node--e { top: -7px; left: calc(50% - 7px); background: #ff8fab; color: #ff8fab; }
.map-loader__node--r { bottom: 8%; right: -7px; background: #70f0b1; color: #70f0b1; animation-delay: .25s; }
.map-loader__node--m { bottom: 8%; left: -7px; background: #55c7ff; color: #55c7ff; animation-delay: .5s; }

@keyframes loader-node-pulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.35); opacity: 1; }
}

.map-loader__hub {
  position: absolute;
  left: 50%;
  top: 44%;
  translate: -50% -50%;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
}

.map-loader__hub-aura {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(85, 199, 255, .55), rgba(112, 240, 177, .45), rgba(181, 140, 255, .45), rgba(85, 199, 255, .55));
  mask: radial-gradient(circle, transparent 58%, black 60%);
  animation: loader-aura-spin 3.2s linear infinite;
  opacity: .75;
}

@keyframes loader-aura-spin {
  to { rotate: 360deg; }
}

.map-loader__hub-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(109, 230, 255, .45);
  animation: loader-hub-ring 2.4s ease-out infinite;
}

.map-loader__hub-ring--delay {
  animation-delay: 1.2s;
  border-color: rgba(112, 240, 177, .35);
}

@keyframes loader-hub-ring {
  0% { transform: scale(0.72); opacity: .95; }
  100% { transform: scale(1.55); opacity: 0; }
}

.map-loader__hub-core {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--text);
  background: linear-gradient(145deg, rgba(85, 199, 255, .28), rgba(112, 240, 177, .18));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .18),
    0 0 32px rgba(85, 199, 255, .35);
  animation: loader-hub-breathe 2s ease-in-out infinite;
}

@keyframes loader-hub-breathe {
  0%, 100% { transform: scale(1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 32px rgba(85, 199, 255, .35); }
  50% { transform: scale(1.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24), 0 0 48px rgba(112, 240, 177, .45); }
}

.map-loader__copy {
  position: absolute;
  left: 50%;
  bottom: 14%;
  translate: -50% 0;
  text-align: center;
  width: min(88%, 420px);
  z-index: 2;
}

.map-loader__title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 6px;
  background: linear-gradient(90deg, var(--text), var(--blue), var(--green), var(--text));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: loader-title-shimmer 2.8s linear infinite;
}

@keyframes loader-title-shimmer {
  to { background-position: 200% center; }
}

.map-loader__sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.map-loader__dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
  vertical-align: baseline;
}

.map-loader__dots i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  opacity: .35;
  animation: loader-dot-bounce 1.2s ease-in-out infinite;
}

.map-loader__dots i:nth-child(2) { animation-delay: .15s; }
.map-loader__dots i:nth-child(3) { animation-delay: .3s; }

@keyframes loader-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Source detail modal */
.source-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.source-modal-overlay[hidden] {
  display: none !important;
}

.source-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(8px);
  animation: source-modal-fade-in .28s ease;
}

.source-modal {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 26px 26px 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)),
    #0b1018;
  box-shadow:
    0 30px 100px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: source-modal-pop-in .38s cubic-bezier(.22, 1, .36, 1);
}

@keyframes source-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes source-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.source-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.source-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}

.source-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 36px;
  margin-bottom: 18px;
}

.source-modal-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(85, 199, 255, .14);
  border: 1px solid rgba(85, 199, 255, .28);
  font-size: 13px;
  font-weight: 950;
  flex-shrink: 0;
}

.source-modal-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.source-modal-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: capitalize;
}

.source-modal-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(112, 240, 177, .10);
  border: 1px solid rgba(112, 240, 177, .22);
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 20px;
}

.source-modal-value::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.source-modal-body {
  margin-bottom: 18px;
}

.source-modal-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.source-modal-description {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.source-modal-detail {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-modal-pages-wrap {
  margin: 18px 0 20px;
}

.source-modal-pages {
  border-radius: 18px;
  overflow: hidden;
}

.source-modal-pages-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border: 1px solid rgba(85, 199, 255, .45);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(85, 199, 255, .22), rgba(112, 240, 177, .14)),
    linear-gradient(145deg, rgba(26, 34, 48, .95), rgba(17, 23, 34, .98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 0 28px rgba(85, 199, 255, .18),
    0 12px 32px rgba(0, 0, 0, .35);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.source-modal-pages-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(112, 240, 177, .55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 0 36px rgba(112, 240, 177, .22),
    0 16px 40px rgba(0, 0, 0, .4);
}

.source-modal-pages[open] .source-modal-pages-toggle {
  border-radius: 18px 18px 0 0;
  border-bottom-color: rgba(255, 255, 255, .08);
  background:
    linear-gradient(145deg, rgba(85, 199, 255, .28), rgba(112, 240, 177, .18)),
    linear-gradient(145deg, rgba(26, 34, 48, .98), rgba(17, 23, 34, 1));
}

.source-modal-pages-toggle::-webkit-details-marker {
  display: none;
}

.source-modal-pages-toggle-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.source-modal-pages-toggle-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  color: var(--text);
  background: rgba(85, 199, 255, .18);
  border: 1px solid rgba(85, 199, 255, .35);
  box-shadow: 0 0 20px rgba(85, 199, 255, .25);
}

.source-modal-pages-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.source-modal-pages-toggle-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--text);
}

.source-modal-pages-toggle-sub {
  font-size: 12px;
  font-weight: 600;
  color: #b8d4f0;
  line-height: 1.35;
}

.source-modal-pages-label-open {
  display: none;
}

.source-modal-pages[open] .source-modal-pages-label-closed {
  display: none;
}

.source-modal-pages[open] .source-modal-pages-label-open {
  display: inline;
}

.source-modal-pages-toggle-caret {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
  margin-top: -4px;
  transition: transform 180ms ease;
  filter: drop-shadow(0 0 6px rgba(112, 240, 177, .6));
}

.source-modal-pages[open] .source-modal-pages-toggle-caret {
  transform: rotate(135deg);
  margin-top: 4px;
}

.source-modal-pages-panel {
  border: 1px solid rgba(85, 199, 255, .35);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(0, 0, 0, .28);
  overflow: hidden;
}

.source-modal-pages:not([open]) .source-modal-pages-panel {
  display: none;
}

.source-modal-pages-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.source-modal-pages-loader[hidden] {
  display: none !important;
}

.source-modal-pages-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: source-modal-pages-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes source-modal-pages-spin {
  to { transform: rotate(360deg); }
}

.source-modal-pages-head,
.source-modal-page-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr auto;
  gap: 10px;
  align-items: start;
  padding: 8px 14px;
  font-size: 12px;
}

.source-modal-pages-head {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

.source-modal-pages-list {
  max-height: 220px;
  overflow-y: auto;
}

.source-modal-page-row {
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: var(--text);
}

.source-modal-page-row:last-child {
  border-bottom: 0;
}

.source-modal-page-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
  color: #c5d4ea;
}

.source-modal-page-title {
  line-height: 1.35;
}

.source-modal-page-metric {
  text-align: right;
  white-space: nowrap;
  color: var(--green);
  font-weight: 800;
}

.source-modal-pages-empty {
  padding: 12px 14px 14px;
  color: var(--muted);
  font-size: 12px;
}

.source-modal-pages-muted {
  color: var(--muted);
}

.source-modal-alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  background: rgba(255, 200, 87, .10);
  border: 1px solid rgba(255, 200, 87, .28);
  color: var(--amber);
  font-size: 13px;
  line-height: 1.45;
}

.source-modal-footer {
  padding-top: 4px;
}

.source-modal-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(85, 199, 255, .95), rgba(61, 143, 214, .95));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -.02em;
  box-shadow: 0 8px 24px rgba(61, 143, 214, .35);
  transition: transform .15s ease;
}

.source-modal-help-btn:hover {
  transform: translateY(-1px);
  color: #fff;
}

.source-modal-overlay.is-closing .source-modal-backdrop {
  animation: source-modal-fade-out .22s ease forwards;
}

.source-modal-overlay.is-closing .source-modal {
  animation: source-modal-pop-out .22s ease forwards;
}

@keyframes source-modal-fade-out {
  to { opacity: 0; }
}

@keyframes source-modal-pop-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(.96);
  }
}

body.source-modal-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .map-loader__orbit,
  .map-loader__hub-aura,
  .map-loader__hub-ring,
  .map-loader__hub-core,
  .map-loader__path,
  .map-loader__node,
  .map-loader__title,
  .map-loader__dots i,
  .source-modal-backdrop,
  .source-modal {
    animation: none !important;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100vw - 18px, 1360px);
    padding-top: 16px;
  }

  .flow-map {
    border-radius: 22px;
  }

  .node {
    width: 86px;
    min-height: 62px;
    padding: 7px;
    border-radius: 14px;
  }

  .node.form {
    width: 112px;
    min-height: 92px;
  }

  .node-icon {
    width: 23px;
    height: 23px;
    border-radius: 8px;
    font-size: 8px;
    margin-bottom: 5px;
  }

  .node-title {
    font-size: 10px;
  }

  .node-meta,
  .node-value {
    font-size: 8px;
  }
}

/* Logged-in layout: map-first, source details sidebar, GA settings at bottom */
.app.attribution-logged-in {
  padding-top: 10px;
}

.app.attribution-logged-in .layout--logged-in {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

.app.attribution-logged-in .layout--logged-in .map-shell {
  grid-column: 1;
  grid-row: 1;
}

.app.attribution-logged-in .layout--logged-in .right-panel {
  grid-column: 2;
  grid-row: 1;
}

.app.attribution-logged-in .flow-map {
  width: min(100%, 960px);
}

.app.attribution-logged-in .ga-settings-footer {
  margin-top: 16px;
}

.app.attribution-logged-in .ga-settings-footer .ga-connect-panel {
  margin-bottom: 0;
}

@media (max-width: 880px) {
  .app.attribution-logged-in .layout--logged-in {
    grid-template-columns: 1fr;
  }

  .app.attribution-logged-in .layout--logged-in .right-panel {
    grid-column: 1;
    grid-row: 2;
  }
}

.attribution-share-menu {
  position: relative;
  flex-shrink: 0;
}

.attribution-share-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(85, 199, 255, .35);
  background: rgba(85, 199, 255, .12);
  color: #9edcff;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.attribution-share-menu-btn:hover,
.attribution-share-menu-btn[aria-expanded="true"] {
  background: rgba(85, 199, 255, .22);
  border-color: rgba(109, 230, 255, .55);
  color: #d8f0ff;
}

.attribution-share-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
  padding: 6px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #121820;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  z-index: 120;
}

.attribution-share-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  color: #eef3ff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
}

.attribution-share-menu-item:hover {
  background: rgba(255, 255, 255, .06);
  color: #55c7ff;
}

.ga-share-settings.attribution-share-highlight {
  box-shadow: 0 0 0 2px rgba(85, 199, 255, .45);
  border-radius: 14px;
  transition: box-shadow .25s ease;
}

.ga-export-btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(85, 199, 255, .35);
  background: rgba(85, 199, 255, .12);
  color: #9edcff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ga-export-btn:hover:not(:disabled) {
  background: rgba(85, 199, 255, .22);
}

.ga-export-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ga-attribution-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #9ea9bd;
  font-size: 12px;
  line-height: 1.4;
}

.ga-attribution-footer__property {
  color: #d4deef;
  font-weight: 600;
}

.ga-attribution-footer__note {
  color: #8b97ad;
}

.attribution-export-root {
  width: 100%;
}

.attribution-export-metrics {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .08);
}

.attribution-export-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.attribution-export-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attribution-export-metric strong {
  font-size: 18px;
  color: #eef3ff;
}

.attribution-export-metric span {
  font-size: 11px;
  color: #9ea9bd;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hero--compact {
  margin-bottom: 12px;
}

.hero--compact h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.app.attribution-share-view .ga-settings-footer,
.app.attribution-share-view .hero:not(.hero--compact) {
  display: none;
}

@media (max-width: 720px) {
  .attribution-export-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ga-compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b8c5dc;
  cursor: pointer;
  user-select: none;
}

.ga-compare-toggle input {
  accent-color: var(--attribution-accent, #55c7ff);
}

/* Saved views modal */
.views-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.views-modal-overlay[hidden] {
  display: none !important;
}

.views-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(8px);
}

.views-modal {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 24px 24px 20px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)),
    #0b1018;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

.views-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: #9ea9bd;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.views-modal-close:hover {
  color: #eef3ff;
  background: rgba(255, 255, 255, .12);
}

.views-modal-header {
  padding-right: 40px;
  margin-bottom: 18px;
}

.views-modal-title {
  margin: 0 0 6px;
  font-size: 22px;
  color: #eef3ff;
}

.views-modal-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #9ea9bd;
}

.views-modal-save {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(85, 199, 255, .25);
  background: rgba(85, 199, 255, .08);
}

.views-modal-save-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b8c5dc;
}

.views-modal-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.views-modal-name-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(0, 0, 0, .35);
  color: #eef3ff;
  font-size: 14px;
}

.views-modal-current {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #9ea9bd;
}

.views-modal-list-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8b97ad;
}

.views-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.views-modal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .22);
  transition: border-color .15s ease, background .15s ease;
}

.views-modal-item:hover {
  border-color: rgba(85, 199, 255, .35);
  background: rgba(85, 199, 255, .06);
}

.views-modal-item.is-active {
  border-color: rgba(85, 199, 255, .5);
  background: rgba(85, 199, 255, .12);
}

.views-modal-item__main {
  grid-column: 1;
  min-width: 0;
  text-align: left;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.views-modal-item__name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #eef3ff;
}

.views-modal-item__meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: #9ea9bd;
}

.views-modal-item__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #55c7ff;
  background: rgba(85, 199, 255, .15);
  vertical-align: middle;
}

.views-modal-item__actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.views-modal-item__delete {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 154, 165, .35);
  background: rgba(255, 80, 100, .1);
  color: #ff9aa5;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.views-modal-item__delete:hover {
  background: rgba(255, 80, 100, .2);
  color: #ffc4cb;
}

.views-modal-item.is-confirming {
  border-color: rgba(255, 154, 165, .45);
  background: rgba(255, 80, 100, .08);
}

.views-modal-item__confirm {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 154, 165, .25);
}

.views-modal-item__confirm-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #ffc4cb;
}

.views-modal-item__confirm-text strong {
  color: #eef3ff;
  font-weight: 700;
}

.views-modal-item__confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.views-modal-item__confirm-cancel,
.views-modal-item__confirm-delete {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.views-modal-item__confirm-cancel {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  color: #b8c5dc;
}

.views-modal-item__confirm-cancel:hover {
  background: rgba(255, 255, 255, .12);
  color: #eef3ff;
}

.views-modal-item__confirm-delete {
  border: 1px solid rgba(255, 120, 140, .5);
  background: rgba(220, 53, 69, .35);
  color: #fff;
}

.views-modal-item__confirm-delete:hover {
  background: rgba(220, 53, 69, .55);
}

.views-modal-empty {
  margin: 0;
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: #9ea9bd;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, .15);
}

@media (max-width: 520px) {
  .views-modal-item {
    grid-template-columns: 1fr;
  }

  .views-modal-item__actions {
    grid-column: 1;
    grid-row: auto;
    flex-direction: row;
    justify-content: flex-end;
  }
}

.node-compare {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.node-compare.compare-up {
  color: #70f0b1;
}

.node-compare.compare-down {
  color: #ff9aa5;
}

.node-compare.compare-flat,
.node-compare.compare-new {
  color: #9ea9bd;
}

.source-row-compare {
  font-style: normal;
  margin-left: 6px;
  font-weight: 700;
}

.source-row-compare.compare-up {
  color: #70f0b1;
}

.source-row-compare.compare-down {
  color: #ff9aa5;
}

.attribution-branding {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 24px);
  width: 100%;
  margin-bottom: 14px;
  padding: clamp(14px, 2vw, 20px) clamp(16px, 2.5vw, 24px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    rgba(0, 0, 0, .28);
}

.attribution-branding__logo-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  max-width: min(320px, 42vw);
  height: clamp(56px, 8vw, 80px);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.attribution-branding__logo {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}

.attribution-branding__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.attribution-branding__agency {
  display: block;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  color: #eef3ff;
}

.attribution-branding__subtitle {
  display: block;
  margin-top: 6px;
  font-size: clamp(12px, 1.4vw, 14px);
  line-height: 1.45;
  color: #9ea9bd;
}

.map-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.attribution-branding--export-clone {
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .attribution-branding {
    flex-direction: column;
    align-items: stretch;
  }

  .attribution-branding__logo-wrap {
    width: 100%;
    max-width: none;
    height: 72px;
  }

  .attribution-branding__logo {
    max-height: 56px;
    object-position: center center;
  }
}

.app.attribution-embed-view .map-top-actions {
  flex-wrap: wrap;
}

@media print {
  body.attribution-print-mode {
    background: #fff !important;
    color: #111827 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.attribution-print-mode .public-tools-nav,
  body.attribution-print-mode .map-top-toolbar,
  body.attribution-print-mode .map-top-actions,
  body.attribution-print-mode .right-panel,
  body.attribution-print-mode .ga-settings-footer,
  body.attribution-print-mode .views-modal-overlay,
  body.attribution-print-mode .source-modal-overlay,
  body.attribution-print-mode .hero,
  body.attribution-print-mode .map-loader,
  body.attribution-print-mode .status {
    display: none !important;
  }

  body.attribution-print-mode main.app {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.attribution-print-mode .layout,
  body.attribution-print-mode .layout--logged-in {
    display: block !important;
  }

  body.attribution-print-mode .map-shell,
  body.attribution-print-mode .attribution-export-root,
  body.attribution-print-mode .attribution-print-active {
    width: 100% !important;
    max-width: none !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: visible !important;
  }

  body.attribution-print-mode .attribution-export-metrics,
  body.attribution-print-mode .attribution-branding,
  body.attribution-print-mode .ga-attribution-footer {
    display: block !important;
    visibility: visible !important;
  }

  body.attribution-print-mode .attribution-export-metrics {
    border: 1px solid #d1d5db !important;
    background: #f9fafb !important;
  }

  body.attribution-print-mode .attribution-export-metric strong {
    color: #111827 !important;
  }

  body.attribution-print-mode .attribution-export-metric span {
    color: #4b5563 !important;
  }

  body.attribution-print-mode .attribution-branding {
    display: flex !important;
    border: 1px solid #d1d5db !important;
    background: #f9fafb !important;
  }

  body.attribution-print-mode .attribution-branding__logo-wrap {
    background: #fff !important;
    box-shadow: none !important;
  }

  body.attribution-print-mode .attribution-branding__agency {
    color: #111827 !important;
  }

  body.attribution-print-mode .attribution-branding__subtitle,
  body.attribution-print-mode .ga-attribution-footer {
    color: #4b5563 !important;
  }

  body.attribution-print-mode .flow-map {
    width: 100% !important;
    max-width: none !important;
    min-height: 560px !important;
    aspect-ratio: auto !important;
    height: auto !important;
    background: #f3f4f6 !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.attribution-print-mode .grid-glow {
    opacity: 0.35 !important;
  }

  body.attribution-print-mode .flow-path {
    opacity: 1 !important;
    stroke: #2563eb !important;
    stroke-width: 2px !important;
    filter: none !important;
    animation: none !important;
  }

  body.attribution-print-mode .node,
  body.attribution-print-mode .node.visible,
  body.attribution-print-mode .node:not(.form):not(.visible) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    background: #fff !important;
    border: 1px solid #374151 !important;
    color: #111827 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.attribution-print-mode .node-title,
  body.attribution-print-mode .node-meta,
  body.attribution-print-mode .node-value {
    color: #111827 !important;
    text-shadow: none !important;
  }

  body.attribution-print-mode .node-value {
    color: #047857 !important;
  }

  body.attribution-print-mode .node-compare.compare-up {
    color: #047857 !important;
  }

  body.attribution-print-mode .node-compare.compare-down {
    color: #b91c1c !important;
  }

  body.attribution-print-mode .node-icon {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
  }

  body.attribution-print-mode svg.lines circle {
    display: none !important;
  }
}
