:root{
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #151515;
  --panel2: #1b1b1b;
  --text: #e8e8e8;
  --muted: #9b9b9b;
  --border: #232323;
  --border2:#2b2b2b;
  --accent:#d1d1d1;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial;
  background:var(--bg);
  color:var(--text);
}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}
.header{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(1.1) blur(6px);
  background:rgba(10,10,10,.7);
  border-bottom:1px solid var(--border);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:14px 0}
.brand{
  font-size:18px;font-weight:600;color:var(--text);background:none;border:none;cursor:pointer;
}
.brand:hover{opacity:.9}
.nav{display:flex;gap:18px;font-size:14px;color:#c9c9c9}
.nav-link{color:#c9c9c9;background:none;border:none;padding:0;cursor:pointer}
.nav-link:hover{color:#fff}
.main{padding:28px 0}
.screen{display:grid;grid-template-columns:1fr;gap:24px}
@media (min-width:1024px){ .screen{grid-template-columns:1fr 1fr} }
.card{background:linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02));border:1px solid var(--border);border-radius:16px;padding:16px}
.card-title{color:var(--muted);font-size:13px;margin-bottom:10px}
.frame{position:relative; width:100%; aspect-ratio:16/10; background:#000; border:1px solid var(--border2); border-radius:12px; overflow:hidden;}
.relative{position:relative}
.img{width:100%;height:100%;display:block}
.contain{object-fit:contain;background:#000}
.cover{object-fit:cover;background:#000}
.no-pointer{pointer-events:none}
.dropzone{
  margin-top:80px;
  display:flex;align-items:center;gap:16px;justify-content:center;
  background:linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02));
  border:1px dashed var(--border2); border-radius:16px; padding:36px; cursor:pointer;
  text-align:center;
}
.dropzone:focus{outline:2px solid #3b82f6; outline-offset:2px}
.dropzone.drag{border-color:#cfcfcf}
.drop-icon{display:grid;place-items:center;width:64px;height:64px;border:1px solid var(--border2);border-radius:16px;color:#cfcfcf}
.drop-text .title{font-weight:600}
.drop-text .hint{font-size:12px;color:var(--muted);margin-top:6px}
.hidden{display:none}
.hidden-input{position:absolute;left:-9999px;opacity:0}
.gen-search{display:flex;flex-direction:column;align-items:center;gap:12px; padding:24px}
.spinner{display:grid;place-items:center;width:56px;height:56px;border:1px solid var(--border2);border-radius:50%;color:#cfcfcf;animation:spin 1.2s linear infinite}
.spinner svg{animation:none}
@keyframes spin{to{transform:rotate(360deg)}}
.gen-text{font-size:14px;color:#d6d6d6}
.progress{width:240px;height:8px;background:#202020;border-radius:999px;overflow:hidden;border:1px solid var(--border2)}
.progress-bar{height:100%;background:#e5e5e5;width:0%;transition:width .1s linear}
.space-y > * + *{margin-top:14px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid button{position:relative;aspect-ratio:16/10;border:1px solid var(--border2);border-radius:10px;background:#000;overflow:hidden;cursor:pointer}
.grid button.active{border-color:#d1d1d1}
.grid img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.grid button:hover img{opacity:.9}
.arrow{
  position:absolute; z-index:10; top:50%; transform:translateY(-50%);
  border:1px solid rgba(120,120,120,.5); background:rgba(20,20,20,.7); color:#e6e6e6;
  padding:8px 12px; border-radius:999px; cursor:pointer; user-select:none; font-size:14px;
}
.arrow.left{left:8px}
.arrow.right{right:8px}
.arrow:hover{background:#242424}
.gen-empty{display:grid;place-items:center; height:calc(100% - 40px); color:#b6b6b6; font-size:14px}
.hidden{display:none !important}
