
/* BIN TAJ STUDIO V4.2 consolidated QA fixes. Design tokens inherited from V4.1. */
/* 1 — Sidebar progress legibility */
body[data-bt-portal="owner"] #bt10SideProgress{
  background:var(--v4-card2)!important;border:1px solid var(--v4-line)!important;
  color:var(--v4-text)!important;box-shadow:0 5px 20px rgba(20,24,55,.08)!important;
  margin:10px 12px 18px!important;padding:13px!important;flex-shrink:0!important;
}
body[data-bt-portal="owner"] #bt10SideProgress .title{color:var(--v4-text)!important;opacity:1!important;font-weight:800!important;font-size:11px!important}
body[data-bt-portal="owner"] #bt10SideProgress .numbers,body[data-bt-portal="owner"] #bt10SideProgress .numbers b{color:var(--v4-text)!important;opacity:1!important;}
body[data-bt-portal="owner"] #bt10SideProgress .numbers span{color:var(--v4-green, #179e7a)!important;font-weight:800!important}
body[data-bt-portal="owner"] #bt10SideProgress .bar{background:var(--v4-line)!important}
body[data-bt-portal="owner"] #bt10SideProgress .bar i{background:var(--v4-purple)!important}
/* 2 — Members: equal heights and fixed button baseline regardless of name/description length. */
body[data-bt-portal="owner"] .member-list.bt12-member-grid{display:grid!important;align-items:stretch!important;grid-template-columns:repeat(auto-fit,minmax(265px,1fr))!important;gap:14px!important}
body[data-bt-portal="owner"] .member-list.bt12-member-grid>.member-card{display:flex!important;flex-direction:column!important;min-width:0!important;min-height:324px!important;height:100%!important;overflow:visible!important;}
body[data-bt-portal="owner"] .member-card .member-card-top{min-height:93px!important;flex-shrink:0!important;}
body[data-bt-portal="owner"] .member-card .bt125-io,body[data-bt-portal="owner"] .member-card .bt124-card-reason,body[data-bt-portal="owner"] .member-card .bt112-meta-row{flex-shrink:0!important;}
body[data-bt-portal="owner"] .member-card .bt124-card-reason{min-height:36px!important;max-height:65px!important;overflow:hidden!important;line-height:1.45!important;}
body[data-bt-portal="owner"] .member-card .member-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;align-items:stretch!important;margin-top:auto!important;padding-top:13px!important;position:relative!important;bottom:auto!important;}
body[data-bt-portal="owner"] .member-card .member-actions>.btn{margin:0!important;width:100%!important;min-height:38px!important;height:38px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:12px!important;}
/* 3 — WhatsApp-style full-height chat, even with zero messages. */
body[data-bt-portal="owner"] #content:has(.bt132-chat-shell){display:flex!important;flex-direction:column!important;min-height:calc(100dvh - 118px)!important;}
body[data-bt-portal="owner"] #content .bt132-chat-shell{display:grid!important;grid-template-columns:minmax(230px,320px) minmax(0,1fr)!important;min-height:clamp(510px,calc(100dvh - 245px),980px)!important;height:clamp(510px,calc(100dvh - 245px),980px)!important;flex:1 1 auto!important;overflow:hidden!important;align-items:stretch!important;}
body[data-bt-portal="owner"] #content .bt132-chat-shell .bt132-chat{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;min-height:0!important;height:100%!important;overflow:hidden!important;}
body[data-bt-portal="owner"] #content .bt132-chat-shell .bt132-chat-log{min-height:0!important;max-height:none!important;height:100%!important;overflow-y:auto!important;padding:18px!important;}
body[data-bt-portal="owner"] #content .bt132-chat-shell .bt132-compose{position:relative!important;inset:auto!important;display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;gap:9px!important;align-items:center!important;min-height:76px!important;height:auto!important;padding:11px 14px!important;flex-shrink:0!important;border-top:1px solid var(--v4-line)!important;}
body[data-bt-portal="owner"] #content .bt132-compose textarea{resize:vertical!important;min-height:45px!important;max-height:120px!important;width:100%!important;color:var(--v4-text)!important;background:var(--v4-input,var(--v4-card2))!important;border:1px solid var(--v4-line)!important;border-radius:13px!important;padding:12px 15px!important;}
body[data-bt-portal="owner"] #content .bt132-compose .btn{min-height:42px!important;height:auto!important;align-self:center!important;}
body[data-bt-portal="owner"] #content .bt132-chat-head{background:var(--v4-card2)!important;border-color:var(--v4-line)!important;}
body[data-bt-portal="owner"] #content .bt132-list{height:100%!important;max-height:100%!important;overflow-y:auto!important;background:var(--v4-card)!important;border-color:var(--v4-line)!important;}
body[data-bt-portal="owner"] #content .bt132-chat-log{background:var(--v4-bg)!important;}
body[data-bt-portal="owner"] #content .bt132-compose{background:var(--v4-card)!important;}
body[data-bt-portal="worker"] .chat-card{height:clamp(540px,calc(100dvh - 145px),1000px)!important;min-height:0!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;}
body[data-bt-portal="worker"] .chatlog{min-height:0!important;height:100%!important;max-height:none!important;}
/* 4 — AI popover/chat uses the same light/dark tokens as the rest of Studio. */
body[data-bt-portal] #modal,body[data-bt-portal] .modal-card,body[data-bt-portal] .modal-box,body[data-bt-portal] .bt129-ai-popover,body[data-bt-portal] .bt129-ai-modal{
  color:var(--v4-text)!important;border-color:var(--v4-line)!important;
}
body[data-bt-portal] .modal-card,body[data-bt-portal] .modal-box,body[data-bt-portal] .bt129-ai-popover,body[data-bt-portal] .bt129-ai-modal,body[data-bt-portal] .bt129-ai-panel,body[data-bt-portal] .bt129-ai-answer,
body[data-bt-portal] .bt1212-ai-shell .bt1212-card,body[data-bt-portal] .bt1212-provider,body[data-bt-portal] .bt1212-model-card{
  background:var(--v4-card)!important;color:var(--v4-text)!important;border:1px solid var(--v4-line)!important;box-shadow:var(--v4-shadow)!important;
}
body[data-bt-portal] .bt129-ai-modal :is(h2,h3,h4,strong,b),body[data-bt-portal] .bt1212-ai-shell :is(h2,h3,h4,strong,b){color:var(--v4-text)!important}
body[data-bt-portal] .bt129-ai-modal :is(p,small,span),body[data-bt-portal] .bt1212-ai-shell :is(p,small,span){color:var(--v4-muted)!important}
body[data-bt-portal] .bt1212-free-bar,body[data-bt-portal] .bt1212-free-list,body[data-bt-portal] .bt1212-rule,body[data-bt-portal] .bt1212-modal-note,body[data-bt-portal] .bt1212-chip{background:var(--v4-card2)!important;color:var(--v4-text)!important;border-color:var(--v4-line)!important}
body[data-bt-portal] .bt1212-free-list .bt1212-free-row b{color:var(--v4-text)!important}
body[data-bt-portal] .bt1212-free-title{color:var(--v4-muted)!important}
body[data-bt-portal] .bt129-ai-modal :is(input,textarea,select),body[data-bt-portal] .bt1212-ai-shell :is(input,textarea,select){background:var(--v4-input,var(--v4-card2))!important;color:var(--v4-text)!important;border-color:var(--v4-line)!important}
/* 5 — model connection diagnostic messages */
.v42-ai-health{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--v4-card2);border:1px solid var(--v4-line);border-radius:12px;padding:10px 13px;color:var(--v4-text);font-size:12px;margin:12px 0}
.v42-ai-health strong{font-size:12px;color:var(--v4-text)}
.v42-ai-health span{color:var(--v4-muted)}
.v42-ai-health .status{font-weight:750;color:var(--v4-purple)}
@media(max-width:850px){body[data-bt-portal="owner"] #content .bt132-chat-shell{display:flex!important;flex-direction:column!important;height:auto!important;min-height:calc(100dvh - 210px)!important;max-height:none!important}body[data-bt-portal="owner"] #content .bt132-chat-shell .bt132-list{height:180px!important;flex:0 0 180px!important;overflow-y:auto!important}body[data-bt-portal="owner"] #content .bt132-chat-shell .bt132-chat{min-height:500px!important;height:clamp(500px,67dvh,900px)!important}body[data-bt-portal="owner"] .member-list.bt12-member-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important}}
@media(max-width:430px){body[data-bt-portal="owner"] .member-list.bt12-member-grid{grid-template-columns:1fr!important}body[data-bt-portal="owner"] #content .bt132-compose{padding:8px!important}}
/* SS4 — real ultra-AI modal classes, not generic guessed class names. */
body[data-bt-portal="owner"] #modal .modal-card,
body[data-bt-portal="owner"] #modal .modal-head,
body[data-bt-portal="owner"] #modalBody{
  color:var(--v4-text)!important;
  background:var(--v4-card)!important;
  border-color:var(--v4-line)!important;
}
body[data-bt-portal="owner"] #modal .modal-head{border-radius:16px 16px 0 0!important;}
body[data-bt-portal="owner"] #modal .modal-head h3,
body[data-bt-portal="owner"] #modalBody :is(h3,h4,b,strong){color:var(--v4-text)!important}
body[data-bt-portal="owner"] #modalBody :is(.bt1215-ai-head,.bt129-ai-box,.bt129-ai-meta,.notice,.bt1215-ai-chip,.bt1213-error-note){
 background:var(--v4-card2)!important;color:var(--v4-text)!important;border:1px solid var(--v4-line)!important;
}
body[data-bt-portal="owner"] #modalBody .bt1215-ai-head :is(p,small){color:var(--v4-muted)!important}
body[data-bt-portal="owner"] #modalBody .bt1215-ai-chip{color:var(--v4-green,#139872)!important;font-weight:780!important}
body[data-bt-portal="owner"] #modalBody :is(input,textarea,select){color:var(--v4-text)!important;background:var(--v4-input,var(--v4-card2))!important;border-color:var(--v4-line)!important}
