:root { --ink: #1f1235; --violet: #3b0082; --pink: #fb00bf; --gold: #ffd700; --line: #e4dff0; --bg: #f7f5fb; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--violet); color: #fff; font-weight: 600; }
button.secondary { background: #fff; color: var(--violet); border: 1px solid var(--violet); }
button.danger { background: #fff; color: #c3002f; border: 1px solid #c3002f; }
button:disabled { opacity: .55; cursor: wait; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--violet); text-decoration: none; font-size: 18px; }
.brand img { width: 30px; height: 30px; }
.title { color: #6b5f80; }
.formats { margin-left: auto; display: flex; border: 1px solid var(--violet); border-radius: 10px; overflow: hidden; }
.formats button { border-radius: 0; background: #fff; color: var(--violet); padding: 8px 18px; }
.formats button.on { background: var(--violet); color: #fff; }
.layout { flex: 1; display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 20px; max-width: 1280px; width: 100%; margin: 0 auto; }
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sheet { position: relative; background: #fff; box-shadow: 0 6px 30px rgba(59,0,130,.15); border-radius: 4px; overflow: hidden; touch-action: none; user-select: none;
  background-image: linear-gradient(45deg, #f1eef7 25%, transparent 25%, transparent 75%, #f1eef7 75%), linear-gradient(45deg, #f1eef7 25%, transparent 25%, transparent 75%, #f1eef7 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.safe { position: absolute; border: 1px dashed #b7a9d6; pointer-events: none; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: #8a7fa0; margin: 0; }
.item { position: absolute; left: 0; top: 0; cursor: grab; }
.item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.item.sel { outline: 2px dashed var(--pink); outline-offset: 2px; }
.item.bad { outline: 2px solid #e0002a; outline-offset: 2px; }
.item.blur::after { content: "!"; position: absolute; right: -8px; top: -8px; width: 18px; height: 18px; border-radius: 50%; background: #f5a200; color: #fff; font: 700 12px/18px sans-serif; text-align: center; }
.handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.item.sel .handle { display: block; }
.hint { color: #7a6e90; font-size: 13px; }
.panel { display: flex; flex-direction: column; gap: 14px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.box h3 { margin: 0; font-size: 16px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
input:not([type=checkbox]):not([type=file]), textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
input[type=range] { accent-color: var(--pink); }
.upload { position: relative; align-items: center; justify-content: center; padding: 16px; border: 2px dashed var(--pink); border-radius: 12px; color: var(--pink); font-weight: 700; cursor: pointer; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.uploads { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #6b5f80; }
.uploads .err { color: #c3002f; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issues p { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.issues .bad { background: #ffe8ec; color: #a10022; }
.issues .warn { background: #fff4dc; color: #8a5a00; }
.error { color: #c3002f; margin: 0; font-size: 13px; white-space: pre-line; }
.ads { background: linear-gradient(135deg, #fff, #fff8d6); }
.ads a { color: var(--violet); text-decoration: none; font-weight: 600; }
.ads a::before { content: "→ "; color: var(--pink); }
.done { flex: 1; max-width: 720px; margin: 30px auto; padding: 0 20px; text-align: center; }
.done img { max-width: 100%; max-height: 60vh; background: #fff; box-shadow: 0 6px 30px rgba(59,0,130,.15); }
.status { font-size: 18px; font-weight: 700; color: var(--violet); }
.warnings { text-align: left; color: #8a5a00; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; color: #7a6e90; font-size: 13px; border-top: 1px solid var(--line); background: #fff; }
.foot a { color: var(--violet); font-weight: 700; text-decoration: none; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 12px; } }
