* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: #101014;
  color: #ececf1;
}
.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
}
.panel {
  background: #17171f;
  border: 1px solid #2a2a36;
  border-radius: 14px;
  padding: 18px;
  align-self: start;
}
.panel h1 { margin: 0 0 6px; font-size: 1.55rem; }
.intro { color: #aaaab6; margin: 0 0 8px; line-height: 1.45; }
.panel h2 { font-size: 1rem; margin: 20px 0 8px; color: #d8d8e2; }
label { display: block; color: #bcbcc8; font-size: 0.9rem; margin: 7px 0; }
input, select {
  width: 100%; margin-top: 4px; background: #22222d; color: #fff;
  border: 1px solid #3a3a49; border-radius: 7px; padding: 7px;
}
input[type="color"] { height: 36px; padding: 2px; }
input[type="range"] { padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.btnRow { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
button, .fileBtn {
  background: #242431; color: #f0f0f5; border: 1px solid #3c3c4d;
  border-radius: 8px; padding: 8px 11px; cursor: pointer; font-size: 0.9rem;
}
button:hover, .fileBtn:hover { border-color: #7c5cff; }
.fileBtn { display: inline-block; text-align: center; }
.fileBtn input { display: none; }
.smallBtn { margin: 0; }
.ghost { width: 100%; margin-top: 4px; }
.danger:hover { border-color: #ff5d5d; color: #ff8080; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }
.layers { display: flex; flex-direction: column; gap: 5px; }
.layer {
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.layer.active { border-color: #7c5cff; background: #2d2447; }
.export {
  width: 100%; margin-top: 22px; background: #7c5cff; border-color: #7c5cff;
  font-weight: 700; padding: 11px;
}
.status { min-height: 1.2em; color: #aaaab6; }
.stageArea { min-width: 0; }
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #222;
  box-shadow: 0 18px 50px rgba(0,0,0,0.4);
  user-select: none;
  touch-action: none;
}
.el {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: grab;
  overflow: hidden;
}
.el.selected { outline: 2px solid #fff; outline-offset: 2px; }
.el:active { cursor: grabbing; }
.hint { color: #858593; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
}
