:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-text-soft: #6f6f6f;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-success: #16a34a;
  --cp-danger: #dc2626;
  --cp-warning: #f59e0b;
  --cp-link: #0078d4;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-overlay: rgba(255, 255, 255, 0.8);
  --cp-panel: rgba(255, 255, 255, 0.86);
  --cp-panel-strong: rgba(255, 255, 255, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.55);
  --cp-highlight: rgba(177, 31, 75, 0.12);
}

#map-stage.visualization-filter-active:not(.filter-panel-collapsed) .map-energy-legend {
  right: auto;
}

#map-stage.visualization-filter-active:not(.filter-panel-collapsed) .map-visibility-control {
  right: 252px;
}

#map-stage.visualization-filter-active:not(.filter-panel-collapsed) .map-node-size-control {
  right: 252px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed) .map-visibility-control {
  right: 252px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed) .map-node-size-control {
  right: 252px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed).visualization-filter-active:not(.filter-panel-collapsed) .operator-overlay-panel {
  right: 240px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed).visualization-filter-active:not(.filter-panel-collapsed) .map-visibility-control {
  right: 492px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed).visualization-filter-active:not(.filter-panel-collapsed) .map-node-size-control {
  right: 492px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed).visualization-filter-active:not(.filter-panel-collapsed) .operator-filter-toggle {
  right: 448px;
}

#map-stage.operator-overlay-active:not(.operator-panel-collapsed).filter-panel-collapsed .visualization-filter-toggle {
  right: 252px;
}

.operator-overlay-panel {
  display: block;
}

.operator-overlay-panel[hidden] {
  display: none;
}

.operator-overlay-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 28px;
  font-size: 0.68rem;
  cursor: pointer;
}

.operator-overlay-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #3b82f6;
}

.operator-market-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--code-line);
}

.operator-market-button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--code-line);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.operator-market-button:hover,
.operator-market-button.selected {
  background: rgb(255 255 255 / 4%);
}

.operator-market-button strong {
  font-size: 0.7rem;
}

.operator-market-button span {
  color: #aab8cb;
  font-size: 0.6rem;
}

.operator-market-button em {
  color: #aab8cb;
  font-size: 0.6rem;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.operator-detail-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.operator-detail-title strong {
  font-size: 1rem;
}

.operator-detail-title span {
  border: 0;
  padding: 0;
  color: #aab8cb;
  font-size: 0.54rem;
  font-weight: 700;
}

.operator-detail-name,
.operator-detail-note {
  color: #aab8cb;
  line-height: 1.45;
}

.operator-detail-name {
  margin: 5px 0 12px;
}

.operator-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.operator-detail-list div {
  display: grid;
  gap: 2px;
}

.operator-detail-list dt {
  color: #aab8cb;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.operator-detail-list dd {
  margin: 0;
  line-height: 1.4;
}

.operator-detail-list div:first-child dd {
  color: var(--paper);
  font-weight: 600;
}

.operator-detail-note {
  margin: 14px 0 0;
  border: 0;
  padding: 0;
}

.map-filter-toggle {
  position: absolute;
  top: 14px;
  right: 208px;
  z-index: 470;
  display: inline-grid;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  padding: 1px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
  box-shadow: none;
}

#map-stage:not(.filter-panel-collapsed) .map-filter-toggle:hover {
  background: transparent;
  color: #ffffff;
}

#map-stage.filter-panel-collapsed .visualization-filter-toggle {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-color: var(--cp-border);
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
}

#map-stage.filter-panel-collapsed:has(.network-totals:not([hidden])) .visualization-filter-toggle {
  right: 238px;
}

.operator-filter-toggle {
  top: 14px;
  right: 208px;
}

#map-stage.operator-panel-collapsed .operator-filter-toggle {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-color: var(--cp-border);
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
}

#map-stage.operator-panel-collapsed.visualization-filter-active:not(.filter-panel-collapsed) .operator-filter-toggle {
  right: 252px;
}

#map-stage.operator-panel-collapsed:has(.network-totals:not([hidden])) .operator-filter-toggle {
  right: 238px;
}

#map-stage.operator-panel-collapsed.filter-panel-collapsed .operator-filter-toggle {
  right: 50px;
}

#map-stage.operator-panel-collapsed.filter-panel-collapsed:has(.network-totals:not([hidden])) .operator-filter-toggle {
  right: 276px;
}

.map-filter-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.map-filter-panel {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 460;
  width: 240px;
  overflow: auto;
  border-left: 1px solid var(--code-line);
  background: var(--code-output);
  color: var(--paper);
  font-size: 0.72rem;
  scrollbar-width: none;
}

.map-filter-panel::-webkit-scrollbar {
  display: none;
}

.map-filter-panel[hidden] {
  display: none;
}

.map-filter-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 40px;
  border-bottom: 1px solid var(--code-line);
}

.map-filter-header strong {
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.map-filter-section {
  padding: 16px;
  border-bottom: 1px solid var(--code-line);
}

.map-filter-section h2 {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.map-filter-label,
.map-filter-search > span {
  display: block;
  margin-bottom: 10px;
  color: #aab8cb;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-filter-options {
  display: grid;
  gap: 8px;
}

.map-filter-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 9px;
  min-height: 23px;
  font-size: 0.68rem;
  cursor: pointer;
}

.view-tab svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-filter-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #3b82f6;
}

.map-filter-row output {
  color: #aab8cb;
  font-variant-numeric: tabular-nums;
}

.map-filter-bar {
  display: block;
  height: 8px;
  border-radius: 3px;
  background: #3b82f6;
  transform-origin: left center;
}

.map-filter-search {
  display: block;
  margin-top: 18px;
}

