.atlas-workspace {
  --atlas-bg: #0a1420;
  --atlas-panel: #0d1b2a;
  --atlas-control: #102438;
  --atlas-line: #23425d;
  --atlas-text: #dcecff;
  --atlas-muted: #a6bed7;
  --atlas-accent: #67e8f9;
  background: var(--atlas-bg);
  color: var(--atlas-text);
  color-scheme: dark;
  font-size: 0.875rem;
  line-height: 1.5;
}

.atlas-workspace [hidden] { display: none !important; }
.atlas-workspace a { color: var(--atlas-accent); }
.atlas-workspace :is(h1, h2) { color: var(--atlas-text); }
.atlas-workspace :is(a, input, button, select, summary):focus-visible {
  outline: 2px solid var(--atlas-accent);
  outline-offset: 2px;
}
.atlas-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  padding: 0.7rem clamp(0.9rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--atlas-line);
  background: var(--atlas-panel);
}
.atlas-heading h1 { font-size: clamp(1rem, 2.2vw, 1.38rem); margin: 0; overflow-wrap: anywhere; }
.atlas-heading a { font-size: 0.8rem; }
.atlas-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr) minmax(14rem, 21rem);
  height: max(660px, calc(100svh - 135px));
}
.atlas-workspace:fullscreen, .atlas-workspace.is-fullscreen {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.atlas-workspace.is-fullscreen { position: fixed; inset: 0; z-index: 50; }
.atlas-workspace:is(:fullscreen, .is-fullscreen) .atlas-layout { flex: 1; min-height: 0; height: auto; }
.atlas-sidebar, .atlas-panel {
  min-width: 0;
  overflow: auto;
  padding: 0.95rem;
  background: var(--atlas-panel);
  scrollbar-color: #31526c transparent;
}
.atlas-sidebar { border-right: 1px solid var(--atlas-line); }
.atlas-panel { border-left: 1px solid var(--atlas-line); }
.atlas-sidebar h2, .atlas-panel h3 {
  margin: 1.1rem 0 0.45rem;
  color: var(--atlas-muted);
  font-size: 0.81rem;
}
.atlas-panel h2 { margin: 0 0 0.3rem; font-size: 1.1rem; line-height: 1.35; overflow-wrap: anywhere; }
.atlas-sub { color: var(--atlas-muted); font-size: 0.76rem; margin: 0.3rem 0; overflow-wrap: anywhere; }

.atlas-workspace :is(button, select, input:not([type="checkbox"])) {
  max-width: 100%;
  min-width: 0;
  min-height: 2.1rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.38rem;
  background: var(--atlas-control);
  color: var(--atlas-text);
  font: inherit;
}
.atlas-workspace :is(button, select, summary) { cursor: pointer; }
.atlas-workspace button:hover, .atlas-workspace button[aria-pressed="true"],
.atlas-chips a:hover, .atlas-list a:hover { border-color: var(--atlas-accent); }
.atlas-workspace button[aria-pressed="true"], .atlas-workspace .atlas-primary {
  color: #e6fdff;
  background: #164458;
}
.atlas-workspace button:disabled { opacity: 0.55; cursor: wait; }
.atlas-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.45rem; }
.atlas-search label, .atlas-search input { grid-column: 1 / -1; }
.atlas-search label { color: var(--atlas-muted); font-size: 0.78rem; }
.atlas-search input::placeholder { color: var(--atlas-muted); opacity: 0.9; }
.atlas-search + section { margin-top: 0.55rem; }
.atlas-chips, .atlas-actions { display: flex; flex-wrap: wrap; gap: 0.38rem; align-items: center; }
.atlas-workspace .atlas-chips :is(a, button) {
  color: var(--atlas-text);
  background: var(--atlas-control);
  border: 1px solid var(--atlas-line);
  border-radius: 0.35rem;
  padding: 0.22rem 0.4rem;
  min-height: 1.7rem;
  font-size: 0.73rem;
  text-decoration: none;
  text-align: start;
}
.atlas-chips small { color: var(--atlas-muted); font-variant-numeric: tabular-nums; }
.atlas-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin: 0; }
.atlas-stats div { background: var(--atlas-control); border: 1px solid var(--atlas-line); border-radius: 0.4rem; padding: 0.38rem 0.5rem; }
.atlas-stats dt { color: var(--atlas-muted); font-size: 0.72rem; }
.atlas-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 1.05rem; }

