body {
  background: #2d2d2d;
  color: #fff;
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

h1 {
  margin: 16px;
}

#controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px;
}

button {
  background: #444;
  color: #fff;
  padding: 0.5em 1em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background: #666;
}

/* === Modal Overlay === */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* === Modal Dialog === */
.modal-content {
  background: #2d2d2d;
  color: #fff;
  padding: 20px;
  width: 50%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.modal-content h2 {
  margin-top: 0;
  font-size: 1.3em;
}

.modal-list {
  flex: 1;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px;
  background: #1f1f1f;
}

.modal-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modal-list li {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.modal-list li:hover {
  background: #444;
}
.modal-list li.selected {
  background: #555;
}

/* === Buttons inside modal === */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-buttons button {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
}
.modal-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.modal-buttons #modal-cancel {
  background: #555;
}
.modal-buttons #modal-cancel:hover {
  background: #666;
}