:root { --primary: #111827; --primary-hover: #374151; --accent: #2563EB; --bg-main: #F9FAFB; --surface: #FFFFFF; --text-dark: #1F2937; --text-muted: #4B5563; --border: #E5E7EB; --error: #EF4444; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Pretendard', sans-serif; background-color: var(--bg-main); color: var(--text-dark); line-height: 1.6; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.header { display: flex; justify-content: space-between; align-items: center; padding: 16px 40px; background: var(--surface); border-bottom: 1px solid var(--border); }
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--primary); }
.version-badge { background: #eff6ff; color: var(--accent); padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; }

.container { max-width: 1050px; margin: 0 auto; padding: 50px 20px; }
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 { font-size: 2.2rem; font-weight: 800; color: #111827; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero p { color: var(--text-muted); font-size: 1.05rem; }
.highlight-text { font-size: 0.9rem; color: #059669; font-weight: 600; display: inline-block; margin-top: 8px; background: #d1fae5; padding: 4px 10px; border-radius: 4px; }

.tool-section { background: var(--surface); padding: 30px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); border: 1px solid var(--border); margin-bottom: 40px; }

.upload-box { display: block; border: 2px dashed #9ca3af; border-radius: 12px; padding: 60px 20px; text-align: center; background: #f3f4f6; cursor: pointer; transition: all 0.2s ease; outline: none; }
.upload-box:hover, .upload-box.dragover { border-color: var(--accent); background: #eff6ff; }
.upload-box:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; background: #eff6ff; }
.upload-icon { font-size: 3.5rem; margin-bottom: 10px; }
.upload-box h2 { font-size: 1.2rem; color: #374151; margin-bottom: 5px; }
.upload-sub { font-size: 0.95rem; color: #6b7280; }
.error-msg { margin-top: 15px; color: var(--error); font-weight: 600; font-size: 0.95rem; background: #fef2f2; padding: 10px 15px; border-radius: 8px; display: inline-block; }

.image-info-bar { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; padding: 12px 20px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 25px; font-weight: 600; color: #334155; font-size: 0.95rem; flex-wrap: wrap; gap: 10px; }
.btn-text { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 0.9rem; padding: 4px; border-radius: 4px; }
.btn-text:hover { text-decoration: underline; }
.btn-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.workspace-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 850px) { .workspace-grid { grid-template-columns: 1fr; } }

.preview-area { display: flex; flex-direction: column; align-items: center; background: #f1f5f9; border-radius: 12px; padding: 25px; border: 1px solid var(--border); min-height: 350px; }
.scale-wrapper { width: 100%; display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; }
canvas { width: 100%; max-width: 100%; height: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.15); border-radius: 4px; transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.preview-notice { margin-top: 25px; font-size: 0.85rem; color: #6b7280; text-align: center; }

.control-group { margin-bottom: 30px; }
.control-group h3 { font-size: 1.05rem; color: #111827; margin-bottom: 6px; font-weight: 700; }
.help-text { font-size: 0.85rem; color: #6b7280; margin-bottom: 12px; line-height: 1.4; word-break: keep-all; }

.segmented-control { display: flex; background: #e5e7eb; border-radius: 8px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented-control label { flex: 1; text-align: center; min-width: 60px; position: relative; }
.segmented-control span { display: block; padding: 10px 4px; font-size: 0.85rem; font-weight: 600; color: #4b5563; cursor: pointer; border-radius: 6px; transition: 0.2s; white-space: nowrap; }
.segmented-control span:hover { background: #d1d5db; }
.segmented-control input[type="radio"]:checked + span { background: var(--surface); color: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.segmented-control input[type="radio"]:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.btn-primary { width: 100%; padding: 16px; border-radius: 10px; background: var(--primary); color: white; font-size: 1.05rem; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; margin-top: 10px; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.guide-content { background: var(--surface); padding: 40px; border-radius: 16px; border: 1px solid var(--border); }
.guide-content h2 { font-size: 1.4rem; margin-bottom: 25px; color: #111827; border-bottom: 2px solid var(--border); padding-bottom: 15px; }
.guide-content h3 { font-size: 1.1rem; color: #1f2937; margin: 25px 0 10px 0; }
.guide-content p { color: #4b5563; font-size: 1rem; line-height: 1.7; margin-bottom: 15px; }
.guide-content code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; color: #dc2626; font-size: 0.9em; font-family: monospace; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.9); color: #fff; padding: 12px 24px; border-radius: 30px; font-weight: 600; font-size: 0.95rem; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, -10px); }