body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background: #111;
  overflow: hidden;
  color: white;
  height: 100vh;
}

h1 {
  color: white;
  text-align: center;
  margin: 0;
  padding: 8px 0;
  box-sizing: border-box;
}

.main-container {
  display: flex;
  height: calc(100vh - 60px); /* full height minus header */
  gap: 0px;
  padding: 0px 8px;
  box-sizing: border-box;
  overflow: hidden;
}

canvas {
  flex: 3 1 0;
  min-width: 0;
  height: 100%;
  display: block;
  border: 1px solid #333;
  border-radius: 6px;
  background: #181818;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
  box-sizing: border-box;
}

.controls-container {
  flex: 1 1 100px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-gutter: stable both-edges;
}

.controls-inner {
  display: flex;
  gap: 5px;
  flex-direction: column;
  box-sizing: border-box;
}

.controls-container .card,
.controls-container .file-controls {
  width: calc(100% - 8px);
  min-width: 0;
  box-sizing: border-box;
}

.controls-container::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.controls-container::-webkit-scrollbar-track {
  background: #111;
}

.card {
  background: #1e1e1e;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.card h2 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #ccc;
}

.card h3 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: #bbb;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: sans-serif;
}

.toggle input {
  display: none;
}

.slider {
  width: 40px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  transition: background 0.15s;
}

.toggle:hover .slider {
  background: #aaa;
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 0.15s;
}

/* Checked state */
.toggle input:checked + .slider {
  background: #4caf50;
}

.toggle input:checked + .slider::before {
  transform: translateX(20px);
}

.segmented-control {
  display: inline-flex;
  background: #222;
  border-radius: 8px;
  padding: 4px;
  gap: 6px;
}

.segmented-control button {
  border: none;
  background: transparent;
  color: #ccc;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Hover state */
.segmented-control button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Active (selected) state */
.segmented-control button.active {
  background: #4caf50;
  color: #fff;
}

.segmented-control button:active {
  transform: scale(0.97);
}

input[type="text"], select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #222;
  color: #fff;
  outline: none;
  transition: border 0.15s, background 0.15s;
}

input[type="text"]:focus, select:focus {
  border-color: #4caf50;
  background: #2a2a2a;
}

button {
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

button:hover {
  background: #45a049;
  transform: scale(1.03);
}

button:active {
  transform: scale(0.97);
}

.button-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.icon-large {
  width: 20px;
  height: 20px;
}

.icon-text-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

div#settings {
  display: flex;
}

#settings-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.node-clustering {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

.modal-content {
  max-width: 300px;
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}