.map-filter-search input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #66717f;
  border-radius: 3px;
  padding: 8px 9px;
  background: #242a32;
  color: var(--paper);
  font: inherit;
  font-size: 0.68rem;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #3d3b3a;
  --cp-bg-elevated: #343231;
  --cp-surface: #292929;
  --cp-surface-soft: #2e2e2e;
  --cp-border: #474747;
  --cp-border-strong: #5f5f5f;
  --cp-text: #dedede;
  --cp-text-muted: #919191;
  --cp-text-soft: #b0b0b0;
  --cp-accent: #fd8ea1;
  --cp-accent-hover: #fb7b91;
  --cp-accent-soft: rgba(253, 142, 161, 0.14);
  --cp-accent-fg: #1a1a1a;
  --cp-success: #4ade80;
  --cp-danger: #f87171;
  --cp-warning: #fbbf24;
  --cp-link: #4da6ff;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --cp-overlay: rgba(41, 41, 41, 0.88);
  --cp-panel: rgba(41, 41, 41, 0.72);
  --cp-panel-strong: rgba(41, 41, 41, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.04);
  --cp-highlight: rgba(253, 142, 161, 0.12);
}

:root {
  --slate: #2c353c;
  --ink: #0e0e0e;
  --paper: #f4f7f8;
  --bg: var(--slate);
  --panel: var(--ink);
  --line: var(--ink);
  --text: var(--paper);
  --muted: var(--paper);
  --accent: var(--paper);
  --hot: var(--paper);
  --warn: var(--paper);
  --code-surface: #232323;
  --code-output: #1c1c1c;
  --code-line: #3a3a3a;
  --code-active: #292929;
  --code-text: #c8c8c8;
  --code-muted: #a9a9a9;
  --code-disabled: #666;
  --map-background: #1b1b1d;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

.view-tabs {
  position: relative;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: 42px;
  min-height: 42px;
  padding: 0 12px 0 0;
  background: #0d1117;
  border-bottom: 1px solid #252b34;
}

.app-brand {
  display: flex;
  height: 42px;
  min-width: 0;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: #f4f7f8;
}

.app-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-right: 1px solid #303640;
  background: #252b33;
  color: var(--paper);
}

.app-mark svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-title {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-tab-list {
  display: flex;
  height: 42px;
  align-items: center;
  align-self: center;
  gap: 2px;
}

.nav-pickers {
  display: flex;
  height: 42px;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.overlay-picker-field {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  color: #9ca8b8;
  font-size: 0.66rem;
  line-height: 1;
}

.overlay-picker-field > span {
  display: inline-flex;
  height: 26px;
  align-items: center;
}

.overlay-picker {
  position: relative;
  color: #d8dee8;
}

.overlay-picker summary {
  display: flex;
  box-sizing: border-box;
  height: 26px;
  min-width: 116px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid #3a424e;
  border-radius: 3px;
  padding: 4px 7px;
  background: #20262e;
  cursor: pointer;
  font: inherit;
  list-style: none;
}

.overlay-picker summary::-webkit-details-marker {
  display: none;
}

.overlay-picker summary::after {
  content: "▾";
  margin-left: auto;
  color: #9ca8b8;
}

.overlay-picker output {
  color: #d8dee8;
  font: inherit;
  line-height: normal;
  text-align: left;
}

.overlay-picker summary:focus-visible {
  border-color: var(--cp-border-strong);
  outline: none;
}

.overlay-picker-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  width: 190px;
  gap: 2px;
  border: 1px solid #3a424e;
  border-radius: 4px;
  padding: 5px;
  background: #20262e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.overlay-picker-menu label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
}

.overlay-picker-menu label:hover {
  background: #2a313b;
}

.dataset-picker {
  display: flex;
  height: 42px;
  align-items: center;
  align-self: center;
  justify-self: end;
  gap: 7px;
  margin: 0;
  color: #9ca8b8;
  font-size: 0.66rem;
  line-height: 1;
}

.dataset-picker > span {
  display: inline-flex;
  align-items: center;
  height: 26px;
}

.dataset-picker select {
  display: block;
  box-sizing: border-box;
  height: 26px;
  min-width: 230px;
  max-width: min(360px, 42vw);
  border: 1px solid #3a424e;
  border-radius: 3px;
  padding: 4px 24px 4px 7px;
  background: #20262e;
  color: #d8dee8;
  font: inherit;
  line-height: normal;
}

.dataset-picker select:focus-visible {
  border-color: var(--cp-border-strong);
  outline: none;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  justify-content: center;
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #9ca8b8;
  font: inherit;
  font-weight: 600;
  padding: 0 11px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 760px) {
  .view-tabs {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-right: 8px;
  }

  .view-tab-list {
    justify-self: start;
  }

  .dataset-picker span {
    display: none;
  }

  .dataset-picker select {
    min-width: 150px;
    max-width: 34vw;
  }
}

.view-tab:hover {
  color: #e4e9f0;
  background: #151a21;
}

.view-tab.active {
  background: transparent;
  border-bottom-color: #2f81f7;
  color: #58a6ff;
}

@media (max-width: 980px) {
  .app-title {
    display: none;
  }
}

.toolbar {
  --toolbar-item-gap: 6px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 5px 14px 5px var(--toolbar-item-gap);
  border-bottom: 1px solid var(--code-line);
  background: var(--code-output);
  z-index: 2;
}

.toolbar.hidden {
  display: none;
}

.toolbar h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-right: 8px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--toolbar-item-gap);
}



.toolbar .tool {
  min-height: 28px;
  padding: 5px 10px;
  border-color: #454545;
  border-radius: 5px;
  background: #242424;
  color: #d7d7d7;
  font-size: 0.76rem;
  box-shadow: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.toolbar .tool:hover {
  border-color: #666;
  background: #303030;
  color: #fff;
}

.toolbar .tool.active {
  border-color: #626262;
  box-shadow: none;
}

.toolbar .icon-tool {
  align-self: center;
  width: 30px;
  height: 28px;
  padding: 5px;
}

.toolbar .icon-tool svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.tool {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--slate);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 12px;
  border-radius: 3px;
  cursor: pointer;
}

.tool:hover {
  border-color: var(--accent);
}

.tool:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tool:disabled:hover {
  border-color: var(--ink);
}

.tool.active {
  background: var(--ink);
  border-color: var(--accent);
  color: var(--paper);
  box-shadow: 0 0 0 2px var(--slate);
}

.map-edit-toggle.active {
  background: #000;
}

.tool.danger {
  border-color: var(--ink);
}

