/* HT+ Setup Builder 2.0 — My Builds (Phase 1). Matches htb-v3 design tokens. */
.htbm-row{margin-top:8px}
.htbm-n{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-inline-start:6px;border-radius:9px;background:var(--v3-acc,#f5b301);color:#1a1006;font-size:11px;font-weight:800}
#htbm-active{display:inline-block;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;margin-inline-start:8px;padding:2px 8px;border-radius:8px;background:rgba(245,179,1,.14);border:1px solid rgba(245,179,1,.35);color:var(--v3-acc,#f5b301);font-size:11px;font-weight:700}
#htbm-active.flash{animation:htbmflash .8s ease}
@keyframes htbmflash{0%{background:rgba(52,211,153,.35)}100%{background:rgba(245,179,1,.14)}}

/* dialog + panel */
#htbm-dlg,#htbm-panel{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center}
.htbm-dlg-bd{position:absolute;inset:0;background:rgba(5,8,14,.62);backdrop-filter:blur(3px)}
.htbm-dlg-box{position:relative;width:min(92vw,380px);background:#141926;border:1px solid #2a2f3e;border-radius:16px;padding:18px;color:#e7ecf5;box-shadow:0 24px 60px rgba(0,0,0,.5)}
.htbm-dlg-box h4{margin:0 0 12px;font-size:15px}
.htbm-dlg-box input{width:100%;box-sizing:border-box;padding:10px 12px;border-radius:10px;border:1px solid #2a2f3e;background:#0d1220;color:#e7ecf5;font-size:14px}
.htbm-dlg-box input:focus{outline:2px solid var(--v3-acc,#f5b301);outline-offset:1px}
.htbm-dlg-btns{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}
.htbm-dlg-btns button{padding:8px 16px;border-radius:10px;border:1px solid #2a2f3e;cursor:pointer;font-weight:700;font-size:13px}
.htbm-dlg-btns .c{background:transparent;color:#93a0b8}
.htbm-dlg-btns .s{background:var(--v3-acc,#f5b301);border-color:var(--v3-acc,#f5b301);color:#1a1006}

.htbm-sheet{position:relative;width:min(94vw,460px);max-height:90vh;display:flex;flex-direction:column;background:#141926;border:1px solid #2a2f3e;border-radius:18px;color:#e7ecf5;box-shadow:0 24px 60px rgba(0,0,0,.5);overflow:hidden}
.htbm-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #222a38}
.htbm-head b{font-size:15px}
.htbm-x{background:none;border:0;color:#93a0b8;font-size:16px;cursor:pointer;padding:4px 8px;border-radius:8px}
.htbm-x:hover{background:#1c2334;color:#e7ecf5}
.htbm-body{overflow-y:auto;padding:10px;flex:1}
.htbm-foot{padding:10px 16px;border-top:1px solid #222a38;color:#93a0b8;font-size:12px}
.htbm-foot a{color:var(--v3-acc,#f5b301)}
.htbm-empty{text-align:center;color:#93a0b8;padding:32px 12px;font-size:13px;line-height:1.6}

.htbm-item{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 12px;border:1px solid #222a38;border-radius:12px;margin-bottom:8px;background:#0f1420}
.htbm-item.act{border-color:rgba(245,179,1,.5)}
.htbm-item.act::before{content:"";position:absolute;inset-inline-start:0;top:12px;bottom:12px;width:3px;border-radius:2px;background:var(--v3-acc,#f5b301)}
.htbm-star{background:none;border:0;font-size:16px;color:#3a4356;cursor:pointer;padding:2px}
.htbm-star.on{color:var(--v3-acc,#f5b301)}
.htbm-meta{flex:1;min-width:0}
.htbm-name{font-weight:700;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.htbm-arch{font-size:10px;color:#93a0b8;border:1px solid #2a2f3e;border-radius:6px;padding:1px 6px;margin-inline-start:6px;vertical-align:middle}
.htbm-sub{color:#93a0b8;font-size:11.5px;margin-top:2px}
.htbm-sub b{color:#e7ecf5}
.htbm-acts{display:flex;gap:6px}
.htbm-acts button{padding:6px 12px;border-radius:9px;border:1px solid #2a2f3e;background:#161d2c;color:#e7ecf5;font-size:12px;font-weight:700;cursor:pointer}
.htbm-acts button:first-child{background:var(--v3-acc,#f5b301);border-color:var(--v3-acc,#f5b301);color:#1a1006}
/* in-flow expansion: never clipped by the scroll container, always fully visible */
.htbm-menu{width:100%;display:flex;flex-wrap:wrap;gap:6px;background:#161d2c;border:1px solid #2a2f3e;border-radius:12px;padding:8px;margin-top:2px}
.htbm-menu button{flex:1 1 calc(50% - 6px);background:#0f1420;border:1px solid #1d2534;border-radius:9px;color:#e7ecf5;text-align:center;padding:9px 12px;font-size:12.5px;font-weight:700;cursor:pointer}
.htbm-menu button:hover{background:#1c2334;border-color:#2f3a50}
.htbm-menu .danger{color:#f87171}

/* account page cards */
#htbm-account{--gap:14px}
.htbm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:var(--gap);margin-top:14px}
.htbm-card{border:1px solid #222a38;border-radius:16px;background:#0f1420;color:#e7ecf5;overflow:hidden;display:flex;flex-direction:column;transition:transform .15s ease,border-color .15s ease}
.htbm-card:hover{transform:translateY(-2px);border-color:#2f3a50}
.htbm-card-img{height:130px;display:flex;align-items:center;justify-content:center;background:#0b0f18;position:relative}
.htbm-card-img img{max-height:110px;max-width:80%;object-fit:contain}
.htbm-card-img .noimg{color:#3a4356;font-size:34px}
.htbm-card-fav{position:absolute;top:8px;inset-inline-end:8px;background:rgba(13,18,32,.7);border:1px solid #2a2f3e;border-radius:9px;color:#3a4356;font-size:15px;cursor:pointer;padding:3px 8px}
.htbm-card-fav.on{color:var(--v3-acc,#f5b301)}
.htbm-card-bd{padding:12px 14px;flex:1}
.htbm-card-name{font-weight:800;font-size:14px;margin-bottom:4px}
.htbm-card-sub{color:#93a0b8;font-size:12px}
.htbm-card-sub b{color:#e7ecf5}
.htbm-card-acts{display:flex;gap:8px;padding:0 14px 14px;flex-wrap:wrap}
.htbm-card-acts button,.htbm-card-acts a{padding:7px 12px;border-radius:9px;border:1px solid #2a2f3e;background:#161d2c;color:#e7ecf5;font-size:12px;font-weight:700;cursor:pointer;text-decoration:none}
.htbm-card-acts .primary{background:var(--v3-acc,#f5b301);border-color:var(--v3-acc,#f5b301);color:#1a1006}
.htbm-card-acts .danger{color:#f87171}
.htbm-acct-empty{border:1px dashed #2a2f3e;border-radius:16px;padding:40px 20px;text-align:center;color:#93a0b8;margin-top:14px}
.htbm-trend{font-size:11.5px;font-weight:700;margin-top:6px;padding:3px 8px;border-radius:7px;display:inline-block}
.htbm-trend.dn{color:var(--v3-ok,#34d399);background:rgba(52,211,153,.1)}
.htbm-trend.up{color:var(--v3-warn,#fbbf24);background:rgba(251,191,36,.1)}
.htbm-hist{margin:0 14px 14px;border:1px solid #1d2534;border-radius:12px;padding:10px 12px;background:#0b0f18}
.htbm-hist-t{font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#93a0b8;margin-bottom:6px}
.htbm-hist-i{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;border-top:1px solid #141b29;font-size:12px;color:#c6d0e2}
.htbm-hist-i:first-child{border-top:0}
.htbm-hist-i button{background:#161d2c;border:1px solid #2a2f3e;color:#e7ecf5;border-radius:8px;padding:4px 12px;font-size:11.5px;font-weight:700;cursor:pointer}
.htbm-hist-i button:hover{border-color:var(--v3-acc,#f5b301)}
.htbm-hist-e{color:#93a0b8;font-size:12px}
body.ht-light .htbm-hist{background:#f4f6fa;border-color:#e3e7ef}
body.ht-light .htbm-hist-i{color:#3c4356;border-color:#e9edf4}
body.ht-light .htbm-hist-i button{background:#fff;border-color:#e3e7ef;color:#1c2130}
.htbm-acct-empty a{color:var(--v3-acc,#f5b301);font-weight:700}

/* light-mode support (site has a light theme layer) */
body.ht-light .htbm-dlg-box,body.ht-light .htbm-sheet,body.ht-light .htbm-item,body.ht-light .htbm-card{background:#fff;color:#1c2130;border-color:#e3e7ef}
body.ht-light .htbm-name,body.ht-light .htbm-card-name{color:#1c2130}
body.ht-light .htbm-menu{background:#fff;border-color:#e3e7ef}
body.ht-light .htbm-menu button{color:#1c2130}
body.ht-light .htbm-acts button,body.ht-light .htbm-card-acts button,body.ht-light .htbm-card-acts a{background:#f4f6fa;color:#1c2130;border-color:#e3e7ef}
body.ht-light .htbm-card-img{background:#f4f6fa}
body.ht-light .htbm-dlg-box input{background:#f4f6fa;color:#1c2130;border-color:#e3e7ef}

/* compare from the builder panel */
.htbm-cmpck{display:inline-flex;align-items:center;flex:none}
.htbm-cmpck input{accent-color:var(--v3-acc,#f5b301);cursor:pointer;width:16px;height:16px}
#htbm-cmpbar-in{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;margin:0 10px 10px;background:#161d2c;border:1px solid #2a2f3e;border-radius:12px;color:#e7ecf5;font-size:13px}
#htbm-cmpbar-in button{background:var(--v3-acc,#f5b301);border:0;color:#1a1006;border-radius:9px;padding:7px 16px;font-weight:800;cursor:pointer}
#htbc-modal{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center}
.htbc-box{position:relative;width:min(96vw,760px);max-height:86vh;display:flex;flex-direction:column;background:#141926;border:1px solid #2a2f3e;border-radius:18px;color:#e7ecf5;box-shadow:0 24px 60px rgba(0,0,0,.5);overflow:hidden}
.htbc-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #222a38}
.htbc-scroll{overflow:auto;padding:6px 8px 14px}
.htbc-tbl{width:100%;border-collapse:collapse;font-size:13px}
.htbc-tbl th,.htbc-tbl td{padding:9px 12px;text-align:center;border-bottom:1px solid #1a2130;white-space:nowrap}
.htbc-tbl thead th{position:sticky;top:0;background:#141926;color:var(--v3-acc,#f5b301)}
.htbc-tbl thead th:first-child,.htbc-lbl{text-align:start;color:#93a0b8;font-weight:700}
.htbc-hero td,.htbc-hero .htbc-lbl{font-size:15px;font-weight:800;border-bottom:1px solid #2a2f3e}
.htbc-win{color:var(--v3-ok,#34d399);font-weight:800}
.htbc-tabs{display:flex;gap:6px;padding:10px 16px 0}
.htbc-tabs button{background:transparent;border:1px solid #2a2f3e;color:#93a0b8;border-radius:9px 9px 0 0;padding:7px 16px;font-size:12.5px;font-weight:700;cursor:pointer;border-bottom:0}
.htbc-tabs button.on{background:#161d2c;color:var(--v3-acc,#f5b301)}
.htbc-parts td{white-space:normal;text-align:start;font-size:12.5px}
.htbc-parts .htbc-lbl{white-space:nowrap}
.htbc-diff{background:rgba(245,179,1,.08)}
body.ht-light .htbc-tabs button.on{background:#f4f6fa;color:#a97b00}
body.ht-light .htbc-diff{background:#fff8e6}
body.ht-light .htbc-box{background:#fff;color:#1c2130;border-color:#e3e7ef}
body.ht-light .htbc-tbl thead th{background:#fff}
body.ht-light #htbm-cmpbar-in{background:#f4f6fa;color:#1c2130;border-color:#e3e7ef}

#htbm-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:#141926;color:#e7ecf5;border:1px solid #2a2f3e;border-radius:12px;padding:10px 18px;font-size:13px;opacity:0;pointer-events:none;transition:all .25s ease;z-index:100001}
#htbm-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width:560px){
  .htbm-sheet{width:100vw;max-height:88vh;border-radius:18px 18px 0 0;align-self:flex-end}
  #htbm-panel{align-items:flex-end}
  .htbm-acts button{padding:8px 12px}
}
@media (prefers-reduced-motion:reduce){
  .htbm-card{transition:none}
  #htbm-active.flash{animation:none}
}
