.tool-preview-layer{
  position:fixed;
  inset:0;
  z-index:11000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.tool-preview-layer.is-open{display:flex}
.tool-preview-backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.74);
  backdrop-filter:blur(14px) saturate(135%);
}
.tool-preview-modal{
  position:relative;
  z-index:1;
  width:min(1440px,calc(100vw - 32px));
  height:min(900px,calc(100vh - 32px));
  display:flex;
  flex-direction:column;
  border-radius:28px;
  overflow:hidden;
  border:1px solid rgba(125,211,252,.16);
  background:linear-gradient(180deg,rgba(8,14,26,.96),rgba(10,18,33,.94));
  box-shadow:0 40px 100px rgba(2,6,23,.55), inset 0 1px 0 rgba(255,255,255,.06);
}
.tool-preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid rgba(148,163,184,.14);
  background:linear-gradient(180deg,rgba(15,23,42,.72),rgba(15,23,42,.46));
}
.tool-preview-title-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.tool-preview-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:linear-gradient(135deg,#f59e0b,#22d3ee);
  box-shadow:0 0 18px rgba(34,211,238,.45);
  flex-shrink:0;
}
.tool-preview-title{
  color:#f8fafc;
  font-size:15px;
  font-weight:800;
  letter-spacing:.01em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tool-preview-meta{
  color:rgba(148,163,184,.8);
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.tool-preview-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}
.tool-preview-btn{
  appearance:none;
  border:none;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.tool-preview-btn:hover{transform:translateY(-1px)}
.tool-preview-btn--ghost{
  background:rgba(15,23,42,.58);
  color:rgba(226,232,240,.9);
  border:1px solid rgba(148,163,184,.18);
}
.tool-preview-btn--primary{
  background:linear-gradient(135deg,#3b82f6,#8b5cf6);
  color:#fff;
  box-shadow:0 12px 26px rgba(59,130,246,.24);
}
.tool-preview-body{
  position:relative;
  flex:1;
  min-height:0;
  background:#0a0f1b;
}
.tool-preview-loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(226,232,240,.8);
  font-size:14px;
  font-weight:700;
  letter-spacing:.02em;
  background:
    radial-gradient(circle at 20% 20%, rgba(34,211,238,.08), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(245,158,11,.08), transparent 30%),
    rgba(10,15,27,.94);
}
.tool-preview-frame{
  width:100%;
  height:100%;
  border:none;
  display:block;
  background:#0a0f1b;
  opacity:0;
  transition:opacity .24s ease;
}
.tool-preview-frame.is-ready{opacity:1}
html[data-theme="light"] .tool-preview-modal{
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(241,245,249,.92));
  border-color:rgba(15,23,42,.08);
  box-shadow:0 28px 80px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.72);
}
html[data-theme="light"] .tool-preview-header{
  background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(248,250,252,.72));
  border-bottom-color:rgba(15,23,42,.08);
}
html[data-theme="light"] .tool-preview-title{color:#0f172a}
html[data-theme="light"] .tool-preview-meta{color:rgba(51,65,85,.72)}
html[data-theme="light"] .tool-preview-btn--ghost{
  background:rgba(255,255,255,.76);
  color:#0f172a;
  border-color:rgba(15,23,42,.1);
}
@media (max-width: 900px){
  .tool-preview-layer{padding:12px}
  .tool-preview-modal{
    width:calc(100vw - 12px);
    height:calc(100vh - 12px);
    border-radius:22px;
  }
  .tool-preview-header{
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .tool-preview-actions{
    width:100%;
    justify-content:space-between;
  }
}
