:root {
  --left-rail-width: 169px;
  --left-rail-reserved: 240px;
  --left-rail-gap: 16px;
}

html,
body {
  margin: 0;
  padding: 0;
}

#mainContainer {
  display: flex;
  align-items: flex-start;
  padding: 20px 24px 24px 15px;
  box-sizing: border-box;
}

.left-rail {
  width: var(--left-rail-width);
  flex-shrink: 0;
}

.stage-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 40px);
  overflow: visible;
  box-sizing: border-box;
  padding: 30px;
}

#stage {
  position: relative;
  overflow: visible;
  margin: 0;
}

.left-rail {
  width: var(--left-rail-width);
  flex-shrink: 0;
}

.upload-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

#status {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;

  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: sans-serif;
  color: #111;
}

.sidebar-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-panel {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: sans-serif;
  font-size: 14px;
}

.controls-panel h2,
.controls-panel h3 {
  margin: 0 0 10px 0;
}

.controls-panel label {
  display: block;
  margin-bottom: 8px;
}

.controls-panel input[type="number"],
.controls-panel input[type="color"] {
  display: block;
  margin-top: 4px;
  width: 50%;
}

.control-section {
  margin-bottom: 12px;
}

.control-section-content {
  font-size: 10px;
  margin-top: 10px;
}

.controls-header {
  margin-bottom: 10px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-buttons button {
  width: 100%;
}

.btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: sans-serif;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
}

label.btn {
  display: block;
}

.btn-primary {
  background: #111;
  color: #fff;
  border-color: #333;
}

.btn-primary:hover {
  background: #222;
}

.btn-secondary {
  background: #e9e9e9;
  color: #111;
  border-color: #ccc;
}

.btn-secondary:hover {
  background: #ddd;
}

.btn:disabled {
  background: #ccc;
  color: #777;
  border-color: #bbb;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn:active {
  transform: scale(0.98);
}