.tool.danger:hover,
.tool.danger.active {
  border-color: var(--warn);
  color: var(--paper);
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.graph-name {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-dialog {
  width: min(500px, calc(100vw - 32px));
  min-width: 0;
  max-width: none;
}

.dialog-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.saved-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 6px 8px;
  background: var(--slate);
}

.saved-item-info {
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-item-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-item-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.saved-item button {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--slate);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  padding: 5px 9px;
  border-radius: 3px;
  cursor: pointer;
}

.saved-item button:hover {
  border-color: var(--accent);
}

.saved-item .danger {
  border-color: var(--ink);
}

.saved-item .danger:hover {
  border-color: var(--warn);
}

.saved-empty {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.saved-empty.hidden {
  display: none;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.workspace-shell {
  --chat-panel-width: 256px;
  position: relative;
  flex: 1;
  min-height: 0;
}

.workspace-shell main {
  --python-panel-collapsed-width: 40px;
  --python-panel-width: clamp(300px, 34vw, 480px);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.chat-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1100;
  display: flex;
  width: min(var(--chat-panel-width), calc(100vw - 64px));
  min-width: min(var(--chat-panel-width), calc(100vw - 64px));
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--cp-border);
  background: var(--cp-bg-elevated);
  color: var(--cp-text);
  font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  transition: width 180ms ease, min-width 180ms ease, flex-basis 180ms ease;
}

html[data-theme="dark"] .chat-panel,
html[data-theme="dark"] .chat-panel-header,
html[data-theme="dark"] .chat-form {
  background: var(--code-surface);
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel.collapsed {
  width: 40px;
  min-width: 40px;
}

.chat-panel-resize {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 3;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
}

.chat-panel-resize:hover,
.chat-panel-resize:focus-visible,
.chat-panel-resize.resizing {
  background: var(--code-line);
  outline: none;
}

.chat-panel.collapsed .chat-panel-resize {
  display: none;
}

.chat-panel-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--cp-border);
  padding: 6px 8px 6px 12px;
  background: var(--cp-bg-elevated);
}

.chat-panel-grip {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--cp-text-muted);
}

.chat-panel-grip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.chat-panel-header-label {
  order: 1;
  flex: 1;
  color: var(--cp-text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-panel-toggle {
  order: 2;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cp-text-muted);
  margin-left: auto;
  font: inherit;
  cursor: pointer;
}

.chat-panel-toggle:hover {
  border-radius: 4px;
  background: var(--cp-surface-soft);
  color: var(--cp-text);
}

.chat-panel-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  color: var(--cp-text-muted);
  font-size: 0.78rem;
}

.chat-panel-body p {
  margin: 0;
}

.chat-panel.collapsed .chat-panel-header-label,
.chat-panel.collapsed .chat-panel-body {
  display: none;
}

.chat-panel.collapsed .chat-panel-header {
  justify-content: center;
  padding: 6px 4px;
}

.chat-panel.collapsed .chat-panel-toggle {
  margin-left: 0;
}

.chat-panel.collapsed .chat-panel-grip {
  display: none;
}

.chat-messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  padding: 16px 12px 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-suggestion {
  max-width: 76%;
  align-self: flex-end;
  border-radius: 4px;
  padding: 9px 10px;
  background: var(--cp-surface-soft);
  color: var(--cp-text);
  font-size: 0.72rem;
  line-height: 1.35;
}

.chat-message {
  width: 100%;
  color: var(--cp-text);
  overflow-wrap: anywhere;
}

.chat-message.user {
  width: auto;
  max-width: 82%;
  align-self: flex-end;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
  padding: 9px 10px;
  background: var(--cp-surface-soft);
  color: var(--cp-text);
}

.chat-message.error {
  border-left: 3px solid var(--cp-border-strong);
  padding-left: 9px;
}

.copilot-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.chat-panel-header-label {
  display: inline-flex;
  align-items: center;
}

.chat-message-role {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--cp-text-muted);
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-message-role::before {
  width: 8px;
  height: 8px;
  border: 2px solid var(--cp-text-muted);
  border-radius: 2px;
  background: transparent;
  content: "";
}

.chat-message.assistant .chat-message-role::before {
  display: none;
}

.chat-message.assistant .chat-message-role {
  color: var(--cp-text-soft);
}

.chat-message.user .chat-message-role {
  margin-bottom: 4px;
}

.chat-message.user .chat-message-role::before {
  display: none;
}

