:root {
  --atlas-main-width: min(1500px, calc(100% - 28px));
  --atlas-side-width: 360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.atlas-body {
  color: var(--text);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Fallback only: if custom cursor init fails, keep a visible pointer. */
.atlas-body.atlas-cursor-fallback,
.atlas-body.atlas-cursor-fallback * {
  cursor: auto !important;
}

.atlas-header.header {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  z-index: 45;
}

.atlas-header-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.atlas-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.atlas-brand-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(13, 202, 240, 0.34));
}

.atlas-brand-link span {
  font-size: 1.05rem;
}

.atlas-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.atlas-nav-link.btn.btn-pill {
  text-decoration: none;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  color: #04161d !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

.atlas-nav-muted {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)), #1b222d !important;
  color: var(--muted) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.34) !important;
  text-shadow: none !important;
}

.atlas-nav-muted:hover {
  color: #d8eaf6 !important;
  border-color: rgba(13, 202, 240, 0.34) !important;
  box-shadow: 0 10px 26px rgba(13, 202, 240, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.atlas-nav-link.is-active {
  box-shadow: 0 12px 34px rgba(13, 202, 240, 0.26), 0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
  color: #03131a !important;
}

.atlas-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.atlas-action-btn {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
  color: #04161d !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

.atlas-main {
  position: relative;
  z-index: 2;
  width: var(--atlas-main-width);
  margin: 20px auto 44px;
  display: grid;
  gap: 16px;
  flex: 1 0 auto;
}

.atlas-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.atlas-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.atlas-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.atlas-panel h2,
.atlas-panel h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: 0.2px;
}

.atlas-panel h2::before,
.atlas-panel h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #0dcaf0, rgba(13, 202, 240, 0.28));
  box-shadow: 0 0 10px rgba(13, 202, 240, 0.44);
  flex-shrink: 0;
}

.atlas-panel p {
  margin: 0;
  color: #a8bed0;
  line-height: 1.6;
}

.atlas-muted {
  color: #8ca4b8;
  font-size: 0.82rem;
}

.atlas-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #bdd1df;
  line-height: 1.62;
}

.atlas-list li {
  margin-bottom: 4px;
}

.atlas-inline-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.atlas-inline-link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(13, 202, 240, 0.65);
}

.atlas-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.atlas-grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.atlas-hero-card {
  padding: 26px;
  border-radius: 20px;
  border-color: rgba(13, 202, 240, 0.2) !important;
  background:
    radial-gradient(120% 95% at 92% 6%, rgba(13, 202, 240, 0.12), transparent 55%),
    radial-gradient(90% 90% at 8% 92%, rgba(0, 160, 255, 0.1), transparent 54%),
    linear-gradient(180deg, rgba(18, 22, 28, 0.86), rgba(18, 22, 28, 0.64)) !important;
}

.atlas-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #bfefff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.atlas-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0dcaf0;
  box-shadow: 0 0 12px rgba(13, 202, 240, 0.9);
}

.atlas-hero-card h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.25vw, 2.5rem);
  line-height: 1.16;
  max-width: 960px;
}

.atlas-hero-card h1::before {
  display: none;
}

.atlas-hero-card h1 span {
  color: #9befff;
  text-shadow: 0 0 16px rgba(13, 202, 240, 0.28);
}

.atlas-hero-card p {
  margin-top: 14px;
  font-size: 1rem;
  max-width: 980px;
}

.atlas-hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.atlas-hero-btn {
  text-decoration: none;
  min-height: 40px;
  padding: 10px 16px;
}

.atlas-hero-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.atlas-stat-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 18, 31, 0.62);
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.atlas-stat-card b {
  display: block;
  color: #e6fbff;
  font-size: 1.28rem;
}

.atlas-stat-card span {
  color: #93adc2;
  font-size: 0.82rem;
}

.atlas-mini-panel a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.atlas-mini-panel a:hover {
  text-decoration: underline;
}

.atlas-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.atlas-search-wrap {
  min-width: 240px;
}

.atlas-input.input {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.atlas-toolbar-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.atlas-toolbar-group label {
  min-width: 156px;
  display: grid;
  gap: 4px;
  color: #a8c0d2;
  font-size: 0.8rem;
  font-weight: 700;
}

.atlas-toolbar-group input[type="range"] {
  width: 100%;
  accent-color: #0dcaf0;
}

.atlas-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--atlas-side-width);
  gap: 16px;
}

.atlas-map-panel {
  padding: 14px;
}

.atlas-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.atlas-map-canvas-wrap {
  position: relative;
  min-height: 620px;
  border-radius: 14px;
  border: 1px solid rgba(13, 202, 240, 0.2);
  background:
    radial-gradient(620px 300px at 20% 20%, rgba(13, 202, 240, 0.08), transparent 70%),
    radial-gradient(460px 340px at 80% 78%, rgba(0, 160, 255, 0.08), transparent 72%),
    rgba(6, 16, 28, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

#atlasMapCanvas,
#privateMapCanvas {
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: block;
}

#privateMapCanvas {
  min-height: 520px;
}

.atlas-map-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.atlas-family-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 18, 24, 0.68);
  box-shadow: 0 0 16px rgba(0, 200, 255, 0.1);
  color: #c7d9e6;
  font-size: 0.76rem;
  font-weight: 700;
}

.atlas-family-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--pill-color, #9da6b8);
  box-shadow: 0 0 10px var(--pill-color, #9da6b8);
}

.atlas-family-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
}

.atlas-side-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.atlas-kpi-list {
  display: grid;
  gap: 2px;
}

.atlas-private-page #privateSummary,
.atlas-private-page #activeSessionSummary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.atlas-private-page #privateSummary .atlas-kpi-item,
.atlas-private-page #activeSessionSummary .atlas-kpi-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 10px;
}

