:root{
  --bg:#0F172A;
  --card:#0E1B2A;
  --muted:#94A3B8;
  --text:#E6EEF6;
  --accent1:#06B6D4;
  --accent2:#0EA5E9;
  --success:#10B981;
  --error:#EF4444;
  --glass: rgba(255,255,255,0.03);
  --radius:16px;
  --shadow: 0 10px 30px rgba(2,6,23,0.6);
  --safe-top: env(safe-area-inset-top);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body,#app{height:100%}
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg,#071026 0%, #0F172A 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
  min-height:100vh;
}

.topbar{
  position:sticky;top:0;padding:12px 18px;padding-top:calc(12px + var(--safe-top));
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(255,255,255,0.03);
  z-index:40;
}
.topbar-inner{
  max-width:1100px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;
}
.logo{display:flex;align-items:center;gap:12px}
.logo-img{width:36px;height:36px;border-radius:9px;box-shadow:0 6px 18px rgba(14,165,233,0.12)}
.brand{font-weight:700;font-size:18px;letter-spacing:-0.3px;background:linear-gradient(90deg,var(--accent1),var(--accent2));-webkit-background-clip:text;-webkit-text-fill-color:transparent}

.icon-btn{width:40px;height:40px;border-radius:10px;background:transparent;border:1px solid rgba(255,255,255,0.03);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted)}
.icon-btn:hover{background:rgba(255,255,255,0.02);color:var(--accent2)}

.main{max-width:1100px;margin:28px auto;padding:0 18px}

.card{background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015));border:1px solid rgba(255,255,255,0.03);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card-inner{padding:28px}

.upload-card{display:flex;flex-direction:column;align-items:center;text-align:center}
.upload-svg{width:110px;height:110px}
.title{font-size:26px;margin-top:8px;font-weight:800}
.muted{color:var(--muted);margin-top:6px}
.file{display:none}

.actions{display:flex;gap:12px;margin-top:20px;width:100%;max-width:420px}
.btn{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:12px;border:none;cursor:pointer}
.btn .btn-icon{width:18px;height:18px;opacity:0.95}
.btn.primary{background:linear-gradient(90deg,var(--accent1),var(--accent2));color:#031124;font-weight:700;box-shadow:0 8px 30px rgba(14,165,233,0.12);flex:1}
.btn.ghost{background:transparent;border:1px solid rgba(255,255,255,0.03);color:var(--text);flex:1}

.badges{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px;justify-content:center}
.badge{background:var(--glass);border:1px solid rgba(255,255,255,0.03);padding:8px 12px;border-radius:999px;font-size:13px;color:var(--muted)}

.processing-card .card-inner{display:flex;flex-direction:column;gap:18px}
.preview-row{display:flex;gap:18px;align-items:flex-start}
.video-player{width:58%;height:auto;border-radius:12px;background:#000;border:1px solid rgba(255,255,255,0.02);object-fit:cover}
.status-panel{width:42%;display:flex;flex-direction:column;align-items:center;gap:12px}
.status-top{display:flex;gap:8px;align-items:center}
.status-chip{background:rgba(255,255,255,0.02);padding:8px 10px;border-radius:999px;font-size:13px;color:var(--muted);border:1px solid rgba(255,255,255,0.02)}

.progress-wrap{position:relative;width:140px;height:140px}
.progress-ring{width:100%;height:100%;transform:rotate(-90deg)}
.ring-bg{fill:none;stroke:rgba(255,255,255,0.04);stroke-width:8}
.ring-fg{fill:none;stroke: url(#progressGrad);stroke-width:8;stroke-linecap:round;stroke-dasharray:283;stroke-dashoffset:283;transition:stroke-dashoffset 400ms ease-out}
.progress-text{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:22px;background:transparent}
.progress-label{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:0.6px}

.steps{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.step{display:flex;align-items:center;gap:12px;padding:10px;border-radius:12px;background:transparent}
.step .dot{width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,0.02);display:flex;align-items:center;justify-content:center;font-weight:800}
.step .meta .name{font-weight:700}
.step .meta .sub{font-size:13px;color:var(--muted);margin-top:4px}

.controls-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:8px}
.control{display:flex;flex-direction:column;gap:8px;min-width:160px}
.control-label{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase}
.select{padding:10px;border-radius:10px;border:1px solid rgba(255,255,255,0.03);background:transparent;color:var(--text)}
.range input{width:220px}
.action-controls{display:flex;gap:10px;align-items:center}

.results-card .card-inner{display:flex;flex-direction:column;gap:12px}
.result-media{display:flex;gap:16px;align-items:center}
.result-player{width:60%;border-radius:10px;background:#000;border:1px solid rgba(255,255,255,0.03)}
.result-meta{flex:1;display:flex;flex-direction:column;gap:8px}
.meta-row{display:flex;justify-content:space-between;padding:8px 12px;border-radius:10px;background:rgba(255,255,255,0.01);border:1px solid rgba(255,255,255,0.02)}
.meta-actions{display:flex;gap:8px;margin-top:12px}

.credits-compact{text-align:right;margin-top:10px}
.link{background:none;border:none;color:var(--muted);cursor:pointer}

.footer{padding:18px 12px;margin-top:20px;border-top:1px solid rgba(255,255,255,0.02)}
.footer-inner{max-width:1100px;margin:0 auto;display:flex;justify-content:space-between;color:var(--muted)}

.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:80}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.6)}
.modal-card{position:relative;background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));border-radius:14px;padding:22px;max-width:820px;width:94%;z-index:3;border:1px solid rgba(255,255,255,0.03)}
.modal-close{position:absolute;right:12px;top:12px;background:transparent;border:none;color:var(--muted);font-size:18px;cursor:pointer}

.error-card .card-inner{text-align:center}
@media (max-width:900px){
  .preview-row{flex-direction:column}
  .video-player{width:100%}
  .status-panel{width:100%}
  .actions{flex-direction:column}
  .result-player{width:100%}
}