:root{
  --bg:#0f1115; --bg2:#151920; --line:#242a33; --fg:#e7ebf0; --muted:#98a2b3;
  --accent:#5b8cff; --accent-ink:#0b1020; --ok:#3ddc97; --err:#ff6b6b;
  --radius:14px; --maxw:760px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--fg);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased;
  padding-bottom:env(safe-area-inset-bottom);
}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 16px;}
h1,h2{margin:0; font-weight:650; letter-spacing:-0.01em;}
h1{font-size:1.15rem}
h2{font-size:.95rem; color:var(--fg)}
.sub{margin:2px 0 0; font-size:.8rem; color:var(--muted)}

.top{border-bottom:1px solid var(--line); background:var(--bg2); position:sticky; top:0; z-index:5;}
.top-in{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px;}
.brand{display:flex; align-items:center; gap:10px}
.logo{display:grid; place-items:center; width:34px;height:34px;border-radius:10px;background:var(--accent);color:var(--accent-ink)}

main{padding-top:18px; padding-bottom:8px; display:flex; flex-direction:column; gap:14px}
.panel{background:var(--bg2); border:1px solid var(--line); border-radius:var(--radius); padding:16px}
.panel-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px}
.row-actions{display:flex; flex-wrap:wrap; gap:8px}
.count,.badge{font-size:.75rem; color:var(--muted); background:#1b212a; border:1px solid var(--line); padding:3px 8px; border-radius:999px}

#dropZone{border:1.5px dashed #313a47; text-align:center; cursor:pointer; transition:border-color .15s, background .15s;}
#dropZone:hover,#dropZone.drag{border-color:var(--accent); background:#171d28;}
#dropZone:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.dz-inner{padding:26px 16px; display:flex; flex-direction:column; align-items:center; gap:6px}
.dz-ico{color:var(--muted)}
.dz-title{margin:4px 0 0; font-weight:600}
.dz-hint{margin:0; color:var(--muted); font-size:.82rem}
.dz-actions{display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; justify-content:center}

.btn{appearance:none; border:1px solid var(--line); background:#1c222c; color:var(--fg);
  padding:9px 14px; border-radius:10px; font:inherit; font-size:.9rem; cursor:pointer; transition:background .15s, border-color .15s, opacity .15s;}
.btn:hover{background:#232b36; border-color:#39434f}
.btn:active{opacity:.85}
.btn:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.btn.primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600}
.btn.primary:hover{background:#6f9aff; border-color:#6f9aff}
.btn.ghost{background:transparent}
.btn.small{padding:6px 10px; font-size:.8rem}
.btn.icon-only{padding:8px; display:grid; place-items:center}
.btn[disabled]{opacity:.5; cursor:not-allowed}

.preview-box{background:#0b0e13; border:1px solid var(--line); border-radius:10px; overflow:auto; max-height:340px;}
.preview-box img{display:block; width:100%; height:auto}

.bar{height:6px; background:#232b36; border-radius:999px; overflow:hidden; margin-bottom:10px}
.bar-fill{height:100%; width:0%; background:var(--accent); transition:width .2s}
.status{margin:8px 0 0; font-size:.85rem; color:var(--muted); min-height:1.2em}
.status.err{color:var(--err)}
.status.ok{color:var(--ok)}

.lang-row{display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:4px}
.lang-row label{font-size:.85rem; color:var(--muted)}
select,input[type=text],input[type=password],textarea{
  background:#0e1218; color:var(--fg); border:1px solid var(--line); border-radius:10px;
  padding:9px 11px; font:inherit; font-size:.9rem; width:100%;
}
select{width:auto; flex:1 1 140px}
textarea{resize:vertical; min-height:120px; line-height:1.45; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.88rem}
select:focus,input:focus,textarea:focus{outline:2px solid var(--accent); outline-offset:1px}
label{display:block; font-size:.85rem; color:var(--muted); margin:12px 0 6px}
.settings .row-actions{margin-top:16px}
.hint{font-size:.8rem; color:var(--muted); margin:0 0 4px}

.foot{padding-top:8px; padding-bottom:28px}
.foot p{font-size:.78rem; color:#6f7a89; margin:0}

@media (max-width:480px){
  .lang-row{flex-direction:column; align-items:stretch}
  .lang-row .btn{width:100%}
  .dz-actions{flex-direction:column; width:100%}
  .dz-actions .btn{width:100%}
}
@media (prefers-color-scheme: light){
  :root{--bg:#f6f7f9;--bg2:#ffffff;--line:#e3e6ea;--fg:#14181f;--muted:#5d6773;--accent:#2f5fe0;--accent-ink:#ffffff;--ok:#0f9d63;--err:#c0392b}
  .btn{background:#eef0f3}
  .btn:hover{background:#e4e7ec}
  .count,.badge{background:#f1f3f6}
  select,input,textarea{background:#fbfbfd}
}
