.modal-overlay:has(.wb-studio){padding:16px}
.modal:has(.wb-studio){display:flex;flex-direction:column;overflow:hidden;width:min(1040px,calc(100vw - 32px));max-width:1040px;height:min(820px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
.modal:has(.wb-studio) .modal-head,.modal:has(.wb-studio) .modal-foot{flex:none}
.modal:has(.wb-studio) .modal-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:20px}
.wb-studio{display:flex;flex-direction:column;flex:1;min-height:0;gap:14px}
.wb-studio .wb-toolbar{margin:0;gap:12px}
.wb-studio .wb-search{border-radius:14px;background:rgba(8,7,14,.64)}
.wb-studio .wb-layout{grid-template-columns:250px minmax(0,1fr);flex:1;height:auto;min-height:0;max-height:none;border-color:var(--border-subtle);border-radius:20px;background:var(--bg-panel)}
.wb-studio .wb-tree{min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 10px;background:rgba(8,7,14,.45);scrollbar-width:thin}
.wb-studio .wb-work{margin-bottom:10px}
.wb-studio .wb-work button{min-width:0;line-height:1.5;transition:background .15s,border-color .15s,transform .15s}
.wb-studio .wb-work button:active{transform:scale(.98)}
.wb-studio .wb-work-title{font-weight:650;font-size:12px}
.wb-studio .wb-work-title.selected{background:rgba(168,85,247,.13);border-color:rgba(168,85,247,.25)}
.wb-studio .wb-work button .wb-tree-chevron{display:grid;place-items:center;flex:none;width:10px;overflow:visible;transform:rotate(-90deg);transition:transform .15s;color:#8f7da3}
.wb-studio .wb-work button[aria-expanded="true"]>.wb-tree-chevron{transform:rotate(0deg)}
.wb-studio .wb-tree-chevron .icon{width:10px;height:10px}
.wb-studio .wb-work-title>small{flex:none;white-space:nowrap;font-size:9px}
.wb-global-node>.wb-scene-button{color:#d4b9ec}
.wb-studio .wb-global-overview{font-size:10px;color:#b9a1ce}
.wb-studio .wb-scenes{margin-left:12px;padding-left:6px;border-color:rgba(168,85,247,.2)}
.wb-studio .wb-scene-button{font-size:11px}
.wb-studio .wb-entry-tree{margin:5px 0 9px 12px;padding-left:6px;border-left:1px solid rgba(255,255,255,.06)}
.wb-studio .wb-entry-node{font-size:11px;padding:8px 6px;gap:7px;border-radius:10px;color:#a99fb9}
.wb-studio .wb-entry-node>span:nth-child(2){display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wb-studio .wb-entry-node.selected{background:linear-gradient(110deg,rgba(168,85,247,.19),rgba(236,72,153,.09));border-color:rgba(168,85,247,.4);color:#ead8ff}
.wb-node-dot{width:5px;height:5px;border-radius:50%;background:#82738f;flex:none!important}
.wb-entry-node.selected .wb-node-dot{background:#d0a0ff;box-shadow:0 0 9px rgba(168,85,247,.35)}
.wb-entry-node.is-disabled{opacity:.5}
.wb-tree-empty{display:block;padding:12px 7px;font-size:10px;line-height:1.7;color:var(--text-sub)}
.wb-studio .wb-content{display:flex;flex-direction:column;min-width:0;min-height:0;padding:0;overflow:hidden;background:rgba(20,18,30,.65)}
.wb-studio .wb-scene-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex:none;padding:17px 22px;margin:0;border-bottom:1px solid var(--border-subtle)}
.wb-studio .wb-scene-head>div{min-width:0}
.wb-studio .wb-scene-head .eyebrow{font-size:9px;letter-spacing:.8px}
.wb-studio .wb-scene-head h3{font-size:18px;line-height:1.5;margin:5px 0 0;overflow-wrap:anywhere}
.wb-studio .wb-scene-head .wb-scope-hint{font-size:10px;line-height:1.6;margin:5px 0 0;color:#a894ba}
.wb-scene-details{flex:none;max-width:56%;font-size:11px;color:var(--text-sub)}
.wb-scene-details summary{cursor:pointer;padding:7px 9px;border:1px solid var(--border-subtle);border-radius:10px;color:#c7b6dc;white-space:nowrap}
.wb-studio .wb-scene-details p{font-size:11px;line-height:1.7;margin:10px 0;max-height:100px;overflow:auto}
.wb-scene-details .btn{font-size:10px;padding:7px 9px}
#wb-entry-pane{flex:1;min-width:0;min-height:0;overflow:hidden}
.wb-inline-editor{display:flex;flex-direction:column;height:100%;min-height:0;margin:0}
.wb-editor-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px;scrollbar-width:thin}
.wb-editor-heading{margin-bottom:22px}
.wb-editor-heading .eyebrow{font-size:9px;letter-spacing:2px;color:#ba87e8}
.wb-editor-heading h3{margin:7px 0 8px;font-size:21px}
.wb-editor-heading small{display:block;font-size:10px;color:var(--text-sub);overflow-wrap:anywhere}
.wb-inline-editor .field{margin-bottom:20px}
.wb-inline-editor .field label{font-size:12px}
.wb-inline-editor .field small{font-size:10px;line-height:1.7}
.wb-inline-editor input,.wb-inline-editor textarea{min-width:0;border-radius:12px;background:rgba(8,7,14,.55)}
.wb-inline-editor textarea{min-height:180px;max-height:340px;resize:vertical;line-height:1.9;font-size:12px}
.wb-keyword-chips{display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-height:26px;margin:4px 0 10px}
.wb-keyword-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:5px 8px 5px 10px;border:1px solid rgba(168,85,247,.22);border-radius:10px;background:rgba(168,85,247,.12);font-size:11px;color:#dec3fb;line-height:1.5}
.wb-keyword-chip>span{min-width:0;overflow-wrap:anywhere}
.wb-keyword-chip button{display:grid;place-items:center;flex:none;width:21px;height:21px;border:0;border-radius:7px;background:transparent;color:#b99ccd;cursor:pointer}
.wb-keyword-chip button:hover{background:rgba(236,72,153,.18);color:#f2cee6}
.wb-keyword-chip .icon{width:12px;height:12px}
.wb-keyword-empty{color:var(--text-sub);font-size:11px}
.wb-key-add{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.wb-key-add input{flex:1;min-width:0}
.wb-key-add .btn{flex:none}
.wb-entry-switches{display:flex;flex-direction:column;gap:12px;padding:12px 0}
.wb-entry-switches .checkline{font-size:11px}
.wb-inline-save{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:13px 20px;border-top:1px solid var(--border-subtle);background:rgba(17,16,26,.98)}
.wb-inline-save>span{color:var(--text-sub);font-size:10px;line-height:1.6}
.wb-inline-save .row{flex:none;gap:7px}
.wb-entry-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:28px;height:100%;min-height:200px;text-align:center}
.wb-entry-empty>.icon{width:38px;height:38px;color:#a77ccc;margin-bottom:4px}
.wb-entry-empty .eyebrow{color:#9d70c2;font-size:9px;letter-spacing:2px}
.wb-entry-empty h3{font-size:18px;margin:0;color:#e2d3f0}
.wb-entry-empty p{max-width:280px;margin:0;font-size:12px;line-height:1.8;color:var(--text-sub)}
.wb-scope-overview{justify-content:flex-start;overflow:auto;overscroll-behavior:contain;min-height:0}
.wb-scope-overview>*{flex-shrink:0}
.wb-scope-overview p{max-width:480px}
.wb-scope-overview .wb-scope-description{width:100%;white-space:pre-wrap;overflow-wrap:anywhere;text-align:left;padding:14px 16px;border:1px solid #a855f71c;border-radius:12px;background:#a855f708;color:#cfbfdc}
.wb-scope-overview>.row{justify-content:center}
.wb-readonly-entry{height:100%;overflow:auto;padding:24px;overscroll-behavior:contain}
.wb-readonly-entry h3{font-size:20px;margin:20px 0 14px;overflow-wrap:anywhere}
.wb-readonly-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;font-size:13px;color:#c8bfd4;margin:20px 0}
.wb-studio>.story-hint{margin:0;font-size:10px}
@media(max-width:700px){
 .modal-overlay:has(.wb-studio){padding:8px}
 .modal:has(.wb-studio){width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}
 .modal:has(.wb-studio) .modal-body{padding:12px}
 .wb-studio{gap:10px}
 .wb-studio .wb-toolbar{gap:7px}
 .wb-studio .wb-toolbar>.btn{font-size:10px;padding:10px 8px}
 .wb-studio .wb-search{padding:0 8px}
 .wb-studio .wb-search input{font-size:11px}
 .wb-studio .wb-layout{grid-template-columns:minmax(100px,30%) minmax(0,1fr);height:auto;min-height:0;border-radius:15px}
 .wb-studio .wb-tree{padding:8px 4px}
 .wb-studio .wb-work button{padding:8px 4px;gap:4px;font-size:10px}
 .wb-studio .wb-work button>.icon{display:none}
 .wb-studio .wb-work button small{font-size:8px}
 .wb-studio .wb-scenes{margin-left:4px;padding-left:4px}
 .wb-studio .wb-entry-tree{margin-left:5px;padding-left:4px}
 .wb-studio .wb-entry-node{font-size:9px}
 .wb-studio .wb-scene-head{display:block;padding:12px}
 .wb-studio .wb-scene-head h3{font-size:15px}
 .wb-scene-details{max-width:100%;margin-top:8px}
 .wb-scene-details summary{display:inline-block;font-size:9px;padding:5px 8px}
 .wb-editor-scroll{padding:16px 12px}
 .wb-editor-heading{margin-bottom:18px}
 .wb-editor-heading h3{font-size:17px}
 .wb-inline-editor .field label{font-size:11px}
 .wb-inline-editor input,.wb-inline-editor textarea{font-size:11px;padding:10px}
 .wb-inline-editor textarea{min-height:170px}
 .wb-key-add{gap:5px}
 .wb-key-add .btn{padding:9px 7px;font-size:10px}
 .wb-keyword-chip{font-size:10px;padding:4px 5px 4px 8px}
 .wb-inline-save{padding:10px;align-items:flex-start;flex-direction:column;gap:6px}
 .wb-inline-save>.row{width:100%;justify-content:flex-end}
 .wb-inline-save .btn{font-size:10px;padding:9px 10px}
 .wb-entry-empty{padding:18px 12px}
 .wb-entry-empty h3{font-size:15px}
 .wb-entry-empty p{font-size:11px}
 .wb-readonly-entry{padding:16px 12px}
 .wb-readonly-entry h3{font-size:17px}
 .wb-readonly-text{font-size:12px}
 .wb-studio>.story-hint{font-size:9px;line-height:1.6}
}