.atlas-graph { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--atlas-bg); }
.atlas-tools { margin: 0.65rem 0.75rem 0; padding: 0.42rem; border: 1px solid var(--atlas-line); border-radius: 0.6rem; }
.atlas-tools select { max-width: min(100%, 16.5rem); }
.atlas-tools #atlas-find { border-color: #3e6685; font-weight: 650; }
.atlas-motion { display: flex; gap: 0.32rem; align-items: center; color: var(--atlas-muted); padding-inline: 0.28rem; }
.atlas-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.atlas-canvas { position: absolute; inset: 0; }
.atlas-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 1.5rem; }
.atlas-empty p { max-width: 32rem; text-align: center; color: var(--atlas-muted); padding: 0.75rem; background: var(--atlas-panel); border: 1px solid var(--atlas-line); border-radius: 0.6rem; }
.atlas-count, .atlas-legend, .atlas-tooltip {
  position: absolute;
  background: #0d1b2af2;
  border: 1px solid var(--atlas-line);
  border-radius: 0.55rem;
  padding: 0.35rem 0.52rem;
  color: var(--atlas-muted);
  font-size: 0.74rem;
}
.atlas-count { left: 0.75rem; bottom: 0.65rem; max-width: 55%; pointer-events: none; }
.atlas-count:empty { display: none; }
.atlas-legend { bottom: 0.65rem; right: 0.75rem; max-width: min(17rem, calc(100% - 1.5rem)); }
.atlas-legend ul { margin: 0.32rem 0 0; padding: 0; list-style: none; }
.atlas-legend li { display: flex; align-items: center; gap: 0.42rem; margin-block: 0.15rem; }
.atlas-symbol { width: 0.65rem; height: 0.65rem; flex: none; border-radius: 50%; background: #94a3b8; }
.atlas-symbol--Disease { background: #2dd4bf; }
.atlas-symbol--Gene { background: #3b82f6; border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.atlas-symbol--Phenotype, .atlas-symbol--Variant, .atlas-symbol--Karyotype { background: #fbbf24; transform: rotate(45deg) scale(0.83); border-radius: 0; }
.atlas-symbol--Karyotype { background: #f472b6; }
.atlas-symbol--Variant { background: #818cf8; }
.atlas-symbol--Case, .atlas-symbol--Guideline { background: #a78bfa; border-radius: 0.1rem; }
.atlas-symbol--Guideline { background: #fb923c; }
.atlas-symbol--Image { background: #34d399; }
.atlas-line { flex: 0 0 1.15rem; border-top: 2px solid #a5bbc9; }
.atlas-line--source_checked { border-top: 2px dashed #fbbf24; }
.atlas-line--auto { border-top: 2px dashed #5fb7ec; }
.atlas-line--pending { border-top: 2px dotted #8299ad; }
.atlas-line--source_recorded { border-top: 2px solid #78b2af; }
.atlas-tooltip { pointer-events: none; z-index: 5; max-width: min(20rem, 100%); color: var(--atlas-text); overflow-wrap: anywhere; }

.atlas-list { display: grid; gap: 0.3rem; }
.atlas-list > :is(a, button, div) { background: var(--atlas-control); border: 1px solid var(--atlas-line); border-radius: 0.36rem; padding: 0.36rem 0.47rem; font-size: 0.78rem; text-align: start; overflow-wrap: anywhere; }
.atlas-list a { text-decoration: none; color: var(--atlas-text); }
.atlas-list small { display: block; color: var(--atlas-muted); }
.atlas-list .atlas-relation-button { font-size: 0.7rem; min-height: 1.65rem; margin-top: 0.26rem; }
.atlas-more { margin-top: 0.35rem; }
.atlas-attrs { margin: 0.55rem 0; }
.atlas-attrs > div { padding: 0.35rem 0; border-bottom: 1px solid var(--atlas-line); }
.atlas-attrs dt { color: var(--atlas-muted); font-size: 0.73rem; }
.atlas-attrs dd { margin: 0.12rem 0 0; overflow-wrap: anywhere; }
.atlas-attrs small { display: block; }
.atlas-panel .atlas-actions { align-items: start; margin: 0.65rem 0; }
.atlas-panel .atlas-actions a { align-self: center; overflow-wrap: anywhere; }
.atlas-evidence { border-left: 2px solid var(--atlas-accent); padding-left: 0.55rem; }
.atlas-path-steps { border-bottom: 1px solid var(--atlas-line); padding-bottom: 0.65rem; margin-bottom: 0.7rem; }
.atlas-path-steps h3 { margin-top: 0; }
.atlas-dialog {
  width: min(34rem, calc(100% - 1.5rem));
  max-height: calc(100svh - 2rem);
  color: var(--atlas-text);
  background: var(--atlas-panel);
  border: 1px solid var(--atlas-line);
  border-radius: 0.7rem;
  padding: 1rem;
}
.atlas-dialog::backdrop { background: #02080cb0; }
.atlas-dialog h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }
.atlas-dialog .atlas-actions { justify-content: end; margin-top: 0.8rem; }
.atlas-path-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.atlas-path-fields label { color: var(--atlas-muted); }
.atlas-path-fields input { display: block; width: 100%; margin-top: 0.25rem; }
.atlas-mobile { display: none; }

@media (max-width: 1120px) {
  .atlas-layout { grid-template-columns: 13rem minmax(0, 1fr) 15.5rem; }
}
@media (max-width: 900px) {
  .atlas-layout { height: auto; display: flex; flex-direction: column; }
  .atlas-graph { height: max(520px, 72svh); min-height: 0; flex: none; }
  .atlas-sidebar, .atlas-panel { max-height: 58svh; border: 0; }
  .atlas-sidebar { border-bottom: 1px solid var(--atlas-line); }
  .atlas-panel { border-top: 1px solid var(--atlas-line); }
  .atlas-workspace.is-ready .atlas-mobile { display: flex; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--atlas-line); }
  .atlas-workspace.is-ready .atlas-sidebar:not(.is-open), .atlas-workspace.is-ready .atlas-panel:not(.is-open) { display: none; }
}
@media (max-width: 390px) {
  .atlas-path-fields { grid-template-columns: 1fr; }
  .atlas-tools { margin-inline: 0.45rem; }
}