.chat-message p {
  color: var(--cp-text);
  font-size: 0.78rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.chat-message-content {
  display: grid;
  gap: 12px;
}

.chat-progress {
  display: grid;
  gap: 8px;
  padding: 2px 0;
  color: var(--cp-text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.chat-progress-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.chat-progress-item.completed {
  color: var(--cp-text-soft);
}

.chat-progress-item.failed {
  color: var(--cp-text);
}

.chat-progress-indicator {
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  justify-self: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.chat-progress-item.running .chat-progress-indicator {
  border-color: color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  animation: chat-progress-spin 0.8s linear infinite;
}

.chat-progress-item.completed .chat-progress-indicator {
  border-color: currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 2px var(--cp-bg-elevated);
}

.chat-progress-item.failed .chat-progress-indicator {
  border-color: currentColor;
}

@keyframes chat-progress-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-message.assistant p {
  white-space: normal;
}

.chat-thinking {
  border-left: 2px solid var(--cp-border-strong);
  padding-left: 9px;
  color: var(--cp-text-muted);
  font-size: 0.7rem;
}

.chat-thinking summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.chat-thinking summary::-webkit-details-marker {
  display: none;
}

.chat-thinking-indicator {
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: chat-progress-spin 0.8s linear infinite;
}

.chat-thinking-indicator.complete {
  border-color: currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 2px var(--cp-bg-elevated);
  animation: none;
}

.chat-thinking-content {
  display: grid;
  gap: 8px;
  margin: 8px 0 0 16px;
}

.chat-thinking:not([open]) .chat-thinking-content {
  display: none;
}

.chat-thinking-content p,
.chat-thinking-content strong,
.chat-thinking-content code {
  color: var(--cp-text-muted);
  font-size: 0.68rem;
}

.chat-answer {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.chat-message blockquote {
  margin: 0;
  border-left: 2px solid var(--cp-border-strong);
  padding-left: 9px;
  color: var(--cp-text-soft);
}

.chat-message a {
  color: var(--cp-link);
}

.chat-message.assistant h1,
.chat-message.assistant h2,
.chat-message.assistant h3,
.chat-message.assistant h4,
.chat-message.assistant h5,
.chat-message.assistant h6 {
  margin: 0;
  color: var(--cp-text);
  font-size: 0.84rem;
  line-height: 1.4;
}

.chat-message.assistant ul,
.chat-message.assistant ol {
  margin: 0;
  padding-left: 20px;
  color: var(--cp-text);
  font-size: 0.78rem;
  line-height: 1.55;
}

.chat-message.assistant code {
  border-radius: 3px;
  padding: 1px 4px;
  background: var(--cp-surface-soft);
  color: var(--cp-text);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 0.75rem;
}

.chat-message.assistant pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
  padding: 10px;
  background: var(--cp-bg);
}

.chat-message.assistant pre code {
  padding: 0;
  background: transparent;
  white-space: pre;
}

.chat-message.assistant table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.chat-message.assistant th,
.chat-message.assistant td {
  border: 1px solid var(--cp-border);
  padding: 5px 7px;
  text-align: left;
  vertical-align: top;
}

.chat-message.assistant th {
  background: var(--cp-surface-soft);
  font-weight: 600;
}

.chat-object-references {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.chat-object-reference {
  --object-color: var(--cp-text-muted);
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--cp-border);
  border-radius: 3px;
  padding: 2px 5px 2px 3px;
  background: var(--cp-surface-soft);
  color: var(--cp-text-soft);
  font: inherit;
  font-size: 0.64rem;
  line-height: 1.2;
  cursor: pointer;
}

.chat-object-reference:hover,
.chat-object-reference:focus-visible {
  border-color: var(--cp-border-strong);
  background: var(--cp-surface);
  color: var(--cp-text);
}

.chat-object-reference-index {
  display: inline-grid;
  min-width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--cp-bg-elevated);
  color: var(--cp-text-muted);
  font-size: 0.56rem;
}

.chat-object-reference-icon {
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 2px;
  background: transparent;
}

.chat-object-reference-icon svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: var(--object-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-instructions {
  width: 100%;
  margin: 0 0 14px;
  color: var(--cp-text-muted);
  font-size: 0.72rem;
}

.chat-instructions summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.chat-instructions summary::-webkit-details-marker {
  display: none;
}

.chat-instructions summary::after {
  margin-left: auto;
  content: "›";
}

.chat-instructions[open] summary::after {
  transform: rotate(90deg);
}

.chat-instructions svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.chat-instructions p {
  margin: 8px 0 0 21px;
  color: var(--cp-text-muted);
  font-size: 0.68rem;
}

.chat-sources {
  margin-top: 12px;
  color: var(--cp-text-muted);
  font-size: 0.66rem;
}

.chat-sources summary {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  list-style: none;
}

.chat-sources summary::-webkit-details-marker {
  display: none;
}

.chat-sources summary::after {
  content: "›";
}

.chat-sources[open] summary::after {
  transform: rotate(90deg);
}

.chat-source-list {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.chat-source-item {
  justify-self: start;
}

.chat-web-source {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--cp-border);
  border-radius: 3px;
  padding: 3px 6px 3px 3px;
  background: var(--cp-surface-soft);
  color: var(--cp-text-soft);
  text-decoration: none;
}

.chat-web-source:hover,
.chat-web-source:focus-visible {
  border-color: var(--cp-border-strong);
  background: var(--cp-surface);
  color: var(--cp-text);
}

.chat-web-source svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--cp-link);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-web-source > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--cp-border);
  padding: 8px;
  background: var(--cp-surface);
}

.chat-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chat-composer {
  overflow: hidden;
  border: 1px solid var(--cp-border-strong);
  border-radius: 4px;
  background: var(--cp-bg-elevated);
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 54px;
  max-height: 160px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--cp-text);
  padding: 9px 10px 4px;
}

.chat-form textarea:focus {
  box-shadow: inset 0 0 0 1px var(--cp-border-strong);
}

.chat-form textarea:disabled {
  opacity: 0.65;
}

.chat-form-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 6px;
}

.chat-status {
  flex: 1;
  color: var(--cp-text-muted);
  font-size: 0.65rem;
}

.chat-action {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  appearance: none;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--cp-text-muted);
  padding: 0;
  cursor: pointer;
}

.chat-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat-action.secondary {
  border: 1px solid var(--cp-border);
}

.chat-action.send {
  color: var(--cp-link);
}

.chat-action:hover:not(:disabled) {
  background: var(--code-active);
  color: var(--cp-text);
}

.chat-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.chat-connection {
  color: var(--cp-text-muted);
  font-size: 0.62rem;
  text-align: center;
}

.editor-stage {
  position: absolute;
  inset: 0 var(--python-panel-width) 0 0;
}

.workspace-shell main.python-panel-resizing .editor-stage {
  transition: none;
}

.editor-stage:not(.active) {
  display: none;
}

.workspace-shell main.python-panel-collapsed .editor-stage {
  right: var(--python-panel-collapsed-width);
}

.workspace-shell main.python-panel-hidden .editor-stage,
.data-stage {
  right: 0;
}

.graph-canvas-pane {
  position: relative;
  flex: 1;
  min-width: 0;
}

.python-panel {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: var(--python-panel-width);
  border-left: 1px solid var(--ink);
  background: var(--code-surface);
  overflow: hidden;
}

.python-panel.resizing {
  transition: none;
}

.python-panel[hidden] {
  display: none;
}

.python-panel.collapsed {
  width: var(--python-panel-collapsed-width);
}

.python-panel-resize {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 12px;
  transform: translateX(-50%);
  cursor: col-resize;
  touch-action: none;
}

.python-panel-resize::after {
  position: absolute;
  inset: 0 auto 0 5px;
  width: 1px;
  background: var(--code-line);
  content: "";
}

.python-panel-resize:hover,
.python-panel-resize:focus-visible,
.python-panel-resize.resizing {
  background: var(--code-line);
  outline: none;
}

body.resizing-python-panel {
  cursor: col-resize;
  user-select: none;
}

.python-panel.collapsed .python-panel-resize {
  display: none;
}

.python-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px 0 6px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-surface);
  color: var(--code-text);
  font-size: 13px;
}

