#tb3d,.tb-modal{--tb-acc:#b5651d;--tb-bg:#faf8f5;--tb-line:#e3ddd4;--tb-tx:#2b2724;--tb-mu:#7a716a;font-family:"Be Vietnam Pro",system-ui,sans-serif;color:var(--tb-tx);font-size:14px;line-height:1.45}
#tb3d *,.tb-modal *{box-sizing:border-box}
.tb-main{display:flex;height:calc(100vh - 140px);min-height:560px;border:1px solid var(--tb-line);border-radius:12px;overflow:hidden;background:#fff}
.tb-stage{position:relative;flex:1;min-width:0;background:#eeeae4}
.tb-view{position:absolute;inset:0}
.tb-view canvas{display:block;touch-action:none}
.tb-info{position:absolute;left:12px;top:12px;max-width:calc(100% - 24px);background:rgba(255,255,255,.92);border-radius:8px;padding:0 10px;font-size:13px;pointer-events:none}
.tb-info:not(:empty){padding:6px 10px;box-shadow:0 1px 4px rgba(0,0,0,.12)}
.tb-tools{position:absolute;left:12px;right:12px;bottom:12px;display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;background:rgba(255,255,255,.94);border-radius:10px;padding:8px 12px;box-shadow:0 1px 6px rgba(0,0,0,.12)}
.tb-open{display:flex;gap:6px;align-items:center;font-weight:600}
.tb-open input{width:110px;accent-color:var(--tb-acc)}
.tb-chk{display:inline-flex;gap:5px;align-items:center;cursor:pointer;user-select:none}
.tb-chk input{accent-color:var(--tb-acc)}
.tb-quote{margin-left:auto}
.tb-side{width:420px;max-width:46%;display:flex;flex-direction:column;border-left:1px solid var(--tb-line);background:var(--tb-bg)}
.tb-tabs{display:flex;border-bottom:1px solid var(--tb-line)}
.tb-tabs button{flex:1;padding:12px 6px;border:0;background:none;font:inherit;font-weight:600;color:var(--tb-mu);cursor:pointer;border-bottom:2px solid transparent}
.tb-tabs button.on{color:var(--tb-acc);border-bottom-color:var(--tb-acc)}
.tb-pane{flex:1;overflow:auto;padding:14px 16px 24px}
.tb-pane h3{font-size:15px;margin:14px 0 8px}
.tb-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px}
.tb-f{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--tb-mu)}
.tb-f input,.tb-f select,.tb-mod select,.tb-mod input,.tb-pane textarea,.tb-picker input,.tb-dlg input,.tb-dlg textarea{font:inherit;color:var(--tb-tx);border:1px solid var(--tb-line);border-radius:7px;padding:7px 8px;background:#fff;width:100%}
.tb-row{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin:10px 0}
.tb-run{border:1px solid var(--tb-line);border-radius:10px;padding:10px;margin-bottom:10px;background:#fff}
.tb-run-h{display:flex;justify-content:space-between;align-items:center;font-weight:600;margin-bottom:6px;font-size:13px}
.tb-mod{display:grid;grid-template-columns:26px 1.5fr 64px 1fr auto;gap:5px;align-items:center;margin-bottom:6px}
.tb-mod select,.tb-mod input{padding:5px 4px;font-size:12.5px}
.tb-mod-n{font-weight:700;color:var(--tb-acc);font-size:12px}
.tb-mod-b{display:flex;gap:2px}
.tb-mod-b button{border:1px solid var(--tb-line);background:#fff;border-radius:5px;width:24px;height:26px;cursor:pointer;padding:0}
.tb-mod-pk{grid-column:2/6;font-size:11.5px;color:var(--tb-mu);margin-top:-3px}
.tb-btn,.tb-btn-s{font:inherit;font-weight:600;border-radius:8px;padding:8px 14px;cursor:pointer;border:1px solid var(--tb-acc)}
.tb-btn{background:var(--tb-acc);color:#fff}
.tb-btn-s{background:#fff;color:var(--tb-acc)}
.tb-btn:disabled{opacity:.5}
.tb-link{border:0;background:none;color:var(--tb-acc);cursor:pointer;font:inherit;font-size:12px;text-decoration:underline;padding:0}
.tb-err{background:#fdecea;color:#9b2c1f;border-radius:8px;padding:10px;margin:10px 0;white-space:pre-line}
.tb-sum{font-size:12.5px;color:var(--tb-mu)}
.tb-note{font-size:12.5px;color:var(--tb-mu);margin:6px 0}
.tb-notes{font-size:12.5px;margin-top:8px}
.tb-notes ul{padding-left:18px;margin:6px 0}
.tb-notes li{margin-bottom:4px}
.tb-pa{display:flex;gap:6px;flex-wrap:wrap}
.tb-pa button{border:1px solid var(--tb-line);background:#fff;border-radius:20px;padding:6px 12px;font:inherit;font-size:12.5px;cursor:pointer}
.tb-pa button.on{background:var(--tb-acc);border-color:var(--tb-acc);color:#fff}
.tb-slot{display:grid;grid-template-columns:52px 1fr auto auto;gap:10px;align-items:center;padding:8px;border:1px solid var(--tb-line);border-radius:10px;margin-bottom:8px;background:#fff;cursor:pointer}
.tb-slot.on{border-color:var(--tb-acc)}
.tb-sw{width:52px;height:52px;border-radius:8px;background-size:cover;background-position:center;border:1px solid rgba(0,0,0,.08)}
.tb-sm{font-size:12px;color:var(--tb-mu)}
.tb-picker{border:1px solid var(--tb-acc);border-radius:10px;padding:10px;background:#fff}
.tb-chips{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0}
.tb-chips button{border:1px solid var(--tb-line);background:#fff;border-radius:16px;padding:3px 10px;font:inherit;font-size:12px;cursor:pointer}
.tb-chips button.on{background:var(--tb-tx);color:#fff;border-color:var(--tb-tx)}
.tb-grid-sw{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px;margin:8px 0}
.tb-it{border:1px solid var(--tb-line);background:#fff;border-radius:8px;padding:4px;cursor:pointer;text-align:left;font:inherit;display:flex;flex-direction:column;gap:2px;min-width:0}
.tb-it .tb-sw{width:100%;height:64px}
.tb-it span{font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb-it small{font-size:10.5px;color:var(--tb-mu);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb-tbl{width:100%;border-collapse:collapse;margin:8px 0;font-size:12.5px}
.tb-tbl th,.tb-tbl td{border-bottom:1px solid var(--tb-line);padding:5px 4px;text-align:left}
.tb-tbl .r{text-align:right;white-space:nowrap}
.tb-tbl-s{font-size:11.5px}
.tb-chat{display:flex;flex-direction:column;gap:8px;max-height:calc(100vh - 430px);min-height:180px;overflow:auto;margin-bottom:10px}
.tb-msg{padding:8px 11px;border-radius:12px;max-width:92%;white-space:pre-line;font-size:13.5px}
.tb-msg.ai{background:#fff;border:1px solid var(--tb-line);align-self:flex-start}
.tb-msg.me{background:var(--tb-acc);color:#fff;align-self:flex-end}
.tb-msg img{display:block;max-width:100%;border-radius:8px;margin-bottom:6px}
.tb-imgp{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.tb-imgp img{height:60px;border-radius:6px}
.tb-modal{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:99999;padding:16px}
.tb-dlg{background:#fff;border-radius:14px;padding:18px;width:min(460px,100%);max-height:92vh;overflow:auto;display:flex;flex-direction:column;gap:8px;font-family:"Be Vietnam Pro",system-ui,sans-serif}
.tb-dlg h3{margin:0 0 4px}
.tb-shot{width:100%;border-radius:8px}
@media (max-width:860px){
  .tb-main{flex-direction:column;height:auto}
  .tb-stage{height:62vh;min-height:380px;flex:none}
  .tb-side{width:100%;max-width:none;border-left:0;border-top:1px solid var(--tb-line)}
  .tb-pane{max-height:none}
  .tb-tools{gap:6px 10px;padding:6px 8px;font-size:12.5px}
  .tb-open input{width:80px}
  .tb-chat{max-height:50vh}
  .tb-mod{grid-template-columns:24px 1fr .8fr auto}
  .tb-mod>select[title]{grid-column:2/4}
}
.tb-cab td{font-weight:700;background:#f1ece5;color:var(--tb-acc)}
.tb-src{font-size:11.5px;color:var(--tb-mu);margin-top:14px;padding-top:8px;border-top:1px dashed var(--tb-line)}
.tb-col{border:1px solid var(--tb-line);border-radius:10px;padding:10px;margin-bottom:10px;background:#fff}
.tb-col-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:13px;color:var(--tb-acc)}
.tb-col .tb-f .tb-chk{color:var(--tb-tx);font-size:12.5px;margin-right:8px}
.tb-busy{position:absolute;right:12px;top:12px;background:rgba(43,39,36,.82);color:#fff;font-size:12px;padding:5px 10px;border-radius:14px}
.tb-f-wide{grid-column:1/-1;flex-direction:row!important;gap:16px!important;align-items:center}
.tb-f-wide .tb-chk{white-space:nowrap}

.tb-rd-btn{border-color:#2f2a26;color:#2f2a26;font-weight:700}
.tb-rd-btn:hover{background:#2f2a26;color:#fff}
.tb-rd-dlg{width:min(760px,100%)}
.tb-rd-img{position:relative;border-radius:10px;overflow:hidden;background:#eee;min-height:120px}
.tb-rd-img img{display:block;width:100%;height:auto}
.tb-rd-img .tb-rd-prev{filter:grayscale(.35) blur(1px);opacity:.75}
.tb-rd-bar{height:4px;border-radius:4px;background:#efe7df;overflow:hidden}
.tb-rd-bar i{display:block;height:100%;width:35%;background:var(--tb-acc);border-radius:4px;animation:tbrd 1.3s ease-in-out infinite}
@keyframes tbrd{0%{transform:translateX(-100%)}100%{transform:translateX(300%)}}
.tb-rd-dlg a.tb-btn-s{display:inline-flex;align-items:center;text-decoration:none}
.tb-rd-ai{background:linear-gradient(135deg,#6d4bd8,#b5651d);border-color:transparent;color:#fff}
.tb-rd-ai:disabled{opacity:.45;cursor:not-allowed}
