*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #1a1a1a; min-height: 100vh; }

.app { max-width: 1280px; margin: 0 auto; padding: 24px; }
.header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.header-icon { width: 42px; height: 42px; background: #111; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; }
.header h1 { font-size: 22px; font-weight: 700; }
.header p { font-size: 13px; color: #888; margin-top: 2px; }

.layout { display: grid; grid-template-columns: 370px 1fr; gap: 24px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.card { background: white; border-radius: 16px; border: 1px solid #e5e5e5; overflow: hidden; }
.card-body { padding: 20px; }
.card-body + .card-body { border-top: 1px solid #f0f0f0; }

.step-label { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.step-num { width: 24px; height: 24px; background: #111; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

.upload-zone { border: 2px dashed #d0d0d0; border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.15s; position: relative; }
.upload-zone:hover { border-color: #999; background: #fafafa; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .icon { font-size: 22px; color: #aaa; }
.upload-zone .label { font-size: 14px; font-weight: 500; }
.upload-zone .sub { font-size: 12px; color: #aaa; }

.info-bar { background: #f5f5f5; border-radius: 10px; padding: 10px 14px; font-size: 12px; display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.info-bar .badge { background: #e0e0e0; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; margin-left: auto; }

.contour-picker { margin-top: 12px; }
.contour-option { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid #e5e5e5; border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; font-size: 13px; }
.contour-option:hover { border-color: #aaa; background: #fafafa; }
.contour-option.selected { border-color: #111; background: #f8f8f8; }
.contour-option.inner { border-left: 4px solid #10b981; }
.contour-option.outer { border-left: 4px solid #6366f1; }
.contour-option .co-name { font-weight: 600; }
.contour-option .co-size { color: #888; font-size: 12px; }

.slider-group { margin-bottom: 16px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.slider-header label { font-size: 13px; color: #555; }
.slider-header .val { font-size: 12px; font-family: 'SF Mono', Monaco, monospace; background: #f0f0f0; padding: 2px 8px; border-radius: 6px; }
input[type="range"] { width: 100%; height: 6px; -webkit-appearance: none; background: #e5e5e5; border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: #111; border-radius: 50%; cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: #111; border-radius: 50%; cursor: pointer; border: none; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.btn { padding: 10px 14px; border-radius: 10px; border: 1px solid #ddd; background: white; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.12s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: #f5f5f5; border-color: #bbb; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: #111; color: white; border-color: #111; }
.btn.primary:hover { background: #333; }
.btn.primary:disabled { background: #888; border-color: #888; }
.btn.active { background: #111; color: white; border-color: #111; }
.btn-full { grid-column: 1 / -1; }

.status { border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-top: 8px; border: 1px solid; }
.status.info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.status.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.status.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.status.loading { background: #fefce8; color: #854d0e; border-color: #fde68a; }

.preview-card { display: flex; flex-direction: column; }
.preview-header { padding: 18px 20px 8px; }
.preview-header h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.preview-header p { font-size: 12px; color: #999; margin-top: 4px; }
.preview-wrap { padding: 0 20px 20px; flex: 1; }
.preview-frame { border: 2px solid #e5e5e5; border-radius: 14px; overflow: hidden; background: white; }
.preview-frame svg { display: block; width: 100%; aspect-ratio: 1; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.sidebar { display: flex; flex-direction: column; gap: 16px; }