.python-panel-toggle {
  display: grid;
  width: 28px;
  height: 32px;
  flex: 0 0 28px;
  place-items: center;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--code-muted);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.python-panel-toggle svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.python-panel-toggle:hover {
  background: var(--code-active);
  color: var(--code-text);
}

.python-panel.collapsed .python-bar {
  justify-content: center;
  gap: 0;
  padding: 0 6px;
}

.python-panel.collapsed .python-bar > :not(.python-panel-toggle),
.python-panel.collapsed .python-generated,
.python-panel.collapsed .python-pane-resize,
.python-panel.collapsed .python-user-label,
.python-panel.collapsed .python-code,
.python-panel.collapsed .python-output {
  display: none;
}

.python-status {
  margin-left: auto;
  color: var(--code-muted);
  font-size: inherit;
  white-space: nowrap;
}

.python-status.error {
  color: var(--warn);
}

.python-generated {
  display: flex;
  min-height: 40px;
  flex: 0 1 29%;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-surface);
}

.python-generated.collapsed {
  min-height: auto;
  flex: 0 0 auto !important;
}

.python-generated-toggle {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  padding: 9px 12px;
  background: var(--code-surface);
  color: var(--code-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.python-generated-toggle:hover {
  background: var(--code-active);
}

.python-generated-toggle span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.python-generated-toggle strong {
  font-size: 15px;
  font-weight: 600;
}

.python-generated-toggle small {
  overflow: hidden;
  color: var(--code-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.python-generated-chevron {
  color: var(--code-muted);
}

.python-generated.collapsed .python-generated-chevron {
  transform: rotate(-90deg);
}

.python-setup-code {
  min-height: 0;
  flex: 1;
  width: 100%;
}

.python-generated.collapsed .python-setup-code {
  display: none;
}

.python-generated.collapsed + .python-pane-resize {
  display: none;
}

.python-pane-resize {
  position: relative;
  z-index: 3;
  height: 7px;
  flex: 0 0 7px;
  border: 0;
  background: var(--code-surface);
  cursor: row-resize;
  touch-action: none;
}

.python-pane-resize::after {
  position: absolute;
  inset: 3px 0 auto;
  height: 1px;
  background: var(--code-line);
  content: "";
}

.python-pane-resize:hover,
.python-pane-resize:focus-visible,
.python-pane-resize.resizing {
  background: var(--code-active);
  outline: none;
}

body.resizing-python-pane {
  cursor: row-resize;
  user-select: none;
}

.python-user-label {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-surface);
  color: var(--code-muted);
  font-size: 15px;
  font-weight: 600;
}

.python-code {
  min-height: 0;
  flex: 0 1 31%;
  width: 100%;
  border-bottom: 1px solid var(--code-line);
}

.python-setup-code .ace_gutter,
.python-code .ace_gutter {
  background: var(--code-surface);
  color: #9a9a9a;
}

.python-setup-code .ace_scroller,
.python-code .ace_scroller {
  background: var(--code-surface);
}

.python-setup-code .ace_active-line,
.python-setup-code .ace_gutter-active-line,
.python-code .ace_active-line,
.python-code .ace_gutter-active-line {
  background: var(--code-active);
}

.python-control {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  appearance: none;
  border: 0;
  border-left: 1px solid var(--code-line);
  background: transparent;
  color: var(--code-text);
  font: inherit;
  cursor: pointer;
}

.python-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.python-control .python-pause-icon {
  display: none;
}

.python-run-control.running .python-play-icon {
  display: none;
}

.python-run-control.running .python-pause-icon {
  display: block;
}

.python-control:hover {
  background: var(--code-active);
}

.python-control:disabled {
  color: var(--code-disabled);
  cursor: not-allowed;
}

.python-output {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--code-output);
  color: var(--code-text);
  font-family: "Titillium Web", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.python-diagnostics {
  flex: 0 0 auto;
  max-height: 35%;
  overflow: auto;
  border-top: 1px solid var(--code-line);
  background: var(--code-surface);
  color: var(--code-muted);
}

.python-diagnostics summary {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.python-diagnostics pre {
  margin: 0;
  padding: 8px 12px 12px;
  overflow: auto;
  color: var(--code-text);
  font: 15px/1.4 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.data-stage {
  background: var(--ink);
  overflow: hidden;
}

.data-stage.active {
  display: flex;
  flex-direction: column;
}

.data-view-tabs {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 1px;
}

.data-view-tabs[hidden] {
  display: none;
}

.data-view-tab {
  appearance: none;
  height: 28px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #9ca8b8;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0 9px;
  cursor: pointer;
}

.data-view-tab:hover {
  background: #151a21;
  color: #e4e9f0;
}

.data-view-tab.active {
  border-bottom-color: #2f81f7;
  background: transparent;
  color: #58a6ff;
}

.data-view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.data-view-panel {
  position: relative;
  flex: 1;
  min-height: 0;
}

.data-view-panel.active {
  display: flex;
  flex-direction: column;
}

.data-object-view {
  overflow: hidden;
  background: var(--code-output);
  color: var(--code-text);
}

.data-object-view.active {
  flex-direction: row;
}

.data-object-sidebar {
  display: flex;
  width: 240px;
  min-width: 220px;
  flex-direction: column;
  border-right: 1px solid var(--code-line);
  background: var(--code-surface);
}

.data-object-header {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--code-line);
}

.data-object-header h2 {
  margin: 0;
  color: var(--code-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.data-object-count {
  min-width: 22px;
  border: 1px solid var(--code-line);
  border-radius: 3px;
  background: var(--code-output);
  color: var(--code-muted);
  font-size: 0.68rem;
  line-height: 18px;
  text-align: center;
}

.data-object-table-list {
  flex: 1;
  margin: 0;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

:where(.data-object-table-list li, .data-object-detail, .data-object-connection-list li) {
  --object-color: var(--cp-text-muted);
}

.data-object-table-list li {
  border-bottom: 1px solid var(--code-line);
  margin: 0;
}

.data-object-table-button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--code-text);
  font: inherit;
  font-size: 0.75rem;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
}

.data-object-table-button:hover {
  background: var(--code-active);
}

.data-object-table-button.active {
  background: var(--code-output);
  font-weight: 600;
}

.data-object-table-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.data-object-table-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 3px;
  background: color-mix(in srgb, var(--object-color) 16%, transparent);
  color: var(--object-color);
}

.data-object-table-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.data-object-carrier {
  --object-color: var(--cp-text-soft);
}

.data-object-bus {
  --object-color: var(--cp-link);
}

.data-object-line {
  --object-color: var(--cp-warning);
}

.data-object-link {
  --object-color: var(--cp-accent);
}

.data-object-generator {
  --object-color: var(--cp-success);
}

.data-object-load {
  --object-color: var(--cp-danger);
}

.data-object-demand {
  --object-color: var(--cp-warning);
}

.data-object-gsp {
  --object-color: var(--cp-link);
}

.data-object-table-list .data-object-empty {
  min-height: 46px;
  color: var(--muted);
  font-weight: 400;
  padding: 14px 16px;
}

.data-object-workspace {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--code-output);
}

.data-object-empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--code-muted);
  text-align: center;
  transform: translate(-50%, -50%);
}

.data-object-empty-state h2 {
  margin: 0 0 8px;
  color: var(--code-text);
  font-size: 1rem;
}

.data-object-empty-state p {
  margin: 0;
  font-size: 0.85rem;
}

.data-object-detail {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.data-object-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.data-object-detail-header .data-object-table-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

.data-object-detail-header .data-object-table-icon svg {
  width: 23px;
  height: 23px;
}

.data-object-detail-type {
  display: block;
  margin-bottom: 2px;
  color: var(--code-muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-object-detail-header h2 {
  margin: 0;
  color: var(--code-text);
  font-size: 1.1rem;
}

.data-object-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.data-object-side-stack {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.data-object-section {
  min-width: 0;
  border: 1px solid var(--code-line);
  border-radius: 4px;
  background: var(--code-surface);
  overflow: hidden;
}

.data-object-section h3 {
  margin: 0;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-surface);
  color: var(--code-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 10px 12px;
}

.data-object-item-list,
.data-object-connection-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.data-object-item-list li,
.data-object-connection-list li {
  border-bottom: 1px solid var(--code-line);
}

.data-object-item-list li:last-child,
.data-object-connection-list li:last-child {
  border-bottom: 0;
}

.data-object-item-button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0 14px;
  color: var(--code-text);
  font: inherit;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.data-object-item-button:hover {
  background: var(--code-active);
}

.data-object-item-button.active {
  background: var(--code-output);
  font-weight: 600;
}

.data-object-item-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.data-object-item-index {
  flex: 0 0 auto;
  width: 24px;
  color: var(--code-muted);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 0.7rem;
  text-align: right;
}

.data-object-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-object-connection-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--code-text);
  font: inherit;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
}

.data-object-connection-button:hover {
  background: var(--code-active);
}

.data-object-connection-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.data-object-connection-copy {
  min-width: 0;
}

.data-object-connection-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
}

.data-object-connection-via {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--code-muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-object-section-empty {
  color: var(--code-muted);
  font-size: 0.75rem;
  padding: 14px;
}

.data-object-item-detail {
  align-self: start;
}

.data-object-field-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(0, 1fr);
  margin: 0;
}

.data-object-field-list dt,
.data-object-field-list dd {
  min-width: 0;
  margin: 0;
  border-bottom: 1px solid var(--code-line);
  padding: 10px 14px;
  font-size: 0.8rem;
}

.data-object-field-input,
.data-preview-cell-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.data-object-field-input {
  padding: 3px 4px;
}

.data-preview-cell-input {
  height: 17px;
  padding: 0 2px;
}

.data-object-field-input:hover,
.data-object-field-input:focus,
.data-preview-cell-input:hover,
.data-preview-cell-input:focus {
  border-color: var(--cp-border-strong);
  background: var(--code-active);
  outline: none;
}

.working-copy-status {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.data-object-field-list dt {
  color: var(--code-muted);
  font-weight: 600;
}

.data-object-field-list dd {
  overflow-wrap: anywhere;
  color: var(--code-text);
  font-family: Consolas, "Courier New", Courier, monospace;
}

.data-object-field-list dt:nth-last-of-type(1),
.data-object-field-list dd:last-child {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .data-object-sidebar {
    width: 220px;
  }

  .data-object-detail-grid {
    grid-template-columns: 1fr;
  }

  .data-object-field-list {
    grid-template-columns: 1fr;
  }

  .data-object-field-list dt {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .data-object-field-list dd {
    padding-top: 2px;
  }
}

.data-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-output);
}

.data-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.data-save-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.data-save-status.error {
  color: var(--warn);
}

.data-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-color: var(--ink);
  background-image:
    linear-gradient(color-mix(in srgb, var(--paper) 8%, transparent) 0.5px, transparent 0.5px),
    linear-gradient(90deg, color-mix(in srgb, var(--paper) 8%, transparent) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

.data-canvas.panning {
  cursor: grabbing;
  user-select: none;
}

.data-canvas .data-table {
  cursor: default;
}

.data-canvas .data-table-header {
  cursor: move;
}

.data-preview {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: min(46vh, 420px);
  border-top: 1px solid var(--paper);
  background: var(--ink);
  box-shadow: 0 -8px 24px var(--ink);
  overflow: hidden;
  transition: height 160ms ease;
}

.data-preview.resizing {
  transition: none;
}

.data-preview-resize-handle {
  position: absolute;
  top: -4px;
  right: 0;
  left: 0;
  z-index: 2;
  height: 8px;
  cursor: ns-resize;
  touch-action: none;
}

.data-preview.collapsed {
  height: 30px;
}

.data-preview-toggle {
  display: flex;
  width: 100%;
  height: 30px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--slate);
  background: var(--ink);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 0 4px;
  cursor: pointer;
}

.data-preview-toggle:hover {
  background: var(--slate);
}

#data-preview-chevron {
  font-size: 1.2rem;
  transition: transform 160ms ease;
}

.data-preview.collapsed #data-preview-chevron {
  transform: rotate(180deg);
}

