* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  color: #1f2937;
  background: #f3f4f6;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.container {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 18px #00000012;
}

h1 {
  margin-top: 0;
}

label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 650;
}

textarea,
input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

textarea {
  min-height: 190px;
  resize: vertical;
}

.settings {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.settings label {
  margin-top: 8px;
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

button {
  padding: 10px 18px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

#status {
  min-height: 1.5em;
  color: #334155;
}

.canvas-wrap {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
}

canvas {
  display: block;
  width: 100%;
  height: 420px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 13px;
}

.cut-key,
.contour-key {
  display: inline-block;
  width: 18px;
  height: 4px;
  margin-left: 10px;
  background: #2563eb;
}

.contour-key {
  background: #f59e0b;
}

.output {
  min-height: 220px;
}

.warning {
  margin-top: 20px;
  padding: 12px;
  color: #7c2d12;
  background: #fff7ed;
  border-left: 4px solid #f97316;
  border-radius: 4px;
}

@media (max-width: 700px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 16px;
  }

  .settings {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  canvas {
    height: 320px;
  }
}

