
:root{
  --bg:#12141a; --panel:#1b1e27; --panel2:#20242f; --accent:#5b8cff;
  --text:#e8eaf0; --muted:#9aa0b0; --border:#2b2f3b; --danger:#ff5b6e;
}
*{box-sizing:border-box;}
body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;}
a{color:var(--accent);text-decoration:none;}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;background:var(--panel);border-bottom:1px solid var(--border);}
.brand{font-weight:700;font-size:20px;letter-spacing:.5px;}
.topbar nav a{margin-left:18px;font-weight:600;}
.container{max-width:1100px;margin:0 auto;padding:24px;}
h1,h2,h3{margin-top:0;}
.card{background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:20px;margin-bottom:20px;}
table{width:100%;border-collapse:collapse;}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--border);}
input[type=text],input[type=number],select,textarea{
  background:var(--panel2);border:1px solid var(--border);color:var(--text);
  padding:8px 10px;border-radius:6px;font-size:14px;width:100%;
}
button, .btn{
  background:var(--accent);color:#fff;border:none;padding:9px 16px;border-radius:6px;
  cursor:pointer;font-weight:600;font-size:14px;
}
button.secondary{background:var(--panel2);border:1px solid var(--border);}
button.danger{background:var(--danger);}
button:disabled{opacity:.5;cursor:not-allowed;}
.row{display:flex;gap:16px;flex-wrap:wrap;}
.row > *{flex:1;min-width:200px;}
.msg{padding:10px 14px;border-radius:6px;margin-bottom:16px;}
.msg.ok{background:#1d3b2b;border:1px solid #2f6a48;}
.msg.err{background:#3b1d24;border:1px solid #6a2f3d;}
.thumb-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(115px,1fr));
    gap:10px;
    margin-top:14px;
}

.thumb-card{
    position:relative;
    aspect-ratio:2 / 3;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:6px;
    background:#000;
}

.thumb-card img{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
}

.thumb-delete{
    position:absolute;
    top:6px;
    right:6px;
    z-index:2;
    width:28px;
    height:28px;
    padding:0;
    border:1px solid rgba(255,255,255,.65);
    border-radius:50%;
    background:rgba(190,25,45,.94);
    color:#fff;
    font-size:22px;
    font-weight:700;
    line-height:24px;
    cursor:pointer;
    box-shadow:0 1px 4px rgba(0,0,0,.65);
}

.thumb-delete:hover{
    background:#ff3c55;
    transform:scale(1.08);
}

.thumb-delete:disabled{
    cursor:wait;
    opacity:.55;
}
.inline-form{display:flex;gap:8px;align-items:center;}
.dropzone{border:2px dashed var(--border);border-radius:10px;padding:30px;text-align:center;color:var(--muted);cursor:pointer;}
.dropzone.drag{border-color:var(--accent);color:var(--text);}
.dropzone.busy{opacity:.6;pointer-events:none;}
.progress{height:6px;background:var(--panel2);border-radius:4px;overflow:hidden;margin-top:8px;}
.progress > div{height:100%;background:var(--accent);width:0%;transition:width .15s linear;}
.progress > div.processing{background:#e0a63d;animation:pulse 1.1s ease-in-out infinite;}
@keyframes pulse{0%{opacity:.5;}50%{opacity:1;}100%{opacity:.5;}}
.upload-list{margin-top:10px;font-size:13px;color:var(--muted);max-height:140px;overflow-y:auto;}
.upload-list div{padding:2px 0;}

/* Preview page layout */
.preview-wrap{display:flex;gap:24px;align-items:flex-start;}
.stage-col{flex:1;min-width:0;}
#stage{background:#000;border-radius:10px;display:block;border:1px solid var(--border);}
.side-col{width:300px;flex-shrink:0;}
.side-col .card label{display:block;margin:12px 0 4px;font-size:13px;color:var(--muted);font-weight:600;}
.export-actions{display:flex;gap:10px;margin-top:16px;}
.small-muted{font-size:12px;color:var(--muted);}
