html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #111827;
  background: #0b1020;
}

#crystalCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  pointer-events: none;
}

#controls {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.control-row {
  display: flex;
  gap: 8px;
}

.control-group.small {
  flex: 1 1 0;
}

label {
  font-size: 12px;
  color: #111827;
}

input[type="range"] {
  width: 100%;
}

textarea {
  width: 100%;
  resize: vertical;
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#status_text {
  font-size: 12px;
  color: #374151;
}

button {
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

button:hover {
  background: #111827;
}

#calibration_overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.calibration_panel {
  width: min(640px, 96vw);
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.calib_header { font-weight: 600; margin-bottom: 8px; }
.calib_body { display: flex; flex-direction: column; gap: 10px; }
.calib_text { margin: 0; font-size: 14px; }
.calib_actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.calib_bar_wrap { height: 24px; display: flex; align-items: center; }
#calibration_bar { height: 6px; background: #1f2937; border-radius: 4px; width: 378px; }
#calibration_info { font-size: 12px; color: #374151; }


