/* Atlas module styles */

.atlas-section .launch-button {
  margin-top: 26px;
}

.atlas-viewer {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  grid-template-rows: auto 1fr;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
  background:
    radial-gradient(circle at 18% 18%, rgba(94, 234, 212, 0.12), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(97, 190, 255, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(3, 7, 12, 0.98), rgba(1, 3, 8, 0.98));
  overflow: hidden;
}

.atlas-viewer::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 118px 118px;
  pointer-events: none;
}

.atlas-viewer.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.atlas-viewer-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px 16px;
  border-bottom: 1px solid rgba(94, 234, 212, 0.18);
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.92), rgba(5, 7, 13, 0.52));
  backdrop-filter: blur(16px);
}

.atlas-status-title {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 190px;
  min-height: 48px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.atlas-status-title .status-label {
  margin: 0 0 5px;
  color: rgba(244, 247, 251, 0.52);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.atlas-status-title strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-viewer-close {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
}

.atlas-viewer-close {
  display: grid;
  gap: 2px;
  min-width: 86px;
  min-height: 46px;
  padding: 8px 12px;
  text-align: left;
}

.atlas-viewer-close span {
  color: var(--muted);
  font-size: 11px;
}

.atlas-viewer-close strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.atlas-filter-toggle,
.atlas-filter-drawer-head,
.atlas-filter-scrim {
  display: none;
}

.atlas-workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(460px, 1.58fr) minmax(260px, 0.68fr);
  min-height: 0;
  padding: 18px;
  gap: 14px;
}

.atlas-sidebar,
.atlas-stage,
.atlas-list-panel {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 9, 15, 0.62);
  backdrop-filter: blur(10px);
}

.atlas-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
}

.atlas-search,
.atlas-filter-section {
  display: grid;
  gap: 7px;
  min-height: 0;
}

.atlas-search span,
.atlas-panel-label,
.atlas-result-meta,
.atlas-detail-heading p,
.atlas-detail-source {
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.atlas-search input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(1, 5, 12, 0.72);
  color: var(--text);
  outline: none;
}

.atlas-search input:focus {
  border-color: rgba(97, 190, 255, 0.72);
}

.atlas-favorite-filter {
  position: relative;
  display: block;
  align-items: center;
  min-height: 42px;
  padding: 6px 12px 10px 14px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(96, 165, 250, 0.045);
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  cursor: pointer;
}

.atlas-favorite-filter span {
  color: rgba(147, 197, 253, 0.72);
  font-size: 10px;
  font-weight: 900;
}

.atlas-favorite-filter strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
}

.atlas-favorite-filter.is-active {
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(96, 165, 250, 0.13);
}

.atlas-category-section {
  min-height: 0;
}

.atlas-range-section {
  padding: 11px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(2, 12, 18, 0.5);
}

.atlas-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(96, 165, 250, 0.78) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.atlas-category-list button {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px 8px 13px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(1, 5, 12, 0.62);
  color: rgba(255, 255, 255, 0.74);
  text-align: left;
  cursor: pointer;
}

.atlas-category-list button::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  background: transparent;
}

.atlas-category-list button span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  font-weight: 900;
}

.atlas-category-list button strong {
  font-size: 13px;
}

.atlas-category-list button:hover {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(10, 18, 32, 0.86);
}

.atlas-category-list button.is-active {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(10, 18, 32, 0.84);
}

.atlas-category-list button.is-active::before {
  background: rgb(96, 165, 250);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.55);
}

.atlas-range-filter-list {
  display: grid;
  gap: 14px;
}

.atlas-range-filter {
  display: grid;
  gap: 8px;
}

.atlas-range-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.atlas-range-heading strong {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 900;
}

.atlas-range-heading em {
  color: rgba(147, 197, 253, 0.8);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.atlas-range-options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--option-count), minmax(0, 1fr));
  gap: 0;
  padding-top: 10px;
}

.atlas-range-options::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: rgba(96, 165, 250, 0.18);
}

.atlas-range-options button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.atlas-range-options button::before {
  content: "";
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  background: rgb(2, 8, 12);
}

.atlas-range-options button span {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-range-options button:hover,
.atlas-range-options button.is-active {
  color: rgba(255, 255, 255, 0.86);
}

.atlas-range-options button.is-active::before {
  border-color: rgba(147, 197, 253, 0.98);
  background: rgb(96, 165, 250);
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.52);
}

.atlas-result-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 2px 10px;
}

.atlas-list-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 14px;
}

.atlas-object-list {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  scrollbar-color: rgba(96, 165, 250, 0.78) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.atlas-object-list-spacer {
  position: relative;
  min-height: 100%;
}

.atlas-object-list-window {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  gap: 7px;
  will-change: transform;
}

.atlas-category-list::-webkit-scrollbar,
.atlas-object-list::-webkit-scrollbar,
.atlas-detail-stats::-webkit-scrollbar,
.atlas-detail-description::-webkit-scrollbar,
.atlas-workspace::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.atlas-category-list::-webkit-scrollbar-track,
.atlas-object-list::-webkit-scrollbar-track,
.atlas-detail-stats::-webkit-scrollbar-track,
.atlas-detail-description::-webkit-scrollbar-track,
.atlas-workspace::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.045);
}

.atlas-category-list::-webkit-scrollbar-thumb,
.atlas-object-list::-webkit-scrollbar-thumb,
.atlas-detail-stats::-webkit-scrollbar-thumb,
.atlas-detail-description::-webkit-scrollbar-thumb,
.atlas-workspace::-webkit-scrollbar-thumb {
  border: 2px solid rgba(4, 9, 15, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(147, 197, 253, 0.95), rgba(37, 99, 235, 0.88));
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.34);
}