.data-preview-body {
  display: flex;
  height: calc(100% - 30px);
  min-height: 0;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 120ms ease, visibility 120ms ease;
}

.data-preview.collapsed .data-preview-body {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.data-preview-meta {
  order: 2;
  flex: 0 0 auto;
  min-height: 24px;
  border-top: 1px solid var(--paper);
  background: var(--slate);
  color: var(--text);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 0.72rem;
  padding: 3px 4px;
}

.data-preview-content {
  order: 1;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--paper);
  padding: 0;
}

.data-preview-table {
  width: 1494px;
  min-width: 1494px;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--paper);
  color: var(--ink);
  font-family: Calibri, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  white-space: nowrap;
}

.data-preview-table th,
.data-preview-table td {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 18px;
  border-right: 0.5px solid color-mix(in srgb, var(--paper) 85%, var(--slate));
  border-bottom: 0.5px solid color-mix(in srgb, var(--paper) 85%, var(--slate));
  padding: 0 3px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.data-preview-table th {
  position: sticky;
  background: var(--slate);
  color: var(--text);
  font-weight: 600;
  z-index: 2;
}

.data-preview-fields th {
  top: 0;
}

.data-preview-fields th:not(.data-preview-row-number) {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.data-preview-table .data-preview-row-number {
  left: 0;
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  padding: 0 3px;
  text-align: right;
  z-index: 3;
}

.data-preview-fields .data-preview-row-number {
  top: 0;
  z-index: 4;
}

.data-preview-table td {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.data-preview-table tbody tr:hover td {
  background: var(--cp-highlight);
}

.data-preview-empty,
.data-preview-error {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
  padding: 16px 18px;
}

.data-preview-error {
  color: var(--warn);
}

.data-table.preview-selected {
  border-color: var(--accent);
}

#data-scroll-content {
  position: absolute;
  inset: 0;
  overflow: visible;
}

#data-viewport {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform-origin: top left;
}

#data-links {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

#data-tables {
  position: relative;
  width: 1px;
  height: 1px;
}

