/* =========================
   ATLAS (standalone page, frontend/atlas/index.html)
   Loaded after styles.css: header, buttons, inputs, toggles, custom selects and
   scrollbars all come from the main app. This file only lays the page out and
   styles the change data itself.
========================= */

.atlas-page {
  --atlas-accent: #5ab0f0;
  --atlas-added: #81c784;
  --atlas-removed: #ef9a9a;
  --atlas-changed: #f5c542;
  --atlas-line: #222;
  --atlas-muted: #666;
  background: transparent;   /* the page background is .atlas-bg; html under it is #111 */
}

/* Our own display rules (flex rows, toggle groups) would otherwise beat [hidden]. */
.atlas-page [hidden] { display: none !important; }

.atlas-entering {
  animation: gunCardEntrance 0.3s ease both;
  animation-delay: var(--atlas-entrance-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .atlas-entering { animation: none; }
}

.atlas-page .header-logo-link { text-decoration: none; color: inherit; }
.atlas-page .header-spacer { height: 66px; }
/* file paths are long: let the site tooltip widen before it wraps */
.atlas-page #eft-tooltip { max-width: min(560px, calc(100vw - 16px)); }

#atlas-app,
#atlas-matching-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Atlas's header ----------
   Buttons + blue glow on the left, the logo on the right. */

/* glow on the left, in blue */
.atlas-page .header-glow {
  right: auto;
  left: 0;
  background: linear-gradient(to right, rgba(90, 176, 240, 0.08), transparent);
}

/* Background: the shared dot grid and vignette, the blob in the bottom left and blue */
.atlas-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(200deg, #141414 0%, #111111 50%, #0b0e10 100%);
}
.atlas-bg-dots {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 30px 30px;
  will-change: transform;
}
.atlas-bg .page-bg-blob {
  left: -55%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(90, 176, 240, 0.10), transparent 70%);
}
.atlas-bg .page-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 20%, rgba(0, 0, 0, 0.72) 100%);
}
.atlas-page #lang-switcher { align-self: center; }
/* UTC+8 / Local, beside the language: which zone every time on Atlas is shown in */
.atlas-tz-switch { display: flex; align-self: center; }
.atlas-tz-switch .optimizer-segmented-btn { padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.atlas-header-nav {
  display: flex;
  align-self: stretch;
  border-left: 1px solid #2a2a2a;
  border-right: 1px solid #2a2a2a;
}
.atlas-header-nav .header-nav-btn {
  flex-direction: column;
  gap: 2px;
}
.atlas-header-nav .header-nav-btn-icon {
  position: static;
  inset: auto;
  opacity: 1;
}
.atlas-header-nav .header-nav-btn-icon svg { width: 22px; height: 22px; }
.atlas-header-nav .atlas-home-btn {
  box-sizing: border-box;
  padding: 9px 14px;
  gap: 1px;
  text-decoration: none;
}
.atlas-home-btn h2 { font-size: 12px; letter-spacing: 1.5px; line-height: 1; }
.atlas-home-label {
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1;
  color: #8a8f98;
  user-select: none;
}
.atlas-home-btn:hover .atlas-home-label { color: #c8ccd2; }

.atlas-brand {
  margin-left: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  user-select: none;
}
.atlas-brand-wordmark { height: 20px; width: auto; }
.atlas-brand-logo { width: 40px; height: 40px; }

/* ---------- the site's own components, in Atlas blue ---------- */

.atlas-page ::selection { background: rgba(90, 176, 240, 0.25); }
.atlas-page :where(button, a, select, summary, [role="button"], [tabindex]):focus-visible {
  outline-color: rgba(90, 176, 240, 0.7);
}
.atlas-page input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):focus {
  border-color: rgba(90, 176, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(90, 176, 240, 0.08);
}
.atlas-page #lang-switcher .custom-select-trigger:hover {
  background: rgba(90, 176, 240, 0.1);
  color: var(--atlas-accent);
  border-color: rgba(90, 176, 240, 0.25);
}
/* the globe png is gold; turn it blue rather than leaving it gold on hover */
.atlas-page #lang-switcher .custom-select-trigger:hover::before,
.atlas-page #lang-switcher .custom-select-wrapper.open .custom-select-trigger::before {
  filter: hue-rotate(160deg);
}
.atlas-page .custom-select-option:hover,
.atlas-page .custom-select-option.selected { color: var(--atlas-accent); }
.atlas-page .optimizer-segmented-btn.active { color: var(--atlas-accent); }
.atlas-page .modal-btn.primary { background: #0f1c28; border-color: var(--atlas-accent); color: var(--atlas-accent); }
.atlas-page .modal-btn.primary:hover { background: #142636; }
.atlas-page .cs-rail.cs-dragging .cs-thumb { background: var(--atlas-accent); }

/* ---------- access button and its key panel ---------- */

.atlas-access-btn:hover,
.atlas-access-btn[aria-expanded="true"],
.atlas-guide-btn:hover,
.atlas-guide-btn[aria-expanded="true"] {
  background: rgba(90, 176, 240, 0.08);
  color: var(--atlas-accent);
}
.atlas-access-btn:active,
.atlas-guide-btn:active { background: rgba(90, 176, 240, 0.15); }
.atlas-access-btn.unlocked { color: var(--atlas-accent); }
.atlas-access-btn.rejected { color: var(--atlas-removed); }

/* Open toward the right and keep the panel outside the scrolling header. */
.atlas-key-panel {
  box-sizing: border-box;
  position: fixed;
  z-index: 300;
  width: 340px;
  max-width: calc(100vw - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}
.atlas-key-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #777;
}
.atlas-key-info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 14px;
  font-size: 13px;
}
.atlas-key-label { color: #777; }
.atlas-key-value { color: #ddd; }
.atlas-key-error { font-size: 12px; line-height: 1.5; color: var(--atlas-removed); }
.atlas-key-input { width: 100%; box-sizing: border-box; }
.atlas-key-actions { display: flex; align-items: center; gap: 8px; }
.atlas-key-note { flex: 1; font-size: 11px; color: var(--atlas-muted); }
.atlas-key-actions .modal-btn { padding: 5px 14px; font-size: 12px; }
.atlas-key-actions .modal-btn:first-of-type { margin-left: auto; }   /* buttons stay right even when the note is hidden */

/* ---------- layout ---------- */

.atlas-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.atlas-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1e1e1e;
  background: rgba(19, 19, 19, 0.55);
}
.atlas-section-title {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #888;
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-set-list,
.atlas-groups { overflow-y: auto; }
.atlas-set-list { flex: 1; min-height: 0; }

.atlas-set-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #181818;
  border-left: 2px solid transparent;
  color: inherit;
  font-family: inherit;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.atlas-set-item:hover { background: #181818; }
.atlas-set-item.active { background: #1c1c1c; border-left-color: var(--atlas-accent); }
.atlas-set-top { display: flex; align-items: center; gap: 6px; }
.atlas-set-date { font-size: 13px; color: #ddd; }
.atlas-set-num {
  min-width: 28px;
  font-size: 11px;
  font-weight: 700;
  color: #777;
  font-variant-numeric: tabular-nums;
}
.atlas-set-item.active .atlas-set-num { color: var(--atlas-accent); }
.atlas-set-item.active .atlas-set-date { color: var(--atlas-accent); }
.atlas-set-ver { margin-top: 2px; font-size: 13px; color: #ccc; }
.atlas-set-item.active .atlas-set-ver { color: var(--atlas-accent); }
.atlas-set-meta { margin-top: 2px; font-size: 11px; color: var(--atlas-muted); }

/* Unread: a dot after the date and brighter text; read sets fall back a step */
.atlas-set-unread {
  display: none;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--atlas-accent);
  flex-shrink: 0;
}
.atlas-set-item.unread .atlas-set-unread { display: block; }
.atlas-set-item.unread .atlas-set-date { color: #fff; font-weight: 700; }
.atlas-set-item.unread .atlas-set-ver { color: #eee; }
.atlas-set-item:not(.unread):not(.active):not(.locked) .atlas-set-date,
.atlas-set-item:not(.unread):not(.active):not(.locked) .atlas-set-ver { color: #999; }

/* Sidebar title with the badge toggle on the right */
/* EFT and Arena are separate pages; the switch is two links styled as a segmented control */
.atlas-game-switch {
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--atlas-line);
}
/* three options in the 280px sidebar: keep "逃离塔科夫" on one line */
.atlas-game-switch .optimizer-segmented-btn {
  flex: 1;
  padding: 5px 8px;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
}
.atlas-game-switch .optimizer-segmented-btn.active { cursor: default; }

.atlas-sets-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atlas-badge-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  color: var(--atlas-accent);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.atlas-badge-toggle:hover { border-color: #555; }
.atlas-badge-toggle .atlas-bell-slash { display: none; }
.atlas-badge-toggle.off { color: #666; }
.atlas-badge-toggle.off .atlas-bell-slash { display: inline; }


/* A set the public can't open yet: listed, dimmed, with when it opens */
.atlas-set-item.locked .atlas-set-date,
.atlas-set-item.locked .atlas-set-ver,
.atlas-set-item.locked .atlas-set-meta { opacity: 0.6; }

.atlas-empty {
  padding: 24px 12px;
  text-align: center;
  color: #555;
  font-size: 12px;
}
.atlas-empty.error { color: var(--atlas-removed); }

/* ---------- one set ---------- */

/* Let the grid and corner glow show through a light dark tint. */
.atlas-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 12, 0.18);
}

/* Set header: what the set is on the left, how to view it on the right */
.atlas-set-bar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 10px 16px 8px;
}
.atlas-set-head { flex: 1; min-width: 0; }
.atlas-set-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 20px;
  font-weight: 700;
  color: #eee;
}
.atlas-set-version { padding-left: 14px; border-left: 1px solid #333; }
.atlas-set-version-label {
  margin-right: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #777;
}
.atlas-set-sub { margin-top: 4px; font-size: 13px; color: #aaa; }

.atlas-viewbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Filter row: what's shown */
.atlas-controls { flex-wrap: wrap; gap: 8px 14px; padding: 8px 16px; }

/* A small label in front of its control, as in the optimizer's option rows */
.atlas-control { display: inline-flex; align-items: center; gap: 8px; }
.atlas-control .stat-label { font-size: 12px; white-space: nowrap; }

.atlas-kind-chips { display: flex; gap: 4px; }
.atlas-kind-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 3px;
  padding: 3px 9px;
  color: #666;
  font-family: "Bender", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
/* :not(.active) outranks the plain .atlas-kind-added and friends below, which color row tags */
.atlas-kind-chip:not(.active) { color: #666; }
.atlas-kind-chip:not(.active):hover { border-color: #555; color: #999; }
.atlas-kind-chip.active.atlas-kind-added   { color: var(--atlas-added);   border-color: #2e4a2f; background: #142014; }
.atlas-kind-chip.active.atlas-kind-removed { color: var(--atlas-removed); border-color: #4a2e2e; background: #1f1414; }
.atlas-kind-chip.active.atlas-kind-changed { color: var(--atlas-changed); border-color: #4a4120; background: #1f1c10; }
.atlas-kind-chip.active.atlas-kind-new     { color: var(--atlas-accent);  border-color: #24435a; background: #101b24; }
.atlas-kind-chip[hidden] { display: none; }
.atlas-kind-sign { font-weight: 700; }
.atlas-kind-num { font-weight: 700; opacity: 0.85; }
.atlas-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: rgba(21, 21, 21, 0.85);
  border-bottom: 1px solid #222;
}
.atlas-search {
  flex: 1;
  min-width: 180px;
  background: #0e0e0e;
  border: 1px solid #2e2e2e;
  color: #ddd;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 3px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.atlas-search::placeholder { color: #444; }
.atlas-file-wrap { position: relative; width: 240px; max-width: 100%; }
.atlas-file-wrap .custom-select-wrapper { width: 100%; }
#atlas-file-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.atlas-count-label { font-size: 11px; color: #999; white-space: nowrap; }
.atlas-viewbar-row { display: flex; align-items: center; gap: 10px; }
.atlas-export-btn { padding: 3px 10px; font-size: 11px; }

/* Change list with the file navigator beside it */
.atlas-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);   /* the list scrolls inside, not the page */
}
.atlas-groups {
  position: relative;
  min-height: 0;
  padding-bottom: 40px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}
.atlas-file-anchor { height: 0; }

.atlas-toc {
  width: 240px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #1e1e1e;
  background: rgba(19, 19, 19, 0.55);
}
.atlas-toc-title {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #888;
  border-bottom: 1px solid var(--atlas-line);
}
.atlas-toc-label { flex: 1; }
.atlas-toc-hint { font-weight: 400; letter-spacing: 0; color: #555; }
.atlas-toc-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.atlas-toc-toggle:hover { border-color: #555; color: var(--atlas-accent); }
.atlas-toc-toggle svg { transition: transform 0.15s; }

/* Collapsed: a thin strip with only the button, pointing back out */
.atlas-toc.collapsed { width: 40px; }
.atlas-toc.collapsed .atlas-toc-title { justify-content: center; padding: 8px 0; }
.atlas-toc.collapsed .atlas-toc-label,
.atlas-toc.collapsed .atlas-toc-hint,
.atlas-toc.collapsed .atlas-toc-list { display: none; }
.atlas-toc.collapsed .atlas-toc-toggle svg { transform: rotate(180deg); }
.atlas-toc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; }
.atlas-toc-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 5px 12px;
  background: none;
  border: none;
  text-align: left;
  color: #aaa;
  font-family: "Bender", Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.atlas-toc-item:hover { background: #1a1a1a; color: #ddd; }
.atlas-toc-item.active { background: #101a24; color: var(--atlas-accent); }
.atlas-toc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-toc-count { flex-shrink: 0; color: #666; font-variant-numeric: tabular-nums; }
.atlas-toc-item.active .atlas-toc-count { color: inherit; opacity: 0.75; }

@media (max-width: 1100px) {
  .atlas-toc { display: none !important; }
}

.atlas-file-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--atlas-accent);
  background: #0e1822;
  border-bottom: 1px solid #16304a;
}

/* ---------- state panel (locked, errors, nothing to show) ---------- */

/* With no set behind the panel, the view and filter rows have nothing to act on */
.atlas-main.atlas-no-set .atlas-viewbar,
.atlas-main.atlas-no-set .atlas-controls { display: none; }
/* ...and with no set header either (a failed list), the bar goes too */
.atlas-main.atlas-no-set .atlas-set-bar:has(> .atlas-set-head:empty) { display: none; }

.atlas-state {
  margin: 16px;
  background: #141414;
  border: 1px solid #262626;
  border-radius: 4px;
  overflow: hidden;
}
.atlas-state.error { border-color: #331717; }

/* Tinted band across the top of the card */
.atlas-state-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--atlas-accent);
  background: #0e1822;
  border-bottom: 1px solid #16304a;
}
.atlas-state.error .atlas-state-head { color: var(--atlas-removed); background: #1a0d0d; border-bottom-color: #331717; }
.atlas-state-head svg { width: 15px; height: 15px; flex-shrink: 0; }
.atlas-state-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.atlas-state-body { padding: 12px 14px 14px; }
.atlas-state-text { margin: 0 0 4px; font-size: 13px; line-height: 1.6; color: #aaa; }

.atlas-state-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 18px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #222;
  font-size: 13px;
}
.atlas-state-facts dt { color: #666; }
.atlas-state-facts dd { margin: 0; color: #ddd; overflow-wrap: anywhere; }
.atlas-state-countdown { color: var(--atlas-removed); font-weight: 700; }

.atlas-state-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.atlas-state-actions .modal-btn { padding: 6px 14px; font-size: 12px; }

/* ---------- grouped view ---------- */

.atlas-group { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.atlas-group-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  list-style: none;
  transition: background 0.12s;
}
.atlas-group-summary::-webkit-details-marker { display: none; }
.atlas-group-summary::before {
  content: "";
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid #666;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.12s;
}
.atlas-group[open] > .atlas-group-summary::before { transform: rotate(90deg); }
.atlas-group-summary:hover { background: rgba(255, 255, 255, 0.04); }

.atlas-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  background: #1a1a1a;
}

.atlas-group-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.atlas-group-name { font-size: 15px; color: #eee; overflow-wrap: anywhere; }
.atlas-id {
  font-family: "Bender", Arial, sans-serif;
  font-size: 12px;
  color: #888;
  letter-spacing: 0;
}
.atlas-new-badge {
  align-self: center;
  font-family: "Bender", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--atlas-accent);
  border: 1px solid #24435a;
  border-radius: 3px;
  padding: 0 6px;
}

.atlas-file-chip {
  font-size: 12px;
  color: #999;
  background: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

.atlas-counts { display: flex; gap: 4px; }
.atlas-count {
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.atlas-kind-added   { color: var(--atlas-added); }
.atlas-kind-removed { color: var(--atlas-removed); }
.atlas-kind-changed { color: var(--atlas-changed); }

.atlas-rows { padding: 0 16px 8px 30px; }

.atlas-row {
  padding: 6px 0 6px 10px;
  border-left: 2px solid #2a2a2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #ddd;
}
.atlas-row.atlas-kind-added   { border-left-color: #2e4a2f; }
.atlas-row.atlas-kind-removed { border-left-color: #4a2e2e; }
.atlas-row.atlas-kind-changed { border-left-color: #4a4120; }

.atlas-row-path {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 2px;
  font-family: "Bender", Arial, sans-serif;
  font-size: 13px;
  color: #b3b3b3;
  letter-spacing: 0;
}
.atlas-kind-tag {
  font-family: "Bender", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 8px;
}
.atlas-row-path .atlas-file-chip { margin-right: 8px; font-family: "Bender", Arial, sans-serif; }
.atlas-seg { overflow-wrap: anywhere; }
.atlas-seg-dot { color: #888; }
.atlas-seg-index { color: #aaa; }
.atlas-seg-named { color: #9cc9ee; font-family: "Bender", Arial, sans-serif; }

.atlas-row-values {
  margin-top: 4px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
}
.atlas-value {
  font-family: "Bender", Arial, sans-serif;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1px 5px;
  border-radius: 3px;
}
.atlas-value-named { font-family: "Bender", Arial, sans-serif; }
.atlas-old { background: #1f1414; color: #e0a3a3; }
.atlas-new { background: #142014; color: #a5d6a7; }
.atlas-arrow { color: #999; padding-top: 1px; }
.atlas-delta { font-size: 13px; font-weight: 700; padding-top: 2px; }
.atlas-delta.up   { color: var(--atlas-added); }
.atlas-delta.down { color: var(--atlas-removed); }

.atlas-json {
  margin: 0;
  max-width: 100%;
  padding: 6px 8px;
  font-family: "Bender", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 3px;
}
/* an id's icon and name, after the id inside a JSON value */
.atlas-json-name {
  margin-left: 8px;
  color: #ddd;
}
/* an id's icon in front of its name, in JSON and in a single named value */
.atlas-inline-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  object-fit: contain;
  vertical-align: -3px;
}

.atlas-reveal {
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  color: #999;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.atlas-large {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.atlas-reveal:hover { border-color: #555; color: #ccc; }

.atlas-reveal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 28, 38, 0.8);
  border-color: rgba(90, 176, 240, 0.25);
  color: #b2d4ed;
  line-height: 1.4;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.atlas-reveal::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.atlas-reveal[aria-expanded="true"]::before { transform: rotate(45deg); }
.atlas-reveal:hover { background: rgba(25, 46, 62, 0.95); border-color: #5ab0f0; color: #d5eaff; }
.atlas-reveal:disabled { opacity: 0.65; cursor: wait; }
.atlas-reveal-count {
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

/* ---------- raw view (a tarkov-changes style text diff) ---------- */

.atlas-raw-list {
  margin: 0 16px 16px;
  font-family: "Bender", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  background: rgba(8, 10, 12, 0.26);
  text-shadow: 0 1px 2px #000, 0 0 3px rgba(0, 0, 0, 0.9);
}
.atlas-raw-list .atlas-file-heading {
  margin: 0 -16px 6px;
  font-family: "Bender", Arial, sans-serif;
}
.atlas-raw-list .atlas-file-heading:not(:first-child) { margin-top: 14px; }
.atlas-raw-node,
.atlas-raw-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0 5px;
}
.atlas-raw-node { color: #eee; margin: 2px 0; font-weight: 700; }
.atlas-raw-entry { margin: 2px 0; font-weight: 400; }
.atlas-raw-entry.added   { color: #b5e8b6; background: rgba(14, 27, 17, 0.88); }
.atlas-raw-entry.removed { color: #ffb4b4; background: rgba(33, 16, 18, 0.88); }
.atlas-raw-list .atlas-locale-name { color: #cfb8ef; }
.atlas-raw-named { text-decoration: underline dotted rgba(255, 255, 255, 0.25); }
.atlas-locale-name { color: #b39ddb; font-style: italic; font-weight: normal; }
.atlas-raw-line .atlas-reveal {
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
  color: inherit;
}
.atlas-raw-line .atlas-reveal:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: currentColor;
  color: inherit;
}

/* ---------- watermark ---------- */

/* What's left after the watermark guard clears the page */
.atlas-breach {
  max-width: 520px;
  margin: 120px auto;
  padding: 0 20px;
  text-align: center;
  color: #ef9a9a;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- servers page (/atlas/matching) ---------- */

.atlas-matching-source { font-size: 11px; color: var(--atlas-muted); }
.atlas-matching-stale { color: var(--atlas-removed); font-weight: 700; }
.atlas-matching-table { flex: 1; min-height: 0; padding-bottom: 16px; }

/* Region, name, now, sparkline, min/avg/max */
.atlas-matching-row {
  display: grid;
  grid-template-columns: 48px minmax(140px, 1fr) 84px minmax(120px, 2fr) repeat(3, 56px);
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-bottom: 1px solid #181818;
  font-size: 13px;
  color: #ccc;
}
.atlas-matching-row:not(.atlas-matching-header):hover { background: #161616; }
.atlas-matching-header {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #777;
  background: #0f0f0f;
  border-bottom-color: var(--atlas-line);
}
.atlas-matching-region { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #777; }
.atlas-matching-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ddd; }
.atlas-matching-now { font-size: 15px; font-weight: 700; }
.atlas-matching-now,
.atlas-matching-stat { text-align: right; font-variant-numeric: tabular-nums; }
.atlas-matching-header .atlas-matching-now { font-size: 11px; }
.atlas-matching-stat { color: #999; }

/* The trend column's header doubles as its time axis */
.atlas-matching-trend { position: relative; align-self: stretch; display: flex; align-items: center; }
.atlas-matching-axis { display: block; height: 30px; }
.atlas-matching-axis-title { position: absolute; left: 0; top: 0; }
.atlas-matching-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-weight: 400;
  letter-spacing: 0;
  color: #666;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.atlas-matching-header { align-items: end; }

/* Crosshair: one line at the same moment on every row (--atlas-cross, set on the table) */
.atlas-matching-cross {
  display: none;
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: var(--atlas-cross, 0);
  width: 1px;
  background: #9aa4ae;
  pointer-events: none;
}
.atlas-matching-table.crossing .atlas-matching-cross { display: block; }
/* The Now column reads out the crosshair's moment while it's on */
.atlas-matching-header .atlas-matching-then { color: var(--atlas-accent); letter-spacing: 0; white-space: nowrap; }
.atlas-matching-row:focus-visible { outline: 1px solid var(--atlas-accent); outline-offset: -1px; }

.atlas-matching-tip {
  position: fixed;
  z-index: 1000;
  padding: 6px 10px;
  background: #151515;
  border: 1px solid #333;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  font-size: 12px;
}
.atlas-matching-tip[hidden] { display: none; }
.atlas-matching-tip-value { font-size: 16px; font-weight: 700; color: #eee; font-variant-numeric: tabular-nums; }
.atlas-matching-tip-name { color: #bbb; }
.atlas-matching-tip-time { color: #777; }

/* Rows open a detail chart below them */
.atlas-matching-row:not(.atlas-matching-header) { cursor: pointer; }
.atlas-matching-row.expanded { background: #161a1f; border-bottom-color: transparent; }
.atlas-matching-row.expanded .atlas-matching-name { color: var(--atlas-accent); }

.atlas-matching-detail {
  padding: 10px 16px 30px 64px;   /* room for the wait axis on the left, the time axis below */
  background: #121518;
  border-bottom: 1px solid #1e2328;
}
.atlas-detail-plot { position: relative; height: 180px; }
.atlas-detail-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.atlas-detail-grid { stroke: #23282d; stroke-width: 1; vector-effect: non-scaling-stroke; }
.atlas-detail-area { fill: var(--atlas-accent); fill-opacity: 0.1; stroke: none; }
.atlas-detail-line {
  fill: none;
  stroke: var(--atlas-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.atlas-detail-ylabel,
.atlas-detail-xlabel {
  position: absolute;
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.atlas-detail-ylabel { right: calc(100% + 8px); transform: translateY(-50%); }
.atlas-detail-xlabel { top: calc(100% + 6px); transform: translateX(-50%); }
.atlas-detail-plot .atlas-matching-cross { top: 0; bottom: 0; }
/* the crosshair's point on the line: 8px, with a ring in the surface colour */
.atlas-detail-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -6px 0 0 -6px;
  border: 2px solid #121518;
  border-radius: 50%;
  background: var(--atlas-accent);
  box-sizing: content-box;
  pointer-events: none;
}

.atlas-spark { display: block; width: 100%; height: 28px; overflow: visible; }
.atlas-spark-grid { stroke: #232323; stroke-width: 1; vector-effect: non-scaling-stroke; }
.atlas-spark polyline {
  fill: none;
  stroke: var(--atlas-accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Wait colours: a minute or less, up to three, longer */
.atlas-wait-fast { color: var(--atlas-added); }
.atlas-wait-ok { color: var(--atlas-changed); }
.atlas-wait-slow { color: var(--atlas-removed); }
.atlas-matching-stat.atlas-wait-fast,
.atlas-matching-stat.atlas-wait-ok,
.atlas-matching-stat.atlas-wait-slow { opacity: 0.8; }

@media (max-width: 760px) {
  .atlas-matching-row { grid-template-columns: 40px minmax(0, 1fr) 76px minmax(70px, 1fr); gap: 8px; padding: 6px 12px; }
  .atlas-matching-stat { display: none; }
}

/* Printing usually drops background images, and with them the watermark */
@media print {
  body.atlas-page { display: none !important; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 760px) {
  body.atlas-page { height: auto; min-height: 100%; overflow: auto; }
  html:has(body.atlas-page) { overflow: auto; }
  .atlas-layout { display: block; }
  .atlas-sidebar { border-right: none; border-bottom: 1px solid #1e1e1e; }
  .atlas-set-list { max-height: 35vh; }
  .atlas-set-bar, .atlas-controls { padding-left: 12px; padding-right: 12px; }
  .atlas-viewbar { align-items: flex-start; }
  .atlas-file-wrap { width: 100%; }
  .atlas-groups { overflow: visible; }
  .atlas-group-summary { padding: 6px 12px; }
  .atlas-rows { padding: 0 12px 8px 16px; }
  .atlas-raw-list { margin: 0 12px 12px; }
}

/* ---------- first-visit tour and the quick start guide (atlas.js) ---------- */

/* Above the page and the key panel, below the watermark (which takes the top z-index). */
#atlas-tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  font-family: "Bender", Arial, sans-serif;
  user-select: none;
}

/* The welcome screen: a flat veil with the marks, title and text centred on it. */
#atlas-tour.atlas-tour-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(8, 8, 8, 0.9);
  animation: modalFadeIn 0.25s ease;
}

.atlas-tour-body {
  position: relative; /* above the last screen's veil */
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 720px;
  text-align: center;
  animation: atlas-tour-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes atlas-tour-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Laid out like the header's .atlas-brand, scaled up: wordmark first, the logo twice its
   height, and the gap at the same share of the logo. */
.atlas-tour-marks {
  display: flex;
  align-items: center;
  gap: clamp(19px, 3.3vh, 31px);
  margin-bottom: 32px;
}
.atlas-tour-logo { width: clamp(64px, 11vh, 104px); height: auto; -webkit-user-drag: none; }
.atlas-tour-wordmark { height: clamp(32px, 5.5vh, 52px); width: auto; -webkit-user-drag: none; }

.atlas-tour-title {
  margin: 0 0 12px 0;
  color: var(--atlas-accent);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
}

.atlas-tour-text {
  margin: 0 0 32px 0;
  max-width: 600px;
  color: #ccc;
  font-size: 16px;
  line-height: 1.6;
}
.atlas-tour-text strong,
.atlas-tour-card strong { color: #eee; font-weight: 700; }

.atlas-tour-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.atlas-tour-btns { display: flex; align-items: center; gap: 12px; }
.atlas-tour-skip {
  order: -1;
  margin-right: 6px;
  padding: 4px 2px;
  background: none;
  border: 0;
  color: #777;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.atlas-tour-skip:hover { color: #ccc; }
/* On the welcome screen Skip goes under Next, so Next stays centred under the dots
   instead of being pushed right by a link beside it. */
.atlas-tour-screen .atlas-tour-btns:has(.atlas-tour-skip) { flex-direction: column; gap: 10px; }
.atlas-tour-screen .atlas-tour-skip { order: 1; margin: 0; }

/* The last screen: its veil is the SVG with a hole over the Guide button, under a big
   icon, the text and the standalone-project note, as on the 3D builder's last screen. */
#atlas-tour.atlas-tour-holed { background: none; }
.atlas-tour-info {
  width: clamp(110px, 18vh, 180px);
  height: clamp(110px, 18vh, 180px);
  margin-bottom: 24px;
  color: var(--atlas-accent);
}
.atlas-tour-info svg { display: block; width: 100%; height: 100%; }
.atlas-tour-text:has(+ .atlas-tour-screen-note) { margin-bottom: 14px; }
/* the standalone-project note stands out as a callout, like the Stat Tracker's note */
.atlas-tour-screen-note {
  padding: 12px 18px;
  background: #121c24;
  border: 1px solid #24435a;
  border-left: 3px solid var(--atlas-accent);
  border-radius: 4px;
  color: #d6d6d6;
  font-size: 15px;
}
.atlas-tour-btn { min-width: 200px; padding: 10px 28px; font-size: 15px; }

.atlas-tour-dots { display: flex; gap: 8px; }
.atlas-tour-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  transition: background 0.2s;
}
.atlas-tour-dots i.on { background: var(--atlas-accent); }

/* The spotlight steps: the page shows through a hole in the veil, a card beside it. */
.atlas-tour-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: modalFadeIn 0.25s ease;
}
.atlas-tour-ring {
  fill: none;
  stroke-width: 2;
  opacity: 0;
  animation:
    atlas-tour-ring-in 0.5s ease-out 0.35s forwards,
    atlas-tour-ring-breathe 2.4s ease-in-out 0.85s infinite;
}
@keyframes atlas-tour-ring-in {
  to { opacity: 1; }
}
@keyframes atlas-tour-ring-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
/* The ring closing in on the hole from LOCKON_REACH outside it (--sx, --sy). */
.atlas-tour-lockon {
  fill: none;
  stroke: var(--atlas-accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: atlas-tour-lockon 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes atlas-tour-lockon {
  0%   { transform: scale(var(--sx), var(--sy)); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}

.atlas-tour-card {
  position: absolute;
  width: 390px;
  max-width: calc(100% - 24px);
  padding: 16px 18px 14px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.7);
  color: #ccc;
  animation: atlas-tour-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.atlas-tour-card-title {
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--atlas-accent);
  color: var(--atlas-accent);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.atlas-tour-card-text,
.atlas-tour-note {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.55;
}
.atlas-tour-note { color: #999; }
.atlas-tour-card .atlas-tour-foot {
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.atlas-tour-card .atlas-tour-btns { gap: 8px; }
.atlas-tour-card .atlas-tour-btn { min-width: 0; padding: 6px 14px; font-size: 13px; }
.atlas-tour-card .atlas-tour-dots { gap: 6px; }
.atlas-tour-card .atlas-tour-dots i { width: 6px; height: 6px; }

/* The quick start guide is EFTForge's modal (styles.css .modal-*), its title in Atlas blue
   like the primary button above. Above the key panel, below the tour. */
.atlas-page .modal-title { color: var(--atlas-accent); }
.atlas-guide-text {
  margin: 0;
  color: #bbb;
  font-size: 13px;
  line-height: 1.6;
}
.atlas-guide-text strong { color: #eee; font-weight: 700; }
