* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05070c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8ebf0;
}

#app {
  display: flex;
  height: 100vh;
}

#canvas-wrap {
  flex: 1;
  position: relative;
  background: #05070c;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

#panel {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px 18px;
  background: rgba(20, 23, 30, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

#panel h1 {
  margin: 0 0 11px;
  font-size: 15px;
  font-weight: 600;
}

#panel p.subtitle {
  margin: 0 0 14px;
  font-size: 12px;
  color: #9aa2b1;
  line-height: 1.4;
}

.section-title {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7fd6ff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0 10px;
  padding-top: 12px;
}

/*.section-title:first-of-type {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}*/

.control {
  margin-bottom: 14px;
}

.control:last-child {
  margin-bottom: 0;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
  color: #cdd3de;
}

.control-label .value {
  font-variant-numeric: tabular-nums;
  color: #7fd6ff;
}

.control-label .value-input {
  width: 58px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #7fd6ff;
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 2px 6px;
  outline: none;
}

.control-label .value-input:focus {
  border-color: rgba(77, 163, 255, 0.6);
}

.control-label .value-input.wide {
  width: 90px;
}

.coord-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #7fd6ff;
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 6px 8px;
  outline: none;
}

.coord-input:focus {
  border-color: rgba(77, 163, 255, 0.6);
}

.coord-input.invalid {
  border-color: rgba(255, 90, 90, 0.7);
  color: #ff9c9c;
}

.control input[type="range"] {
  width: 100%;
  accent-color: #4da3ff;
}

.control-hint {
  margin: 3px 0 0;
  font-size: 11px;
  color: #6c7282;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #cdd3de;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

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

.button-row button {
  min-width: 55px;
}

.button-row button {
  flex: 1;
  padding: 7px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  color: #e8ebf0;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button-row button:hover {
  background: rgba(77, 163, 255, 0.18);
  border-color: rgba(77, 163, 255, 0.5);
}

.button-row button:active {
  background: rgba(77, 163, 255, 0.32);
}