.data-link {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
}

.data-link-end {
  fill: var(--paper);
}

.data-table {
  position: absolute;
  width: 260px;
  border: 1px solid var(--paper);
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 8px 24px var(--ink);
  overflow: hidden;
}

.data-table.connect-target {
  border-color: var(--accent);
  cursor: crosshair;
}

.data-table-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--slate);
  background: var(--ink);
  cursor: grab;
}

.data-table-header:active {
  cursor: grabbing;
}

.data-table-name,
.data-attribute-name {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.data-table-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.data-table-remove,
.data-attribute-remove,
.data-connector {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.data-attribute .data-attribute-remove,
.data-attribute .data-connector {
  visibility: hidden;
}

.data-attribute.active .data-attribute-remove,
.data-attribute.active .data-connector,
.data-attribute:focus-within .data-attribute-remove,
.data-attribute:focus-within .data-connector {
  visibility: visible;
}

.data-table-remove,
.data-attribute-remove {
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  line-height: 1;
}

.data-table-remove:hover,
.data-attribute-remove:hover {
  color: var(--paper);
}

.data-attributes {
  display: flex;
  flex-direction: column;
}

.data-attribute {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--slate);
}

.data-attribute-name {
  flex: 1;
  font-size: 0.85rem;
}

.data-connector {
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  font-size: 0;
}

.data-connector:hover,
.data-connector.connected,
.data-connector.pending {
  border-color: var(--paper);
  background: var(--paper);
}

.data-add-attribute {
  appearance: none;
  width: 100%;
  border: 0;
  background: var(--ink);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
}

.data-add-attribute:hover {
  color: var(--paper);
  background: var(--slate);
}

.editor-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#canvas {
  background: var(--slate);
}

.editor-canvas.select-mode {
  cursor: default;
}

#map {
  position: absolute;
  inset: 0;
  background: var(--map-background);
}

.network-tile-overlay {
  position: absolute;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
}

.network-tile-overlay[hidden] {
  display: none;
}

.network-tile-overlay img {
  position: absolute;
  max-width: none;
  user-select: none;
}

.network-canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 300;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.network-canvas-overlay[hidden] {
  display: none;
}

#map .maplibregl-ctrl-attrib {
  display: none;
}

#map-stage.map-background-hidden {
  background: var(--map-background);
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

.map-visibility-control {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 450;
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 8px;
  place-items: center;
  border: 1px solid var(--cp-border);
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 45%, transparent);
}

.map-visibility-control.active {
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
}

.map-visibility-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-node-size-control {
  position: absolute;
  right: 12px;
  bottom: 60px;
  z-index: 450;
  width: 18px;
  height: 118px;
}

.map-node-size-control input {
  width: 18px;
  height: 118px;
  margin: 0;
  accent-color: var(--paper);
  direction: rtl;
  writing-mode: vertical-lr;
}

.map-energy-legend {
  position: absolute;
  top: 12px;
  right: auto;
  left: calc(var(--chat-panel-width) + 12px);
  z-index: 450;
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 4px 10px;
  width: 220px;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
  padding: 9px;
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--ink) 45%, transparent);
  font-size: 0.64rem;
}

#workspace-shell:has(.chat-panel.collapsed) .map-energy-legend {
  left: 52px;
}

#workspace-shell:has(.chat-panel[hidden]) .map-energy-legend {
  left: 12px;
}

.map-energy-legend[hidden] {
  display: none;
}

.map-energy-legend strong {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-size: 0.7rem;
}

.map-energy-legend .map-energy-legend-section {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--cp-border);
}

.map-energy-legend span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.map-energy-legend i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 1px solid color-mix(in srgb, var(--paper) 55%, transparent);
  border-radius: 50%;
  background: var(--legend-color);
}

.map-energy-legend i.gsp {
  border-color: var(--ink);
  background: var(--paper);
}

.map-energy-legend i.line {
  width: 14px;
  height: 0;
  flex-basis: 14px;
  border: 0;
  border-top: 3px solid var(--legend-color);
  border-radius: 999px;
  background: none;
}

.map-feature-popup {
  display: grid;
  gap: 3px;
  color: #111827;
  font: 12px/1.35 "Segoe UI", sans-serif;
}

.map-feature-popup strong {
  margin-bottom: 2px;
  font-size: 13px;
}

.network-totals {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 450;
  display: grid;
  box-sizing: border-box;
  width: 220px;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 45%, transparent);
  color: var(--cp-text);
  font-family: "Titillium Web", sans-serif;
  pointer-events: none;
}

