/* Layout and code-reader extensions to Tabler. */
:root {
  --atlas-muted: #59636e;
  --atlas-control-border: #8c959f;
  --atlas-header: 56px;
  --atlas-sidebar: 320px;
  --atlas-code-bg: var(--tblr-bg-surface);
  --atlas-code-fg: var(--tblr-body-color);
  --atlas-gutter: #6e7781;
  --atlas-comment: #59636e;
  --atlas-keyword: #6639ba;
  --atlas-string: #0a3069;
  --atlas-number: #0550ae;
  --atlas-match: #fff0b3;
  --atlas-current: #ffdf76;
}
[data-bs-theme="dark"] {
  --atlas-muted: #9da7b3;
  --atlas-control-border: #788491;
  --atlas-code-bg: #151b23;
  --atlas-code-fg: #d1d9e0;
  --atlas-gutter: #8b949e;
  --atlas-comment: #9198a1;
  --atlas-keyword: #d2a8ff;
  --atlas-string: #a5d6ff;
  --atlas-number: #79c0ff;
  --atlas-match: #382f12;
  --atlas-current: #16304a;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
}
button,
input,
select,
summary {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tblr-primary);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 1000;
  padding: 8px 12px;
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: 4px;
}
.skip-link:focus {
  top: 8px;
}
.atlas-header {
  height: var(--atlas-header);
  min-height: var(--atlas-header);
  padding: 0;
  border-bottom: 1px solid var(--tblr-border-color);
  box-shadow: none;
}
.atlas-header .container-fluid {
  gap: 12px;
  padding-inline: 20px;
}
.atlas-header .navbar-brand {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.atlas-shell {
  display: grid;
  grid-template-columns: var(--atlas-sidebar) minmax(0, 1fr);
  height: calc(100dvh - var(--atlas-header));
  min-height: 0;
}
.search-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
}
.search-controls {
  padding: 16px 16px 0;
  flex: none;
}
.mode-switch {
  margin-bottom: 16px;
}
.mode-switch .nav-link {
  font-size: 13px;
  min-height: 34px;
}
.search-controls .form-label {
  font-size: 13px;
  margin-bottom: 6px;
}
.search-options-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.search-options-row > .form-select {
  flex: 1;
  min-width: 0;
}
.search-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
}
.search-status-row .btn {
  padding: 4px 0;
  min-height: 28px;
}
.search-controls .progress {
  margin-inline: -16px;
  border-radius: 0;
}
.search-controls:has(.progress[hidden]) {
  border-bottom: 1px solid var(--tblr-border-color);
}
.results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.result,
.relation-link {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--tblr-body-color);
  overflow-wrap: anywhere;
  background: transparent;
}
.result {
  padding: 12px 16px;
  border-left: 3px solid transparent;
}
.result strong,
.relation-link strong {
  display: block;
  font:
    12px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  font-weight: 500;
}
.result small,
.relation-link small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--atlas-muted);
}
.result.active {
  background: var(--tblr-primary-lt);
  color: var(--tblr-body-color);
  border-left-color: var(--tblr-primary);
}
.result:disabled {
  opacity: 0.55;
  cursor: wait;
}
.result[aria-current="true"] strong {
  font-weight: 600;
}
.result-alias {
  font-family: ui-monospace, Consolas, monospace;
}
.string-snippet {
  margin-top: 8px;
  font:
    12px/1.6 ui-monospace,
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.recent-disclosure {
  flex: none;
  padding: 10px 16px;
  border-top: 1px solid var(--tblr-border-color);
  font-size: 12px;
}
.recent-disclosure summary {
  cursor: pointer;
  color: var(--atlas-muted);
  min-height: 28px;
  line-height: 28px;
}
.recent-disclosure .form-select {
  margin-top: 6px;
  max-width: 100%;
}
.workspace {
  min-width: 0;
  min-height: 0;
  background: var(--tblr-bg-surface);
}
.empty-workspace {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--atlas-muted);
}
.empty-workspace h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}
.function-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.function-header {
  padding: 16px 24px 12px;
  flex: none;
}
.function-address {
  font:
    12px/1.5 ui-monospace,
    Consolas,
    monospace;
  color: var(--atlas-muted);
  margin-bottom: 4px;
}
.function-name {
  font:
    500 15px/1.65 ui-monospace,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
  max-height: 108px;
  overflow: auto;
  margin: 0 0 12px;
}
.function-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#copy-status {
  color: var(--tblr-body-color);
  margin-left: 4px;
}
#copy-status:empty {
  display: none;
}
.workspace-tabs {
  padding-inline: 24px;
  gap: 8px;
  flex: none;
  border-bottom: 1px solid var(--tblr-border-color);
}
.workspace-tabs .nav-link {
  padding: 10px 16px;
  font-size: 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--atlas-muted);
  border-bottom: 2px solid transparent;
}
.workspace-tabs .nav-link.active {
  font-weight: 600;
  color: var(--tblr-body-color);
  background: transparent;
  border-bottom-color: var(--tblr-primary);
}
.workspace-panel {
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.code-panel {
  display: flex;
  flex-direction: column;
}
.code-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 24px;
  border-bottom: 1px solid var(--tblr-border-color);
  flex: none;
}
.code-find-group {
  max-width: 390px;
  min-width: 200px;
  flex: 1;
}
.code-toolbar #line-count {
  margin-left: auto;
  white-space: nowrap;
}
.code-toolbar #find-status:empty {
  display: none;
}
#code {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--atlas-code-bg);
  color: var(--atlas-code-fg);
}
#code-text {
  height: 100%;
  min-width: 0;
}
#code:focus-within {
  box-shadow: inset 0 0 0 2px var(--tblr-primary);
}
.context-toolbar {
  flex: none;
  padding: 12px 24px;
  border-bottom: 1px solid var(--tblr-border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.context-toolbar > .form-control {
  flex: 1;
  max-width: 420px;
  min-width: 180px;
}
.reference-options {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.reference-options .form-check {
  width: auto;
  margin: 0;
  font-size: 12px;
}
.data-panel {
  overflow: auto;
  overscroll-behavior: contain;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--tblr-border-color);
}
.panel-heading h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.string-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 24px;
}
.string-value {
  font:
    13px/1.7 ui-monospace,
    Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--atlas-string);
}
.string-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 12px;
}
.string-lines a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
}
.string-row > .btn {
  align-self: start;
}
.reference-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}
.reference-columns > section {
  min-width: 0;
}
.reference-columns > section + section {
  border-left: 1px solid var(--tblr-border-color);
}
.relation-link {
  padding: 14px 24px;
}
.relation-link:hover,
.result:hover {
  background: var(--tblr-bg-surface-secondary);
}
.reference-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--atlas-muted);
  font-size: 11px;
  margin-top: 8px;
}
.reference-status {
  padding: 12px 24px 0;
}
.reference-status:empty {
  display: none;
}
.relation-empty,
.filtered-empty,
.empty-row {
  padding: 20px 24px;
  color: var(--atlas-muted);
  font-size: 13px;
}
.action-menu {
  position: relative;
  flex: none;
}
.action-menu > summary {
  list-style: none;
  cursor: pointer;
  min-height: 32px;
}
.action-menu > summary::-webkit-details-marker {
  display: none;
}
.action-menu > summary::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.action-menu[open] > .dropdown-menu {
  display: block;
}
.action-menu > .dropdown-menu {
  top: calc(100% + 6px);
  min-width: 230px;
  z-index: 200;
  border: 1px solid var(--tblr-border-color);
  box-shadow: 0 6px 18px #00000012;
}
.function-actions .action-menu > .dropdown-menu {
  min-width: 285px;
  max-width: calc(100vw - 32px);
}
.action-menu .dropdown-item {
  min-height: 34px;
  white-space: normal;
  text-align: left;
}
.mobile-only {
  display: none;
}
body.focus-code[data-pane="code"] .atlas-shell {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 801px) {
  body.focus-code[data-pane="code"] .search-pane {
    display: none;
  }
}
@media (min-width: 1500px) {
  :root {
    --atlas-sidebar: 360px;
  }
}
@media (max-width: 1100px) {
  :root {
    --atlas-sidebar: 290px;
  }
  .function-header {
    padding-inline: 18px;
  }
  .code-toolbar,
  .context-toolbar {
    padding-inline: 18px;
  }
  .workspace-tabs {
    padding-inline: 18px;
  }
  .reference-columns {
    grid-template-columns: 1fr;
  }
  .reference-columns > section + section {
    border-left: 0;
    border-top: 1px solid var(--tblr-border-color);
  }
}
@media (max-width: 800px) {
  .atlas-header .container-fluid {
    padding-inline: 16px;
  }
  .atlas-header .navbar-brand {
    font-size: 16px;
  }
  .header-actions {
    gap: 6px;
  }
  .atlas-shell {
    display: block;
  }
  .search-pane {
    height: 100%;
    border-right: 0;
  }
  .search-controls {
    padding-top: 14px;
  }
  .results {
    min-height: 120px;
  }
  .workspace {
    height: 100%;
  }
  .empty-workspace {
    display: none;
  }
  body[data-mobile-view="search"] .workspace {
    display: none;
  }
  body[data-mobile-view="function"] .search-pane {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
    margin-bottom: 12px;
  }
  .function-header {
    padding: 12px 16px;
  }
  .function-name {
    font-size: 13px;
    max-height: 92px;
  }
  .function-actions {
    gap: 6px;
  }
  .workspace-tabs {
    padding-inline: 12px;
    gap: 0;
  }
  .workspace-tabs .nav-link {
    padding: 10px 14px;
  }
  .code-toolbar {
    padding: 10px 16px;
    gap: 8px;
  }
  .code-find-group {
    flex-basis: 100%;
    max-width: none;
  }
  .code-toolbar #line-count {
    margin-left: 0;
  }
  .code-toolbar > .action-menu {
    margin-left: auto;
  }
  .context-toolbar {
    padding: 12px 16px;
    gap: 12px;
  }
  .reference-options {
    gap: 12px;
  }
  .context-toolbar > .form-control {
    max-width: none;
  }
  .panel-heading,
  .relation-link {
    padding-inline: 16px;
  }
  .string-row {
    padding: 14px 16px;
    gap: 8px;
  }
  .reference-columns {
    display: block;
  }
  .function-actions .action-menu > .dropdown-menu {
    left: auto;
    right: 0;
  }
  .atlas-header .dropdown-menu {
    right: 0;
    left: auto;
  }
  #expand-code {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.result .reference-meta,
