:root{
  --bg: #0f1419;
  --panel: #121a1f;
  --panel2: #0f1820;
  --accent: #25d8b2;
  --accent-soft: rgba(37,216,178,0.2);
  --text: #e8f8ff;
  --muted: #9ca7b4;
  --danger: #ff8a7f;
  --radius: 12px;
  --gap: 10px;
}
*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  height:100vh;
  display:flex;
  flex-direction:column;
}
#topbar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  background:#0b1015;
  border-bottom:1px solid rgba(255,255,255,0.03);
}
#topbar .title{
  font-weight:700;
  font-size:18px;
}
#topbar .subtitle{
  font-weight:400;
  font-size:14px;
  color:var(--muted);
  margin-left:6px;
}
#topbar .actions{
  display:flex;
  gap:6px;
  margin-left:16px;
}
.btn{
  background:#192028;
  border:none;
  color:var(--text);
  padding:5px 10px;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
  transition:background .12s;
}
.btn.primary{background:var(--accent);color:#001a13;font-weight:600;}
.btn.ghost{background:transparent;border:1px solid rgba(232,248,255,0.2);}
.btn:hover{background:#27313d;}
.btn.primary:hover{background:#36e6c0;}
#status{
  margin-left:auto;
  font-size:12px;
  color:var(--muted);
}
#layout{
  flex:1;
  display:grid;
  grid-template-columns:260px 1fr 280px;
  min-height:0;
}
#left,#right{
  background:var(--panel);
  padding:10px;
  overflow-y:auto;
}
#left h2,#right h2{margin:0 0 6px 0;font-size:16px;}
.hint{margin:0 0 10px 0;color:var(--muted);font-size:12px;}
#tileList{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.tile-entry{
  background:#0b1015;
  border-radius:12px;
  padding:6px 8px 6px 54px;
  position:relative;
  cursor:pointer;
  min-height:54px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}
.tile-entry .icon{
  position:absolute;
  top:7px;
  left:7px;
  width:38px;
  height:38px;
  background:#000;
  border-radius:10px;
  overflow:hidden;
}
.tile-entry .icon img{
  width:100%;
  height:100%;
  image-rendering:pixelated;
  display:block;
}
.tile-entry .idline{font-size:13px;font-weight:600;}
.tile-entry .name{font-size:12px;color:var(--muted);}
.tile-entry.active{
  outline:2px solid var(--accent);
  background:linear-gradient(90deg,rgba(37,216,178,0.25),rgba(15,20,25,0));
}
#main{
  background:var(--panel2);
  padding:14px 14px 14px 14px;
  overflow-y:auto;
}
#editor h2{margin-top:0;}
.field-row{margin-bottom:10px;display:flex;flex-direction:column;gap:4px;}
.field-row.inline{flex-direction:row;align-items:center;gap:10px;}
label{font-size:13px;color:var(--muted);}
input[type=text],input[type=number],textarea,select{
  background:#06090d;
  border:1px solid rgba(255,255,255,0.03);
  color:var(--text);
  border-radius:10px;
  padding:6px 8px;
  font-size:13px;
}
textarea{resize:vertical;min-height:60px;}
.id-input{
  display:flex;
  gap:6px;
  align-items:center;
}
.round-btn{
  width:34px;
  height:32px;
  border-radius:10px;
  border:none;
  background:#0d151e;
  color:var(--text);
  font-size:18px;
  cursor:pointer;
}
.round-btn:hover{background:#1f2a37;}
#currentIconBox{
  background:#020406;
  border:1px solid rgba(255,255,255,0.03);
  border-radius:12px;
  display:flex;
  gap:10px;
  align-items:center;
  padding:6px 10px;
  margin-bottom:8px;
}
#currentIconBox img{
  width:64px;
  height:64px;
  border-radius:10px;
  background:#000;
  image-rendering:pixelated;
}
#btnApply.full{width:100%;margin-top:12px;}
#jsonPanel{margin-top:14px;}
#jsonPanel.hidden{display:none;}
#jsonArea{
  width:100%;
  background:#020406;
  border:1px solid rgba(255,255,255,0.03);
  border-radius:10px;
  min-height:200px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:12px;
  line-height:1.4;
}
#iconList{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.icon-item{
  width:56px;
  background:#06090d;
  border-radius:10px;
  padding:3px;
  cursor:pointer;
  text-align:center;
  border:1px solid transparent;
}
.icon-item img{
  width:48px;
  height:48px;
  image-rendering:pixelated;
  display:block;
  margin:0 auto;
  border-radius:8px;
}
.icon-item span{
  display:block;
  font-size:9px;
  line-height:1.1;
  word-break:break-all;
  color:var(--muted);
}
.icon-item.active{border-color:var(--accent);background:rgba(37,216,178,0.05);}
#iconFilter{margin-bottom:6px;}
#iconSearch{width:100%;}
@media (max-width:1100px){
  #layout{grid-template-columns:240px 1fr;}
  #right{display:none;}
}


#topbar .actions .small-select{
  background:#192028;
  border:1px solid rgba(232,248,255,0.25);
  color:var(--text);
  border-radius:8px;
  padding:4px 8px;
  font-size:13px;
}