.network-totals[hidden] {
  display: none;
}

.network-totals div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 9px;
}

.network-totals div + div {
  border-top: 1px solid var(--cp-border);
}

.network-totals span {
  color: var(--cp-text);
  font-size: 13px;
}

.network-totals strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.map-canvas.editing {
  pointer-events: auto;
}

.map-canvas .node,
.map-canvas .edge {
  pointer-events: auto;
}

.map-canvas .node {
  cursor: pointer;
}

.map-canvas.edit-enabled .node {
  cursor: move;
}

.map-canvas .node .node-symbol {
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 2.5;
}

.map-canvas .edge-node-flow {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.map-canvas .edge-label-bg {
  stroke: var(--paper);
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl button {
  font-family: "Titillium Web", sans-serif;
}

.node circle {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px var(--ink));
}

.node.selected circle {
  stroke: var(--hot);
  stroke-width: 4;
  filter: drop-shadow(0 0 10px var(--ink));
}

.node.pending circle {
  stroke: var(--ink);
  stroke-dasharray: 5 3;
}

.node text {
  fill: var(--paper);
  font-size: 13px;
  font-family: "Titillium Web", sans-serif;
  paint-order: stroke;
  pointer-events: none;
  stroke: var(--ink);
  stroke-width: 3px;
  text-anchor: middle;
  dominant-baseline: middle;
  transform: translateY(-18px);
  user-select: none;
}

.node.label-hidden text {
  display: none;
}

.node.label-hidden:hover text,
.node.label-hidden.selected text {
  display: block;
}

.map-canvas.network-canvas-active {
  pointer-events: none;
}

.map-canvas.network-canvas-active.edit-enabled {
  pointer-events: auto;
}

.map-canvas.network-canvas-active #map-edges,
.map-canvas.network-canvas-active #map-nodes {
  display: none;
}

.edge path {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2.5;
  pointer-events: stroke;
}

.edge-arrow path {
  fill: var(--paper);
}

.connection-preview {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  pointer-events: none;
}

.edge.selected path {
  stroke: var(--paper);
  stroke-width: 3.5;
  stroke-dasharray: 7 4;
}

.edge-hit {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0;
  stroke-width: 14;
  pointer-events: stroke;
  cursor: pointer;
}

.edge-label {
  fill: var(--text);
  font-size: 12px;
  font-family: "Titillium Web", sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.edge-label-bg {
  fill: var(--slate);
  stroke: var(--ink);
  stroke-width: 1;
  rx: 4;
  pointer-events: none;
}

.node-popup {
  position: fixed;
  width: 220px;
  max-height: calc(100vh - 16px);
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--slate);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 7px;
  z-index: 1000;
  box-shadow: 0 12px 40px var(--ink);
}

.node-popup.hidden {
  display: none;
}

.node-object-popup {
  z-index: 1001;
}

.line-popup {
  z-index: 1001;
}

.line-popup-properties {
  display: grid;
  gap: 8px;
}

.line-popup-object {
  padding-top: 6px;
  border-top: 1px solid var(--accent);
}

.line-popup-object:first-child {
  padding-top: 0;
  border-top: 0;
}

.line-popup-object h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.72rem;
}

.node-popup-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.node-title {
  min-width: 0;
  flex: 1;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 4px;
}

.node-title:hover,
.node-title:focus {
  border-color: var(--accent);
  outline: none;
}

.node-title[readonly] {
  cursor: default;
}

.node-title[readonly]:hover,
.node-title[readonly]:focus {
  border-color: transparent;
}

.node-popup-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
}

.node-object-title {
  min-width: 0;
  flex: 1;
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.2;
}

.node-object-property-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--ink);
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  text-align: right;
  padding: 2px 3px;
}

.node-object-property-input:focus {
  outline: 1px solid var(--accent);
}

.node-object-popup-actions {
  justify-content: flex-end;
}

.node-properties {
  margin: 0 0 5px;
}

.node-properties div {
  display: grid;
  grid-template-columns: 55px 1fr;
  gap: 4px;
  padding: 3px 1px;
  border-bottom: 1px solid var(--ink);
}

.node-properties [hidden] {
  display: none;
}

.node-properties dt {
  color: var(--muted);
  font-size: 0.63rem;
}

.node-properties dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-property-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.node-property-list li {
  padding-bottom: 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink), transparent 45%);
}

.node-property-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.node-property-item-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
  padding: 0;
  cursor: pointer;
}

.node-property-item-toggle::before {
  content: "\25b8";
  display: inline-block;
  margin-right: 3px;
}

.node-popup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2px;
}

.node-popup-action {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  appearance: none;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--slate);
  color: var(--text);
  padding: 3px;
  cursor: pointer;
}

.node-popup-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-popup-action:hover {
  background: var(--ink);
}

.node-popup-action:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.node-popup-action:disabled:hover {
  background: var(--slate);
}

.node-popup-delete {
  border-color: var(--warn);
}

.label-editor {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--slate);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  z-index: 1200;
  box-shadow: 0 12px 40px var(--ink);
}

.label-editor.hidden {
  display: none;
}

.label-editor label {
  font-size: 0.85rem;
  color: var(--muted);
}

.label-editor input {
  background: var(--slate);
  border: 1px solid var(--ink);
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
  border-radius: 3px;
}

.tool.map-filter-toggle {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  padding: 1px;
  border: 0;
  background: transparent;
  color: var(--paper);
  box-shadow: none;
}

#map-stage.filter-panel-collapsed .tool.visualization-filter-toggle,
#map-stage.operator-panel-collapsed .tool.operator-filter-toggle {
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid var(--cp-border);
  background: color-mix(in srgb, var(--cp-bg-elevated) 92%, transparent);
  color: var(--cp-text);
}

.icon-tool {
  box-sizing: border-box;
  display: inline-grid;
  width: 36px;
  height: 34px;
  padding: 7px;
  place-items: center;
}

.icon-tool[hidden],
.map-filter-toggle[hidden] {
  display: none;
}

.icon-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

#label2-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#label2-row.hidden {
  display: none;
}

.label-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.label-actions button {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--slate);
  color: var(--text);
  font: inherit;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
}
