* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans KR", Arial, sans-serif;
}
header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 {
  font-size: 18px;
  margin: 0;
}
code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}
.config {
  font-size: 12px;
  color: #4b5563;
  display: flex;
  gap: 12px;
}

main.single-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  height: calc(100vh - 57px);
}

form#uploadForm {
  display: flex;
  gap: 8px;
  align-items: center;
}
.file-label {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
}
.file-label input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
button {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background: #f9fafb;
}

.status {
  font-size: 12px;
  color: #e5e7eb;
  min-height: 18px;
}

.canvas-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
}
canvas#editorCanvas {
  display: block;
  z-index: 0;
}

.dropzone {
  position: absolute;
  inset: 15px;
  border: 2px dashed #3b82f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  z-index: 1;
}
.dropzone.hidden {
  display: none;
}
.dropzone.dragover {
  background: rgba(59, 130, 246, 0.1);
}
.dropzone-hint {
  pointer-events: none;
  font-size: 14px;
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #111827;
  border-top: 1px solid #374151;
}
.control-bar .right-actions button {
  margin-left: 8px;
}

.rectify-panel h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
}
.rectify-panel button {
  margin-right: 6px;
}
.preview-wrap {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
#rectifiedPreview {
  max-width: 80%;
  max-height: 40vh;
  border: 1px solid #374151;
  background: #0b1220;
}
