:root{
  --hqb-text:#0f172a;
  --hqb-muted:#334155;
  --hqb-border:#e2e8f0;
  --hqb-bg:#ffffff;
  --hqb-soft:#f8fafc;
  --hqb-soft-2:#f1f5f9;
  --hqb-accent:#0ea5e9;
  --hqb-accent-600:#0284c7;
  --hqb-warn-bg:#fff7ed;
  --hqb-warn-bd:#fed7aa;
  --hqb-warn-tx:#9a3412;
  --hqb-err-bg:#fee2e2;
  --hqb-err-bd:#fecaca;
  --hqb-err-tx:#7f1d1d;
}

#builder{color:var(--hqb-text)}
.hqb-layout{display:flex;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.hqb-main{flex:1 1 620px;min-width:300px}
.hqb-side{flex:0 0 280px;display:flex;flex-direction:column;gap:.75rem}
@media (max-width: 900px){.hqb-layout{flex-direction:column}.hqb-side{flex:1 1 auto}}

.card{background:var(--hqb-bg);border:1px solid var(--hqb-border);border-radius:1rem;box-shadow:0 1px 2px rgba(15,23,42,.06);padding:.75rem}
.row{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:.4rem 0}
.rowlbl{min-width:56px;font-weight:700;color:var(--hqb-muted)}
.slot{width:92px;height:92px;border:2px dashed var(--hqb-border);border-radius:1rem;display:flex;align-items:center;justify-content:center;background:var(--hqb-soft-2);position:relative}
.slot img{width:88px;height:88px;border-radius:.9rem;object-fit:cover}
.slot .x{position:absolute;top:.25rem;right:.25rem;background:#fff;border:1px solid var(--hqb-border);border-radius:.5rem;padding:.15rem .35rem;font-size:.8rem;cursor:pointer;display:none}
.slot.filled .x{display:block}
.slot.dragover{outline:2px dashed #2563eb; outline-offset:2px}
.badge{font-size:.7rem;border:1px solid var(--hqb-border);background:var(--hqb-soft);padding:.1rem .4rem;border-radius:.5rem;color:var(--hqb-text)}
.badge.role{display:inline-flex;align-items:center;gap:.35rem;padding:.15rem .45rem;border-radius:.5rem}
.btn{background:var(--hqb-accent);border:1px solid var(--hqb-accent-600);color:#fff;padding:.45rem .65rem;border-radius:.6rem;cursor:pointer}
.btn.secondary{background:#fff;color:var(--hqb-text);border-color:var(--hqb-border)}
.pill{padding:.35rem .6rem;border:1px solid var(--hqb-border);border-radius:999px;background:#fff;cursor:pointer}
.pill[aria-pressed="true"]{background:var(--hqb-accent);color:#f8fafc;border-color:var(--hqb-accent-600)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.75rem;margin-top:.75rem}
.meta{padding:.5rem .6rem;display:flex;justify-content:space-between;gap:.5rem;align-items:center}
.meta .name{font-weight:700;cursor:default}
.meta .right{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap}
.actions{margin-top:.75rem;justify-content:flex-end}
.warn{background:var(--hqb-warn-bg);border:1px solid var(--hqb-warn-bd);color:var(--hqb-warn-tx);border-radius:.6rem;padding:.5rem .75rem}
.error{background:var(--hqb-err-bg);border:1px solid var(--hqb-err-bd);color:var(--hqb-err-tx);border-radius:.5rem;padding:.5rem .75rem}

/* FULL hover tooltip */
.hqb-tip{position:fixed; z-index:9999; max-width:540px; background:#fff; color:var(--hqb-text);
  border:1px solid var(--hqb-border); border-radius:.9rem; box-shadow:0 12px 40px rgba(2,6,23,.22);
  pointer-events:none; opacity:0; transform:translate(-50%,-110%); transition:opacity .12s ease, transform .12s ease; }
.hqb-tip.show{opacity:1; transform:translate(-50%,-100%);}
.hqb-tip .tip-head{display:flex;gap:.6rem;align-items:center;border-bottom:1px solid var(--hqb-border);padding:.6rem .75rem}
.hqb-tip .tip-head img{width:60px;height:60px;border-radius:.6rem;border:1px solid var(--hqb-border);object-fit:cover}
.hqb-tip .tip-title{font-weight:800}
.hqb-tip .tip-badges{display:flex;gap:.35rem;flex-wrap:wrap}
.hqb-tip .tip-body{padding:.6rem .75rem;max-height:360px;overflow:auto}
.hqb-sec{margin:.55rem 0}
.hqb-sec h4{margin:0 0 .25rem 0;font-size:.95rem}
.hqb-kv{width:100%;border-collapse:collapse;margin:.2rem 0}
.hqb-kv th,.hqb-kv td{padding:.25rem .4rem;border-bottom:1px solid #eef2f7;text-align:left;vertical-align:top; font-size:.9rem}
.hqb-list{margin:.1rem 0 .25rem 1rem}
.hqb-list li{margin:.1rem 0}
.hqb-pilltag{display:inline-block;border:1px solid var(--hqb-border);border-radius:999px;padding:.12rem .5rem;background:var(--hqb-soft);margin:.1rem; font-size:.85rem}