.nd-container {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: row;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.nd-sidebar {
  width: 220px;
  min-width: 220px;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.nd-sidebar-header {
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.nd-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.nd-route-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 8px;
  cursor: pointer;
}
.nd-route-select:focus {
  border-color: #3b82f6;
  background: #ffffff;
}
.nd-search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  outline: none;
  box-sizing: border-box;
}
.nd-search-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
}
.nd-search-input::placeholder {
  color: #9ca3af;
}
.nd-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.nd-sidebar-list::-webkit-scrollbar {
  width: 5px;
}
.nd-sidebar-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.nd-pad-row {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  user-select: none;
}
.nd-pad-row:hover {
  background: #f3f4f6;
}
.nd-pad-row.active {
  background: #dbeafe;
}
.nd-pad-chevron {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  transition: transform 0.15s;
  flex-shrink: 0;
  color: #9ca3af;
}
.nd-pad-chevron.expanded {
  transform: rotate(90deg);
}
.nd-pad-chevron.hidden {
  visibility: hidden;
}
.nd-pad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.nd-pad-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-pad-count {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  margin-left: 6px;
}
.nd-well-list {
  display: none;
}
.nd-well-list.expanded {
  display: block;
}
.nd-well-row {
  display: flex;
  align-items: center;
  padding: 4px 10px 4px 32px;
  cursor: pointer;
  font-size: 12px;
  color: #4b5563;
}
.nd-well-row:hover {
  background: #eff6ff;
}
.nd-well-row.active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 500;
}
.nd-well-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.nd-well-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-well-badge {
  font-size: 10px;
  color: #9ca3af;
  margin-left: 4px;
}
.nd-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 12px 4px;
}
.nd-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.nd-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.nd-svg.grabbing {
  cursor: grabbing;
}
.nd-svg.mode-box-select {
  cursor: crosshair;
}
.nd-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}
.nd-control-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  color: #495057;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.15s, transform 0.1s;
}
.nd-control-btn:hover {
  background: #f1f3f5;
  transform: scale(1.05);
}
.nd-control-btn:active {
  transform: scale(0.95);
}
.nd-zoom-label {
  font-size: 11px;
  font-weight: 600;
  color: #495057;
  text-align: center;
  padding: 4px 0;
  user-select: none;
  min-width: 36px;
}
.nd-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}
.nd-ribbon-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  gap: 5px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 6px;
  color: #495057;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.15s;
}
.nd-ribbon-btn:hover {
  background: #f1f3f5;
}
.nd-ribbon-btn.active {
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}
.nd-ribbon-btn.active:hover {
  background: #3a7bd5;
}
.nd-ribbon-btn.snap-off {
  /* Default gray state - inherits base styles */
}
.nd-ribbon-btn.snap-on {
  /* Blue active state - uses .active styles */
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}
.nd-ribbon-btn.snap-on:hover {
  background: #3a7bd5;
}
.nd-ribbon-btn.snap-ready {
  /* Green "ready to align" state */
  background: #10b981;
  color: white;
  border-color: #10b981;
}
.nd-ribbon-btn.snap-ready:hover {
  background: #059669;
}
.nd-ribbon-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  margin: 0 6px;
  vertical-align: middle;
}
.nd-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #6c757d;
}
.nd-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: #dc3545;
  text-align: center;
  padding: 20px;
}
.nd-node {
  cursor: pointer;
  transition: filter 0.15s;
}
.nd-node:hover .nd-node-shape {
  filter: brightness(1.05);
}
.nd-node.selected .nd-node-shape {
  stroke: #4a90e2;
  stroke-width: 2;
}
.nd-node.selected .nd-icon-circle {
  stroke: #4a90e2;
}
.nd-node.dimmed {
  opacity: 0.3;
}
.nd-edge {
  transition: opacity 0.15s;
}
.nd-edge.dimmed {
  opacity: 0.15;
}
.nd-edge.highlighted {
  opacity: 1;
}
.nd-edge-path {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.nd-edge-path.highlighted {
  stroke: #3b82f6;
  stroke-width: 2.5;
}
.nd-item-node {
  cursor: move;
  transition: opacity 0.15s, filter 0.15s;
}
.nd-item-node:active {
  cursor: grabbing;
}
.nd-item-tile-node {
  cursor: default;
}
.nd-item-node.dimmed {
  opacity: 0.3;
}
.nd-meter-node:hover circle:first-child {
  filter: brightness(1.1);
}
.nd-item-tile-node:hover rect:first-child {
  fill: #f3f4f6;
}
.nd-group-summary-node {
  cursor: pointer;
}
.nd-group-summary-node:hover rect:first-child {
  fill: #e5e7eb;
}
.nd-group-summary-node.expanded rect:first-child {
  fill: #e8eaed;
  stroke: #9ca3af;
}
/* Meter color families — source of truth for meter accent colors */
.nd-meter-gas { --nd-accent: #e53935; }
.nd-meter-oil { --nd-accent: #43a047; }
.nd-meter-water { --nd-accent: #1e88e5; }
.nd-meter-check { --nd-accent: #78909c; }

/* Tank/equipment accent colors */
.nd-accent-oil-tank { --nd-accent: #43a047; }
.nd-accent-water-tank { --nd-accent: #1e88e5; }
.nd-accent-frac-tank { --nd-accent: #f9a825; }
.nd-accent-equipment { --nd-accent: #78909c; }

.nd-item-colliding {
  opacity: 0.6;
}
.nd-item-colliding circle:first-child,
.nd-item-colliding rect:first-child {
  stroke: #ef5350 !important;
  stroke-width: 3 !important;
}
.nd-shift-drag-outline {
  fill: none;
  stroke: #4a90e2;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

/* Utility: hide elements (filter, toggle) */
.nd-hidden {
  display: none !important;
}

/* Hover cursor for movable nodes */
.nd-cursor-move {
  cursor: move;
}

/* Sidebar empty state */
.nd-sidebar-empty {
  padding: 20px 12px;
  color: #6b7280;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}

/* Error state children */
.nd-error-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.nd-error-detail {
  font-size: 12px;
  margin-top: 8px;
  color: #6c757d;
}