.atlas-category-list::-webkit-scrollbar-thumb:hover,
.atlas-object-list::-webkit-scrollbar-thumb:hover,
.atlas-detail-stats::-webkit-scrollbar-thumb:hover,
.atlas-detail-description::-webkit-scrollbar-thumb:hover,
.atlas-workspace::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffffff, rgba(96, 165, 250, 0.92));
}

.atlas-object-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  min-height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.atlas-object-item.is-active {
  border-color: rgba(97, 190, 255, 0.72);
  background: rgba(97, 190, 255, 0.11);
}

.atlas-object-main {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.atlas-object-item i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--object-color);
  box-shadow: 0 0 14px var(--object-color);
}

.atlas-object-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.atlas-object-item strong,
.atlas-object-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-object-item strong {
  font-size: 14px;
}

.atlas-object-item em,
.atlas-object-item small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-style: normal;
}

.atlas-object-favorite {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 54px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: rgba(147, 197, 253, 0.82);
  font-size: 15px;
  cursor: pointer;
}

.atlas-object-favorite:hover {
  color: #ffffff;
  background: rgba(96, 165, 250, 0.14);
}

.atlas-empty {
  margin: 20px 0;
  color: var(--muted);
  text-align: center;
}

.atlas-stage {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  padding: 16px;
}

.atlas-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(120px, 0.28fr) minmax(0, 0.68fr) auto;
  gap: 4px;
  min-height: 0;
}

.atlas-detail-heading {
  display: grid;
  align-content: start;
  gap: 3px;
}

.atlas-detail-heading p {
  margin: 0;
}

.atlas-detail-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 56px;
  line-height: 1.05;
}

.atlas-detail-heading span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 20px;
  font-weight: 900;
}

.atlas-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  max-height: none;
  margin: -32px 0 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(96, 165, 250, 0.78) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.atlas-detail-stats div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
  padding: 8px 0 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atlas-detail-stats dt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.atlas-detail-stats dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.atlas-detail-description {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.78;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  scrollbar-color: rgba(96, 165, 250, 0.78) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.atlas-detail-description p {
  margin: 0 0 14px;
}

.atlas-detail-description p:last-child {
  margin-bottom: 0;
}

.atlas-detail-source {
  margin: 0;
  color: rgba(97, 190, 255, 0.72);
}

@media (max-width: 1180px) {
  .atlas-workspace {
    grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1.38fr) minmax(230px, 0.7fr);
  }
}

@media (max-width: 760px) {
  .atlas-viewer {
    grid-template-rows: 1fr;
  }

  .atlas-viewer-header {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .atlas-status-title {
    display: none;
  }

  .atlas-viewer-close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    z-index: 26;
    display: grid;
    gap: 2px;
    min-width: 86px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.58);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(14px);
  }

  .atlas-filter-toggle {
    position: fixed;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 23;
    display: grid;
    gap: 2px;
    min-width: 88px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(94, 234, 212, 0.58);
    background: rgba(4, 12, 18, 0.78);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(14px);
  }

  .atlas-filter-toggle span {
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
  }

  .atlas-filter-toggle strong {
    font-size: 14px;
    font-weight: 900;
  }

  .atlas-viewer.is-filter-open .atlas-filter-toggle {
    display: none;
  }

  .atlas-filter-scrim {
    position: fixed;
    inset: 0;
    z-index: 21;
    border: 0;
    background: rgba(0, 0, 0, 0.46);
  }

  .atlas-viewer.is-filter-open .atlas-filter-scrim {
    display: block;
  }

  .atlas-workspace {
    z-index: auto;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(188px, calc(24dvh + 60px));
    height: 100vh;
    height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    gap: 12px;
    overflow: hidden;
  }

  .atlas-sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 24;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    max-height: min(84dvh, 680px);
    padding: 14px 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    background: rgba(14, 19, 31, 0.98);
    box-shadow: var(--shadow);
    pointer-events: auto;
    transform: translateY(105%);
    transition: transform 220ms ease;
  }

  .atlas-viewer.is-filter-open .atlas-sidebar {
    transform: translateY(0);
  }

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

  .atlas-filter-drawer-head strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
  }

  .atlas-filter-drawer-head button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
  }

  .atlas-stage {
    order: 1;
    min-height: 0;
    padding: 14px;
  }

  .atlas-list-panel {
    order: 2;
    min-height: 0;
    padding: 12px;
  }

  .atlas-search,
  .atlas-filter-section,
  .atlas-category-list {
    margin-bottom: 10px;
  }

  .atlas-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 180px;
  }

  .atlas-range-section {
    max-height: none;
    overflow: auto;
  }

  .atlas-object-list {
    min-height: 0;
    max-height: none;
  }

  .atlas-detail-panel {
    grid-template-rows: auto minmax(86px, 0.25fr) minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    gap: 10px;
  }

  .atlas-detail-stats {
    grid-template-columns: 1fr;
    max-height: none;
    margin: 0;
  }

  .atlas-detail-heading h3 {
    font-size: 30px;
  }

  .atlas-detail-heading span {
    font-size: 15px;
  }

  .atlas-detail-description {
    max-height: 220px;
    margin-top: 0;
  }
}

@media (max-width: 420px) {
  .atlas-viewer-close {
    min-width: 86px;
    padding: 8px 12px;
  }

  .atlas-viewer-close span {
    display: block;
  }

  .atlas-detail-heading h3 {
    font-size: 26px;
  }

  .atlas-range-options button span {
    font-size: 9px;
  }
}
