* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Arial, sans-serif; color: #1b2430; background: radial-gradient(circle at top left, rgba(93,135,255,.18), transparent 28%), radial-gradient(circle at bottom right, rgba(0,199,154,.16), transparent 30%), #f3f6fb; scroll-behavior: smooth; }
body { min-height: 100vh; }
.page-shell { padding: 24px; }
.container { max-width: 1320px; margin: 0 auto; }
.hero-card { background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 20px 60px rgba(30,55,90,.12); border-radius: 24px; padding: 28px; }
.hero-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: bold; letter-spacing: .12em; text-transform: uppercase; color: #5577ff; margin-bottom: 8px; }
.hero-top h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.1; }
.hero-top p { margin: 0; max-width: 740px; color: #546173; font-size: 16px; line-height: 1.5; }
.hero-badge { padding: 14px 18px; background: linear-gradient(135deg, #3f7cff, #34c8a5); color: #fff; border-radius: 18px; font-weight: bold; white-space: nowrap; box-shadow: 0 12px 30px rgba(63,124,255,.24); }
.alert { border-radius: 16px; padding: 16px 18px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fff1f1; border: 1px solid #f3c0c0; color: #a03131; }
.alert-success { background: #eefcf4; border: 1px solid #b7e8ca; color: #0d7b45; }
.hidden { display: none !important; }
.layout-grid { display: grid; grid-template-columns: 460px 1fr; gap: 22px; }
.panel { background: #fff; border: 1px solid #edf1f6; border-radius: 22px; padding: 22px; box-shadow: 0 8px 24px rgba(26,41,61,.05); }
.panel-title { font-size: 20px; font-weight: bold; margin-bottom: 18px; }
.panel-subtitle { font-size: 15px; font-weight: bold; margin: 20px 0 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full-width { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: bold; }
.field input, .field select { width: 100%; border: 1px solid #dce5ef; background: #fff; border-radius: 14px; padding: 12px 14px; font-size: 14px; color: #1b2430; outline: none; }
.field input:focus, .field select:focus { border-color: #4d82ff; box-shadow: 0 0 0 4px rgba(77,130,255,.10); }

.field-hint { font-size: 12px; color: #667487; }
.mini-warning { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: #fff8e8; border: 1px solid #f0dfad; color: #6b5b1c; font-size: 13px; line-height: 1.45; }
.checkbox-field label { display: flex; align-items: center; gap: 10px; }
.checkbox-field input[type="checkbox"] { width: auto; margin: 0; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 14px; padding: 13px 18px; font-size: 14px; font-weight: bold; cursor: pointer; text-decoration: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #336dff, #32c7a6); box-shadow: 0 12px 28px rgba(51,109,255,.24); }
.btn-light { color: #304055; background: #edf3fa; }

.btn-success { color: #fff; background: linear-gradient(135deg, #18a957, #39c77c); box-shadow: 0 10px 24px rgba(24,169,87,.22); }
.alert-actions { margin-top: 12px; }
.preview-dropzone { min-height: 620px; }
.preview-dropzone canvas { width: auto; height: auto; max-width: 100%; max-height: 860px; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.preview-dropzone { overflow: auto; }
.preview-dropzone { position: relative; border: 2px dashed #b6c5da; border-radius: 22px; background: linear-gradient(180deg, #f9fbff, #f3f7fd); min-height: 620px; padding: 16px; display: flex; align-items: center; justify-content: center; overflow: auto; cursor: pointer; transition: .25s ease; }
.preview-dropzone.is-dragover { border-color: #4d82ff; background: linear-gradient(180deg, #f5f9ff, #edf4ff); }
.preview-dropzone canvas { width: auto; height: auto; max-width: 100%; max-height: 860px; display: block; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(30,55,90,.12); image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #667487; font-weight: bold; font-size: 16px; pointer-events: none; }
.dropzone { display: block; position: relative; border: 2px dashed #b6c5da; border-radius: 22px; background: linear-gradient(180deg, #f9fbff, #f3f7fd); padding: 24px 18px; text-align: center; cursor: pointer; transition: .25s ease; margin-bottom: 18px; }
.dropzone:hover, .dropzone.is-dragover { border-color: #4d82ff; background: linear-gradient(180deg, #f5f9ff, #edf4ff); transform: translateY(-1px); }
.dropzone-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: linear-gradient(135deg, #3f7cff, #34c8a5); color: #fff; font-size: 34px; line-height: 54px; font-weight: bold; }
.dropzone-text { font-size: 16px; font-weight: bold; margin-bottom: 6px; }
.dropzone-hint { font-size: 13px; color: #667487; }
.empty-state { border: 1px dashed #cad6e4; border-radius: 18px; padding: 18px; color: #6a7687; background: #fafcff; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.thumb-card { background: #fff; border: 1px solid #e7edf5; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 18px rgba(24,42,70,.06); cursor: grab; }
.thumb-card.dragging { opacity: .45; }
.thumb-image-wrap { aspect-ratio: 1 / 1; background: #f4f7fb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-meta { padding: 10px 10px 12px; }
.thumb-name { font-size: 12px; line-height: 1.35; color: #364355; height: 32px; overflow: hidden; }
.thumb-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.thumb-index { font-size: 12px; color: #64748a; font-weight: bold; }
.thumb-remove { border: 0; background: #f25f5c; color: #fff; border-radius: 10px; font-size: 12px; padding: 7px 10px; cursor: pointer; }
.hidden-file-input { position: absolute; left: -9999px; opacity: 0; }
.loading-overlay { position: fixed; inset: 0; background: rgba(14,22,38,.34); display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; z-index: 1000; }
.spinner { width: 52px; height: 52px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.loading-text { color: #fff; font-size: 15px; font-weight: bold; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1080px) { .layout-grid { grid-template-columns: 1fr; } .preview-dropzone canvas { max-width: 100%; } }
@media (max-width: 760px) { .hero-top { flex-direction: column; } .hero-top h1 { font-size: 28px; } .field-grid, .thumbs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .page-shell { padding: 12px; } .hero-card, .panel { padding: 16px; } .field-grid, .thumbs { grid-template-columns: 1fr; } }
