*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #111;
  color: #e0e0e0;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  overflow-y: auto;
  overflow-x: hidden;
}

.panel {
  padding: 8px;
  border-bottom: 1px solid #333;
}

.panel h2 {
  display: none;
}

.row {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 2px 0;
}

/* Inputs & selects */
select,
input[type="text"],
input[type="number"] {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #e0e0e0;
  border-radius: 4px;
  padding: 3px 6px;
  flex: 1;
  min-width: 0;
}

select:focus,
input[type="text"]:focus {
  outline: 1px solid #4a9eff;
}

/* Range sliders */
input[type="range"] {
  accent-color: #4a9eff;
  flex: 1;
  min-width: 0;
}

/* Color pickers */
input[type="color"] {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  width: 32px;
  height: 24px;
  padding: 1px 2px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Buttons */
button {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #e0e0e0;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.2;
}

button:hover {
  background: #3a3a3a;
}

button:active {
  background: #222;
}

/* Lock button */
#lock-btn {
  font-size: 16px;
  padding: 2px 6px;
}

#lock-btn.locked {
  opacity: 0.4;
}

/* Anim scrub fills the row */
#anim-scrub {
  width: 100%;
}

/* Lights list */
#lights-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.light-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.light-row select {
  width: 90px;
  flex: none;
}

.light-row input[type="range"] {
  width: 60px;
  flex: none;
}

/* Save panel */
#pose-name {
  flex: 1;
}

/* Load file input hidden, label acts as button */
#load-label {
  cursor: pointer;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}

#load-label:hover {
  background: #3a3a3a;
}

#load-input {
  display: none;
}

/* Download buttons */
#download-pose-btn,
#download-all-btn {
  flex: 1;
}

/* Scrollbar styling */
#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-track {
  background: #1a1a1a;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}

/* Active-state toggle buttons */
button.active { outline: 1px solid #4a9eff; }

/* footer */
#arttools-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: #111;
  border-top: 1px solid #333;
  font-size: 12px;
}
#arttools-footer a { color: #888; text-decoration: none; }
#arttools-footer a:hover { color: #e0e0e0; }
#arttools-footer .ks-btn {
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid #e8872a;
  border-radius: 4px;
  color: #e8872a !important;
  font-weight: 600;
}
#arttools-footer .ks-btn:hover { background: #e8872a22; }