.relation-link .reference-meta {
  display: flex;
  gap: 4px 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.result strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.mode-switch .nav-link.active {
  color: var(--tblr-body-color);
  font-weight: 600;
  background: var(--tblr-primary-lt);
}
body.download-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
}
.download-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}
.download-container h1 {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 16px;
}
.download-container h2 {
  font-size: 16px;
  margin-top: 32px;
  margin-bottom: 12px;
}
.download-container p {
  line-height: 1.7;
}
#join {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--tblr-bg-surface-secondary);
  color: var(--tblr-body-color);
  font-size: 12px;
}
@media (max-width: 800px) {
  #search,
  #context-query,
  #code-find {
    font-size: 16px;
  }
  .download-container {
    padding: 24px 16px;
  }
  .download-container h1 {
    font-size: 21px;
  }
}

.search-options-row .action-menu > .dropdown-menu {
  left: auto;
  right: 0;
}
@media (max-width: 800px) {
  .function-actions {
    position: relative;
  }
  .function-actions .action-menu {
    position: static;
  }
  .function-actions .action-menu > .dropdown-menu {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 380px) {
  .atlas-header .container-fluid {
    padding-inline: 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .atlas-header .navbar-brand {
    font-size: 14px;
  }
  .header-actions .btn {
    padding-inline: 8px;
    font-size: 12px;
  }
}

#search-clear,
.string-lines a,
.atlas-header .dropdown-menu a {
  color: var(--atlas-number);
}

.mode-switch .nav-link {
  color: var(--atlas-muted);
}

html.download-document {
  height: auto;
  min-height: 100%;
  overflow: auto;
}
body.download-page {
  overflow: visible;
}

body:not(.download-page) {
  position: fixed;
  inset: 0;
}
.workspace {
  overflow: hidden;
}
.action-menu > .dropdown-menu {
  z-index: 1100;
}
@media (max-height: 560px) {
  .function-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
  }
  .function-address {
    display: none;
  }
  .function-name {
    flex: 1;
    min-width: 0;
    max-height: 40px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
  }
  .function-actions {
    flex: none;
  }
  .function-header .mobile-only {
    margin: 0;
  }
  .code-find-group {
    flex-basis: 200px;
    max-width: 390px;
  }
  .code-toolbar #line-count {
    margin-left: auto;
  }
}
@media (max-height: 560px) and (max-width: 559px) {
  .function-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--tblr-bg-surface);
  }
  .function-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .function-actions {
    flex: 1;
    min-width: 0;
  }
  .function-header .mobile-only {
    max-width: 68px;
    white-space: normal;
    line-height: 1.2;
  }
  .workspace {
    overflow: auto;
    scroll-padding-top: 100px;
  }
  .function-viewer {
    height: auto;
    min-height: 100%;
  }
  .code-panel {
    flex: none;
    height: 320px;
    min-height: 320px;
  }
  .data-panel {
    overflow: visible;
    flex: none;
  }
  .search-pane {
    overflow: auto;
  }
  .results {
    flex: none;
    overflow: visible;
    min-height: 0;
  }
  .cm-scroller {
    overscroll-behavior: auto !important;
  }
}

