html, body {
  margin: 0;
  padding: 0;
}
canvas {
  display: block;
}

.nebula-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px 14px 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(28, 24, 18, 0.96), rgba(12, 14, 20, 0.94));
  color: #e8d9a8;
  font: 13px/1.35 Georgia, "Times New Roman", serif;
  border: 1px solid rgba(196, 160, 80, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 220, 140, 0.06);
  backdrop-filter: blur(6px);
}

.nebula-panel__section-title {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4a050;
}

.nebula-panel[hidden] {
  display: none !important;
}

.nebula-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.nebula-panel__header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.nebula-panel__close {
  border: 0;
  background: transparent;
  color: #e8eef8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.nebula-panel__hint {
  margin: 0 0 10px;
  opacity: 0.7;
  font-size: 12px;
}

.nebula-panel__hint kbd {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
}

.nebula-panel__section {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.nebula-panel label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: baseline;
}

.nebula-panel label input {
  grid-column: 1 / -1;
}

.nebula-panel__name {
  line-height: 1.3;
}

.nebula-panel label > span:not(.nebula-panel__name) {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nebula-panel__hint-inline {
  opacity: 0.55;
  font-weight: 400;
}

.nebula-panel input[type="range"] {
  width: 100%;
}

.nebula-panel input[type="color"] {
  width: 100%;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.nebula-panel__actions {
  display: grid;
  gap: 8px;
}

.nebula-panel__btn {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #3a6ea5;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.nebula-panel__btn:hover {
  background: #4a7fb8;
}

.nebula-panel__btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eef8;
}

.nebula-panel__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nebula-panel__status {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.8;
}

.sheet-panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 21;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px 14px 16px;
  border-radius: 10px;
  background: rgba(12, 16, 28, 0.94);
  color: #e8eef8;
  font: 13px/1.35 system-ui, sans-serif;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.sheet-panel[hidden] {
  display: none !important;
}

.sheet-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sheet-panel__header h2 {
  margin: 0;
  font-size: 15px;
}

.sheet-panel__close {
  border: 0;
  background: transparent;
  color: #e8eef8;
  font-size: 22px;
  cursor: pointer;
}

.sheet-panel__hint {
  margin: 6px 0 10px;
  opacity: 0.7;
  font-size: 12px;
}

.sheet-panel__hint kbd {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
}

.sheet-panel__field {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
}

.sheet-panel__field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #e8eef8;
  padding: 6px 8px;
  font: inherit;
}

.sheet-panel__actions {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.sheet-panel__btn {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #3a6ea5;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.sheet-panel__btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #e8eef8;
}

.sheet-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 40vh;
  overflow: auto;
}

.sheet-group {
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.sheet-group span {
  opacity: 0.65;
  font-size: 11px;
}

.sheet-group.is-selected {
  outline: 1px solid rgba(255, 210, 120, 0.7);
  background: rgba(255, 210, 120, 0.12);
}

.sheet-group.is-bound {
  border-left: 3px solid #6bcf7f;
}

.sheet-panel__status {
  margin: 8px 0 0;
  font-size: 11px;
  opacity: 0.85;
  white-space: pre-wrap;
}
