* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 13px/1.4 system-ui, -apple-system, sans-serif;
  color: #e6e6ea;
  background: #17171b;
}

body { display: flex; }

#panel {
  width: 270px;
  flex: none;
  overflow-y: auto;
  padding: 16px;
  background: #1f1f25;
  border-right: 1px solid #2c2c34;
}

h1 { margin: 0 0 16px; font-size: 20px; }
h2 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a8a96;
}

section { margin-bottom: 20px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.row > label { flex: none; width: 90px; color: #b9b9c3; }
.row input[type=range] { flex: 1; min-width: 0; }
.row.check { justify-content: flex-start; align-items: flex-start; }
.row.check > label { flex: 1; width: auto; }
.row[hidden] { display: none; }

select, input[type=color], input[type=number] {
  background: #2a2a32;
  color: inherit;
  border: 1px solid #3a3a44;
  border-radius: 6px;
  padding: 4px;
}
input[type=color] { width: 44px; height: 28px; padding: 2px; }
.num { flex: none; width: 54px; font: inherit; }

.btn {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid #3a3a44;
  border-radius: 6px;
  background: #2a2a32;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: #34343e; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { width: 100%; background: #e2447f; border-color: #e2447f; color: #fff; font-weight: 600; }
.btn.primary:hover { background: #f0558f; }
.btn.primary:disabled:hover { background: #e2447f; }
.btn.wide { grid-column: 1 / -1; }
.btn.wide-block { width: 100%; margin-top: 6px; }

.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.buttons.four { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.btn.stacked { margin-top: 6px; }
.buttons.four .btn { padding: 7px 0; }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.tools.one { grid-template-columns: 1fr; }
.area { margin-top: 14px; }
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border: 1px solid #3a3a44;
  border-radius: 6px;
  background: #2a2a32;
  color: #c9c9d1;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.tool:hover { background: #34343e; }
.tool.active { background: #e2447f; border-color: #e2447f; color: #fff; }
.tool kbd { font: 10px ui-monospace, monospace; opacity: .6; }

.hint { margin: 6px 0 10px; color: #8a8a96; font-size: 12px; }
.hint[hidden] { display: none; }

.help ul { margin: 0; padding-left: 16px; color: #a2a2ad; font-size: 12px; }
.help li { margin-bottom: 3px; }
.help b { color: #d6d6dd; font-weight: 600; }

#stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background:
    repeating-conic-gradient(#1c1c21 0 25%, #202026 0 50%) 0 0 / 24px 24px;
  cursor: default;
}
#stage.dragover { outline: 3px dashed #e2447f; outline-offset: -12px; }

#empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6e6e7a;
  font-size: 16px;
}
#empty[hidden] { display: none; }

#canvas {
  position: absolute;
  left: 0;
  top: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  touch-action: none;
}

#status, #toast {
  position: absolute;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(20, 20, 24, .85);
  font-size: 12px;
  pointer-events: none;
}
#status { left: 12px; bottom: 12px; color: #b9b9c3; }
#toast { left: 50%; top: 14px; transform: translateX(-50%); color: #fff; }
#status[hidden], #toast[hidden] { display: none; }