.atlas-kpi-item {
  padding: 8px 0;
}

.atlas-kpi-item b {
  color: #e8f7ff;
}

.atlas-empty-state {
  color: #94acbf;
  font-size: 0.86rem;
}

.atlas-feed {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

#activeSessionSignals,
#activeSessionRelations,
#privateComparisons {
  max-height: 340px;
}

.atlas-feed-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 10px;
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.atlas-feed-item:hover {
  transform: translateX(2px);
  border-color: rgba(13, 202, 240, 0.22);
  box-shadow: 0 6px 14px rgba(13, 202, 240, 0.08);
}

.atlas-feed-item strong {
  display: block;
  font-size: 0.86rem;
}

.atlas-feed-item small {
  color: #8fa9bc;
}

.atlas-cluster-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.atlas-cluster-card {
  border-radius: 16px;
  padding: 12px;
}

.atlas-cluster-card h4 {
  margin: 0;
  font-size: 0.99rem;
}

.atlas-cluster-meta {
  margin-top: 6px;
  color: #91abbe;
  font-size: 0.82rem;
}

.atlas-cluster-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.atlas-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 18, 24, 0.68);
  color: #c7d9e6;
  font-size: 0.72rem;
}

.atlas-cluster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.atlas-cluster-grid .atlas-cluster-card {
  min-height: 180px;
}

.atlas-cluster-card a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.atlas-cluster-card a:hover {
  text-decoration: underline;
}

.atlas-table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 16, 24, 0.34);
}

.atlas-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.atlas-private-page .atlas-table {
  min-width: 1760px;
}

.atlas-session-row {
  cursor: pointer;
  transition: background-color 0.12s ease, box-shadow 0.16s ease;
}

.atlas-session-row.is-active td {
  background: linear-gradient(90deg, rgba(13, 202, 240, 0.16), rgba(13, 202, 240, 0.06)) !important;
  box-shadow: inset 0 0 0 1px rgba(13, 202, 240, 0.3);
}

.atlas-session-row:hover td {
  background: rgba(13, 202, 240, 0.08);
}

.atlas-table thead {
  background: rgba(255, 255, 255, 0.05);
}

.atlas-table th,
.atlas-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.81rem;
}

.atlas-table th {
  color: #bfe9ff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.atlas-table td {
  color: #b8cdde;
}

.atlas-private-page .atlas-table td small {
  display: block;
  margin-top: 4px;
  color: #8ea8bc;
  font-size: 0.72rem;
}

.atlas-table tr:hover td {
  background: rgba(13, 202, 240, 0.05);
}

.atlas-report-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-report-link {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(13, 202, 240, 0.28);
  background: rgba(13, 202, 240, 0.12);
  color: #c6f4ff;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.atlas-report-link:hover {
  border-color: rgba(13, 202, 240, 0.46);
  background: rgba(13, 202, 240, 0.2);
}

.atlas-artifact-group {
  display: grid;
  gap: 6px;
}

.atlas-artifact-group strong {
  color: #cbefff;
  font-size: 0.78rem;
}

.atlas-artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.atlas-risk-bars {
  display: grid;
  gap: 8px;
}

.atlas-risk-row {
  display: grid;
  grid-template-columns: 90px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.atlas-risk-row span {
  color: #9eb8ca;
  font-size: 0.82rem;
}

.atlas-risk-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(13, 202, 240, 0.2);
  background: rgba(8, 18, 30, 0.74);
  overflow: hidden;
}

.atlas-risk-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #3be8ff, #0dcaf0, #0891b2);
  box-shadow: 0 0 14px rgba(13, 202, 240, 0.3);
}

.atlas-chart-panel canvas {
  width: 100%;
  height: 340px;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(13, 202, 240, 0.2);
  background: rgba(6, 16, 28, 0.8);
}

.atlas-optin-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.atlas-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d0e3ef;
  font-weight: 700;
}

.atlas-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0dcaf0;
}

.atlas-optin-box small {
  display: block;
  margin-top: 6px;
  color: #8ea8bc;
}

.atlas-node-details {
  display: grid;
  gap: 8px;
}

.atlas-node-metric {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
}

.atlas-node-metric strong {
  display: block;
  margin-bottom: 4px;
}

.atlas-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(8, 18, 30, 0.88), rgba(8, 18, 30, 0.74));
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.25), 0 0 20px rgba(13, 202, 240, 0.06);
}

.atlas-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 202, 240, 0.4), rgba(13, 202, 240, 0.15), rgba(13, 202, 240, 0.4), transparent);
  pointer-events: none;
}

.atlas-footer-inner {
  width: var(--atlas-main-width);
  min-height: 40px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #a9c1d3;
  font-size: 0.76rem;
  padding: 8px 0;
}

@media (max-width: 1260px) {
  .atlas-map-layout {
    grid-template-columns: 1fr;
  }

  .atlas-side-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .atlas-header.header {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .atlas-header-left,
  .atlas-actions,
  .atlas-nav {
    justify-content: center;
  }
}

@media (max-width: 1040px) {
  .atlas-grid-three,
  .atlas-grid-two,
  .atlas-cluster-grid,
  .atlas-cluster-list {
    grid-template-columns: 1fr;
  }

  .atlas-private-page #privateSummary,
  .atlas-private-page #activeSessionSummary {
    grid-template-columns: 1fr;
  }

  .atlas-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-toolbar {
    grid-template-columns: 1fr;
  }

  .atlas-toolbar-group {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .atlas-main {
    width: calc(100% - 14px);
    margin: 12px auto 24px;
  }

  .atlas-hero-stats,
  .atlas-side-column {
    grid-template-columns: 1fr;
  }

  .atlas-footer-inner {
    width: calc(100% - 14px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 8px 0;
  }
}
