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

body {
  font-family: 'Malgun Gothic', 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 14px 0;
  margin-bottom: 14px;
  border-bottom: 2px solid #ddd;
}

header h1 {
  font-size: 22px;
  color: #1a1a2e;
  letter-spacing: 1px;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: opacity 0.15s;
  display: inline-block;
  color: #fff;
}

.btn:hover:not(:disabled) { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-green  { background: #4CAF50; }
.btn-blue   { background: #2196F3; }
.btn-orange { background: #FF9800; }
.btn-red    { background: #f44336; }
.btn-gray   { background: #607D8B; }
.btn-purple { background: #9C27B0; }

/* Canvas wrapper */
.canvas-wrapper {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  overflow: auto;
}

#placeholder {
  color: #aaa;
  font-size: 16px;
  position: absolute;
}

#mainCanvas {
  border: 1px solid #e0e0e0;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 100;
}

.loading-overlay.hidden { display: none; }

.loading-overlay p {
  margin-top: 12px;
  font-size: 15px;
  color: #444;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #e0e0e0;
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Status bar */
.status-bar {
  margin-top: 10px;
  padding: 8px 16px;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Print */
@media print {
  .toolbar, .status-bar, header { display: none; }
  .canvas-wrapper { box-shadow: none; padding: 0; }
}