#failure-message {
  min-width: 0;
  overflow-wrap: anywhere;
}
#retry-function {
  flex: none;
  align-self: start;
}

.input-group-text {
  color: var(--atlas-muted);
}
.form-control,
.form-select,
.form-check-input {
  border-color: var(--atlas-control-border);
}


.call-graph { padding: 12px; }
.graph-shell { --g-bg: #f6f8fb; display: flex; flex-direction: column; gap: 10px; }
.graph-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.graph-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.graph-toolbar .form-select { width: auto; }
.graph-toolbar .btn-icon { width: 30px; padding-inline: 0; font-weight: 700; }
.graph-check { margin: 0 0 0 6px; font-size: 13px; }
.graph-dropdown { position: relative; }
.graph-dropdown > summary { list-style: none; }
.graph-dropdown > summary::-webkit-details-marker { display: none; }
.graph-dropdown > summary::after { content: "▾"; margin-left: 6px; font-size: 10px; opacity: .7; }
.graph-menu { display: block; position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; max-height: 360px; overflow: auto; z-index: 30; }
.graph-dropdown:not([open]) .graph-menu { display: none; }
.graph-view-row { display: flex; align-items: center; }
.graph-view-row .dropdown-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.graph-view-delete { padding: 0 8px; }
.graph-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 34%); gap: 10px; }
@media (max-width: 640px) { .graph-body { grid-template-columns: 1fr; } }
.graph-stage { position: relative; height: min(72vh, 700px); min-height: 420px; border: 1px solid var(--tblr-border-color, #dce1e7); border-radius: 10px; overflow: hidden; background: var(--g-bg); }
.graph-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; }
.graph-canvas.panning { cursor: grabbing; }
.graph-node { outline: none; transition: filter .12s; }
.graph-node:hover, .graph-node:focus-visible { filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.graph-expand:hover circle { stroke-width: 2; }
.graph-shell.is-editing .graph-stage { box-shadow: inset 0 0 0 2px var(--tblr-primary, #206bc4); }
.graph-inspector, .graph-preview, .graph-memory { padding: 12px; border-radius: 10px; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #dce1e7); display: grid; gap: 6px; min-width: 0; }
.graph-inspector .form-label { margin: 4px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--tblr-secondary, #6b7686); }
.graph-inspector-title { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.graph-inspector-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.graph-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.graph-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--tblr-border-color, #dce1e7); background: var(--sw); padding: 0; }
.graph-swatch[style*="transparent"] { background: linear-gradient(135deg, transparent 45%, #d63939 45% 55%, transparent 55%); }
.graph-swatch.active { outline: 2px solid var(--tblr-primary, #206bc4); outline-offset: 2px; }
.graph-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 12px; color: var(--tblr-secondary, #6b7686); }
.graph-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.graph-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.graph-sidebar { display: flex; flex-direction: column; gap: 10px; max-height: min(72vh, 700px); min-height: 0; overflow: auto; }
.graph-side-title { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.graph-side-title.small { font-size: 12px; margin-top: 6px; }
.graph-side-note { font-size: 12px; color: var(--tblr-secondary, #6b7686); }
.graph-preview-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.graph-preview-string { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.graph-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.graph-facts dt { color: var(--tblr-secondary, #6b7686); font-weight: 400; }
.graph-facts dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.graph-code-wrap { max-height: 340px; overflow: auto; border-radius: 8px; background: #0f1521; }
.graph-code { margin: 0; padding: 10px 12px; color: #e6ebf2; background: transparent; font-size: 11.5px; line-height: 1.5; white-space: pre; }
.graph-code-setup { color: #8b97a8; }
.graph-memory-list { display: grid; gap: 4px; }
.graph-memory-cell { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; text-align: left; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--tblr-border-color, #dce1e7); background: var(--tblr-bg-surface, #fff); color: inherit; font-size: 12px; min-width: 0; }
.graph-memory-cell:hover { border-color: var(--tblr-primary, #206bc4); }
.graph-memory-cell.current { background: var(--tblr-primary, #206bc4); border-color: var(--tblr-primary, #206bc4); color: #fff; cursor: default; }
.graph-memory-cell.linked { border-color: #2fb344; box-shadow: inset 3px 0 0 #2fb344; }
.graph-memory-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.graph-memory-delta { flex: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; opacity: .75; }
.graph-code-helpers { font-size: 12px; }
.graph-code-helpers > summary { cursor: pointer; color: var(--tblr-secondary, #6b7686); }
.graph-code-helpers > pre { margin-top: 6px; max-height: 260px; overflow: auto; border-radius: 8px; background: #0f1521; }
.graph-code-main { color: #e6ebf2; }
.graph-code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- graph tab: calmer, evenly spaced (unslop pass) ---- */
.call-graph { padding: 16px; }
.graph-shell { gap: 12px; }
.graph-body { gap: 12px; }
.graph-toolbar .btn, .graph-dropdown > summary.btn { font-weight: 500; box-shadow: none; }
.graph-stage { border-radius: 8px; }
.graph-inspector, .graph-preview, .graph-memory { padding: 14px; border-radius: 8px; gap: 10px; box-shadow: none; }
.graph-side-title { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.graph-side-label { font-size: 12px; font-weight: 600; color: var(--tblr-body-color, #1d273b); }
.graph-side-note { font-size: 12.5px; line-height: 1.45; }
.graph-code-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.graph-seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--tblr-bg-surface-secondary, #f1f3f6); }
.graph-seg button { border: 0; background: transparent; padding: 3px 10px; border-radius: 5px; font-size: 12px; color: var(--tblr-secondary, #6b7686); }
.graph-seg button.active { background: var(--tblr-bg-surface, #fff); color: var(--tblr-body-color, #1d273b); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.graph-code-wrap { position: relative; background: #11161f; border-radius: 8px; max-height: none; }
.graph-code { padding: 12px 14px; font-size: 12px; line-height: 1.55; color: #dfe5ee; }
.graph-copy { position: absolute; top: 6px; right: 6px; border: 1px solid #2a3343; background: #1a2130; color: #c9d1dc; font-size: 11px; padding: 2px 8px; border-radius: 5px; }
.graph-copy:hover { background: #232c3d; }
.graph-code-helpers > summary { font-size: 12px; }
.graph-code-helpers > pre { background: #11161f; color: #9aa6b6; }
.graph-facts { gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--tblr-border-color, #e3e7ec); }
.graph-facts dd { font-size: 12px; }
.graph-memory-cell { padding: 7px 10px; border-radius: 6px; }
.graph-footer { font-size: 12px; }

/* ---- view counter ---- */
.view-count { position: fixed; right: 12px; bottom: 10px; z-index: 40; font-size: 11px; color: var(--tblr-secondary, #6b7686); background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #e3e7ec); border-radius: 999px; padding: 2px 9px; pointer-events: none; font-variant-numeric: tabular-nums; }
.view-count:empty { display: none; }

/* ---- brand ---- */
.brand { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; }
.brand .navbar-brand { line-height: 1.15; padding: 0; }
.brand-discord { font-size: 11px; line-height: 1.2; color: var(--tblr-secondary); text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.brand-discord:hover, .brand-discord:focus-visible { color: var(--tblr-primary); text-decoration: underline; text-underline-offset: 2px; }

/* ---- site themes ---- */
:root[data-theme] body { background: var(--tblr-body-bg); }
:root[data-theme="vanilla"] { --tblr-body-bg: #faf8f4; --tblr-bg-surface: #ffffff; --tblr-bg-surface-secondary: #f3efe8; --tblr-body-color: #24211c; --tblr-secondary: #6f685d; --tblr-secondary-color: #6f685d; --tblr-border-color: #e6e0d6; --tblr-primary: #2f6f5e; --tblr-primary-rgb: 47,111,94; --tblr-link-color: #2f6f5e; --atlas-code-bg: #fffdf9; --atlas-muted: #6f685d; }
:root[data-theme="dark"] { --tblr-body-bg: #141414; --tblr-bg-surface: #1c1c1c; --tblr-bg-surface-secondary: #242424; --tblr-body-color: #e7e7e7; --tblr-secondary: #9a9a9a; --tblr-secondary-color: #9a9a9a; --tblr-border-color: #2e2e2e; --tblr-primary: #7aa2f7; --tblr-primary-rgb: 122,162,247; --tblr-link-color: #7aa2f7; --atlas-code-bg: #161616; --atlas-code-fg: #e2e2e2; --atlas-muted: #9a9a9a; }
:root[data-theme="midnight"] { --tblr-body-bg: #0b1020; --tblr-bg-surface: #111832; --tblr-bg-surface-secondary: #18213f; --tblr-body-color: #dbe3ff; --tblr-secondary: #8c97bd; --tblr-secondary-color: #8c97bd; --tblr-border-color: #232d52; --tblr-primary: #8b9cff; --tblr-primary-rgb: 139,156,255; --tblr-link-color: #a9b6ff; --atlas-code-bg: #0d1328; --atlas-code-fg: #d6defa; --atlas-muted: #8c97bd; }
:root[data-theme="terminal"] { --tblr-body-bg: #0a0d0a; --tblr-bg-surface: #0f140f; --tblr-bg-surface-secondary: #141c14; --tblr-body-color: #c8f7c5; --tblr-secondary: #6f9a6c; --tblr-secondary-color: #6f9a6c; --tblr-border-color: #1e2b1e; --tblr-primary: #39d353; --tblr-primary-rgb: 57,211,83; --tblr-link-color: #7dff8a; --atlas-code-bg: #070a07; --atlas-code-fg: #c8f7c5; --atlas-muted: #6f9a6c; --tblr-font-sans-serif: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --tblr-body-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:root[data-theme="terminal"] body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:root[data-theme="terminal"] .btn-primary { color: #041004; }
:root[data-theme="japan"] { --tblr-body-bg: #f6f1e7; --tblr-bg-surface: #fbf8f1; --tblr-bg-surface-secondary: #efe7d8; --tblr-body-color: #2b2622; --tblr-secondary: #7a6e63; --tblr-secondary-color: #7a6e63; --tblr-border-color: #e2d8c6; --tblr-primary: #bc002d; --tblr-primary-rgb: 188,0,45; --tblr-link-color: #bc002d; --atlas-code-bg: #fdfaf4; --atlas-muted: #7a6e63; }
:root[data-theme="japan"] .navbar-brand { letter-spacing: .02em; }
:root[data-theme="midnight"] .btn-primary, :root[data-theme="dark"] .btn-primary { color: #0b1020; }
:root[data-theme] .btn-primary { background-color: var(--tblr-primary); border-color: var(--tblr-primary); }
:root[data-theme] .graph-code-wrap, :root[data-theme] .graph-code-helpers > pre { background: #11161f; }
:root[data-theme="terminal"] .graph-code-wrap, :root[data-theme="terminal"] .graph-code-helpers > pre { background: #050805; }
:root[data-theme="terminal"] .graph-code { color: #c8f7c5; }
.graph-toolbar .form-select { width: auto; height: 31px; min-height: 31px; padding: 2px 28px 2px 10px; font-size: 13px; line-height: 1.4; }
