* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

/* Language Selector */
.lang-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-selector button {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}
.lang-selector button.active {
  color: #7c3aed;
}
.lang-selector .divider {
  color: #eee;
  font-size: 12px;
}

.container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}
h1 {
  font-size: 22px;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}
.subtitle {
  color: #888;
  font-size: 13px;
  text-align: center;
  margin-bottom: 30px;
}
.spec-box {
  background: #f8f4ff;
  border: 1px solid #d4b8ff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.spec-box h3 { color: #7c3aed; font-size: 13px; margin-bottom: 12px; }
.preset-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.preset-btn {
  padding: 6px 14px;
  border: 1.5px solid #d4b8ff;
  border-radius: 20px;
  background: white;
  color: #7c3aed;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.preset-btn:hover { background: #ede9ff; border-color: #7c3aed; }
.preset-btn.active { background: #7c3aed; color: white; border-color: #7c3aed; }

.custom-size-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.custom-inputs { display: flex; align-items: center; gap: 6px; }
.custom-inputs input {
  width: 80px;
  padding: 7px 10px;
  border: 1.5px solid #d4b8ff;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  outline: none;
  transition: border-color 0.15s;
}
.custom-inputs input:focus { border-color: #7c3aed; }
.x-label, .px-label { color: #888; font-size: 13px; }
.apply-btn {
  padding: 7px 14px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.apply-btn:hover { background: #6d28d9; }
.apply-btn:disabled { background: #c4b5fd; cursor: not-allowed; }
.current-size-info { font-size: 13px; color: #555; }
.current-size-info strong { color: #7c3aed; }

.drop-zone {
  border: 2px dashed #c4b5fd;
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #faf8ff;
  margin-bottom: 20px;
}
.drop-zone:hover { border-color: #7c3aed; background: #f3f0ff; }
.drop-zone.dragover { border-color: #7c3aed; background: #ede9ff; }
.drop-zone p { color: #888; font-size: 14px; margin-top: 10px; }
.drop-zone .icon { font-size: 48px; }

input[type="file"] { display: none; }

.preview-area {
  display: none;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.preview-area.show { display: flex; flex-wrap: wrap; }
.preview-box {
  flex: 1;
  min-width: 200px;
  text-align: center;
}
.preview-box label { font-size: 12px; color: #888; display: block; margin-bottom: 8px; }
.preview-box canvas, .preview-box img {
  border-radius: 12px;
  border: 1px solid #eee;
  max-width: 100%;
}
.checker {
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  display: inline-block;
  border-radius: 12px;
}

.info-bar {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #166534;
  margin-bottom: 20px;
  display: none;
}
.info-bar.show { display: block; }
.info-bar.warn { background: #fefce8; border-color: #fde047; color: #854d0e; }

.btn-group { display: flex; gap: 12px; }
.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #9333ea, #6366f1);
  color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(147,51,234,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: #f3f4f6;
  color: #555;
}
.btn-secondary:hover { background: #e5e7eb; }
